mirror of
https://github.com/vale981/ray
synced 2025-03-04 17:41:43 -05:00
Shellcheck comments (#9595)
This commit is contained in:
parent
a2f31195c6
commit
4f470c3fc1
11 changed files with 24 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This file exists for Jenkins compatiblity
|
||||
|
||||
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
||||
|
|
|
@ -1,3 +1,4 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
source activate tensorflow_p36
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script build docker images for autoscaler.
|
||||
# For now, we only build python3.6 images.
|
||||
set -e
|
||||
|
|
|
@ -367,6 +367,7 @@ lint() {
|
|||
# Checkout a clean copy of the repo to avoid seeing changes that have been made to the current one
|
||||
(
|
||||
WORKSPACE_DIR="$(TMPDIR="${WORKSPACE_DIR}/.." mktemp -d)"
|
||||
# shellcheck disable=SC2030
|
||||
ROOT_DIR="${WORKSPACE_DIR}"/ci/travis
|
||||
git worktree add -q "${WORKSPACE_DIR}"
|
||||
pushd "${WORKSPACE_DIR}"
|
||||
|
@ -381,6 +382,7 @@ _check_job_triggers() {
|
|||
job_names="$1"
|
||||
|
||||
local variable_definitions
|
||||
# shellcheck disable=SC2031
|
||||
variable_definitions=($(python "${ROOT_DIR}"/determine_tests_to_run.py))
|
||||
if [ 0 -lt "${#variable_definitions[@]}" ]; then
|
||||
local expression restore_shell_state=""
|
||||
|
@ -392,6 +394,7 @@ _check_job_triggers() {
|
|||
eval "${restore_shell_state}" "${expression}" # Restore set -x, then evaluate expression
|
||||
fi
|
||||
|
||||
# shellcheck disable=SC2086
|
||||
if ! (set +x && should_run_job ${job_names//,/ }); then
|
||||
if [ "${GITHUB_ACTIONS-}" = true ]; then
|
||||
# If this job is to be skipped, emit 'exit' into .bashrc to quickly exit all following steps.
|
||||
|
@ -433,6 +436,7 @@ init() {
|
|||
|
||||
configure_system
|
||||
|
||||
# shellcheck disable=SC2031
|
||||
. "${ROOT_DIR}"/install-dependencies.sh # Script is sourced to propagate up environment changes
|
||||
}
|
||||
|
||||
|
|
|
@ -86,6 +86,7 @@ if [ "${CI-}" = true ]; then
|
|||
# If we are in master build, we can write to the cache as well.
|
||||
upload=0
|
||||
if [ "${TRAVIS_PULL_REQUEST-false}" = false ]; then
|
||||
# shellcheck disable=SC2154
|
||||
if [ -n "${BAZEL_CACHE_CREDENTIAL_B64:+x}" ]; then
|
||||
{
|
||||
printf "%s" "${BAZEL_CACHE_CREDENTIAL_B64}" | base64 -d - >> "${HOME}/bazel_cache_credential.json"
|
||||
|
@ -93,11 +94,13 @@ if [ "${CI-}" = true ]; then
|
|||
upload=1
|
||||
elif [ -n "${encrypted_1c30b31fe1ee_key:+x}" ]; then
|
||||
{
|
||||
# shellcheck disable=SC2154
|
||||
openssl aes-256-cbc -K "${encrypted_1c30b31fe1ee_key}" \
|
||||
-iv "${encrypted_1c30b31fe1ee_iv}" \
|
||||
-in "${ROOT_DIR}/bazel_cache_credential.json.enc" \
|
||||
-out "${HOME}/bazel_cache_credential.json" -d
|
||||
} 2>&- # avoid printing secrets
|
||||
# shellcheck disable=SC2181
|
||||
if [ 0 -eq $? ]; then
|
||||
upload=1
|
||||
fi
|
||||
|
|
|
@ -58,6 +58,7 @@ invoke_cc() {
|
|||
case "${cc##*/}" in
|
||||
clang*)
|
||||
# Call iwyu with the modified arguments and environment variables (env -i starts with a blank slate)
|
||||
# shellcheck disable=SC2016
|
||||
{ PATH="${PATH}:/usr/bin" env -i "${env_vars[@]}" "${SHELL-/bin/bash}" -c 'iwyu -isystem "$("$1" -print-resource-dir "${@:2}")/include" "${@:2}"' exec "${args[@]}" 2>&1 || true; } | awk '
|
||||
# Awk script to remove noise in the iwyu output
|
||||
{ header = 0; }
|
||||
|
@ -85,6 +86,7 @@ main() {
|
|||
data="$(exec sed -e "s/\(0x[0-9a-fA-F]*\)]\(,\a\)/\"\1\"]\2/g" -e "s/,\(\a\s*\(]\|\$\)\)/\1/g" -e "s/\a/\n/g" <<< "${data}")"
|
||||
# Parse the resulting JSON and select the actual fields we're interested in.
|
||||
# We put the environment variables first, separating them from the command-line arguments via '--'.
|
||||
# shellcheck disable=SC1003
|
||||
data="$(PATH="${PATH}:${MINGW_DIR-/usr}/bin" && exec jq -r '(
|
||||
[]
|
||||
+ [.[1:][] | select (.[0] == 6) | "\(.[1][1])=\(.[2][1])" | gsub("'\''"; "'\''\\'\'''\''") | "'\''\(.)'\''"]
|
||||
|
|
|
@ -84,6 +84,7 @@ systemctl enable ray
|
|||
echo "Starting ray..."
|
||||
systemctl start ray
|
||||
|
||||
# shellcheck disable=SC2154
|
||||
if [ "$type" = "head" ]; then
|
||||
echo "Configure TensorBoard to start at boot..."
|
||||
systemctl enable tensorboard
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# This script automatically download ray and run the sanity check (sanity_check.py)
|
||||
# in various Python version. This script requires conda command to exist.
|
||||
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
if [[ -z "$RAY_HASH" ]]; then
|
||||
echo "RAY_HASH env var should be provided"
|
||||
exit 1
|
||||
|
|
|
@ -1,3 +1,5 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
cd ~/efs/lm
|
||||
|
||||
# download the dataset
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# Stop backend processes
|
||||
ray stop
|
||||
# Kill Java workers
|
||||
# shellcheck disable=SC2009
|
||||
ps aux | grep DefaultWorker | grep -v grep | awk '{print $2}' | xargs kill -9
|
||||
# Remove temp files
|
||||
rm -rf /tmp/ray
|
||||
|
|
Loading…
Add table
Reference in a new issue