mirror of
https://github.com/vale981/ray
synced 2025-03-12 14:16:39 -04:00

* Fix SC2001: See if you can use ${variable//search/replace} instead. * Fix SC2010: Don't use ls | grep. Use a glob or a for loop with a condition to allow non-alphanumeric filenames. * Fix SC2012: Use find instead of ls to better handle non-alphanumeric filenames. * Fix SC2015: Note that A && B || C is not if-then-else. C may run when A is true. * Fix SC2028: echo may not expand escape sequences. Use printf. * Fix SC2034: variable appears unused. Verify use (or export if used externally). * Fix SC2035: Use ./*glob* or -- *glob* so names with dashes won't become options. * Fix SC2071: > is for string comparisons. Use -gt instead. * Fix SC2154: variable is referenced but not assigned * Fix SC2164: Use 'cd ... || exit' or 'cd ... || return' in case cd fails. * Fix SC2188: This redirection doesn't have a command. Move to its command (or use 'true' as no-op). * Fix SC2236: Use -n instead of ! -z. * Fix SC2242: Can only exit with status 0-255. Other data should be written to stdout/stderr. * Fix SC2086: Double quote to prevent globbing and word splitting. Co-authored-by: Mehrdad <noreply@github.com>
174 lines
8.1 KiB
Bash
Executable file
174 lines
8.1 KiB
Bash
Executable file
#!/usr/bin/env bash
|
|
|
|
# Cause the script to exit if a single command fails.
|
|
set -e
|
|
|
|
# Show explicitly which commands are currently running.
|
|
set -x
|
|
|
|
MEMORY_SIZE=$1
|
|
SHM_SIZE=$2
|
|
DOCKER_SHA=$3
|
|
|
|
ROOT_DIR=$(cd "$(dirname "${BASH_SOURCE:-$0}")"; pwd)
|
|
SUPPRESS_OUTPUT=$ROOT_DIR/../suppress_output
|
|
|
|
if [ "$MEMORY_SIZE" == "" ]; then
|
|
MEMORY_SIZE="20G"
|
|
fi
|
|
if [ "$SHM_SIZE" == "" ]; then
|
|
SHM_SIZE="20G"
|
|
fi
|
|
if [ "$DOCKER_SHA" == "" ]; then
|
|
echo "Building application docker."
|
|
docker build -q --no-cache -t ray-project/base-deps docker/base-deps
|
|
|
|
# Add Ray source
|
|
git rev-parse HEAD > ./docker/tune_test/git-rev
|
|
git archive -o ./docker/tune_test/ray.tar "$(git rev-parse HEAD)"
|
|
if [ "$CI_BUILD_FROM_SOURCE" == "1" ]; then
|
|
DOCKER_SHA=$(docker build --no-cache -q -t ray-project/tune_test docker/tune_test -f docker/tune_test/build_from_source.Dockerfile)
|
|
else
|
|
DOCKER_SHA=$(docker build --no-cache -q -t ray-project/tune_test docker/tune_test)
|
|
fi
|
|
fi
|
|
|
|
echo "Using Docker image" "$DOCKER_SHA"
|
|
|
|
######################## TUNE TESTS #################################
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
pytest /ray/python/ray/tune/tests/test_actor_reuse.py
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
pytest /ray/python/ray/tune/tests/test_tune_restore.py
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/tests/example.py
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
bash -c 'pip install -U tensorflow && python /ray/python/ray/tune/tests/test_logger.py'
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
bash -c 'pip install -U tensorflow==1.15 && python /ray/python/ray/tune/tests/test_logger.py'
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
bash -c 'pip install -U tensorflow==1.14 && python /ray/python/ray/tune/tests/test_logger.py'
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 -e MPLBACKEND=Agg "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/tests/tutorial.py
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/pbt_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/hyperband_example.py
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/async_hyperband_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/tf_mnist_example.py --smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/lightgbm_example.py
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/xgboost_example.py
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/logging_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/mlflow_example.py
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/bayesopt_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/cifar10_pytorch.py --smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/hyperopt_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/doc/source/tune/_tutorials/tune-sklearn.py
|
|
|
|
# if [ -n "$SIGOPT_KEY" ]; then
|
|
# $SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 -e SIGOPT_KEY "$DOCKER_SHA" \
|
|
# python /ray/python/ray/tune/examples/sigopt_example.py \
|
|
# --smoke-test
|
|
# fi
|
|
|
|
# Runs only on Python3
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/nevergrad_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/tune_mnist_keras.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/mnist_pytorch.py --smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/mnist_pytorch_lightning.py --smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/mnist_pytorch_trainable.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/genetic_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/skopt_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/dragonfly_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/zoopt_example.py \
|
|
--smoke-test
|
|
|
|
# Commenting out because flaky
|
|
# $SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
# python /ray/python/ray/tune/examples/pbt_memnn_example.py \
|
|
# --smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/pbt_convnet_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/hyperband_function_example.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/pbt_function.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/pbt_dcgan_mnist/pbt_dcgan_mnist.py \
|
|
--smoke-test
|
|
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/ci/long_running_distributed_tests/workloads/pytorch_pbt_failure.py \
|
|
--smoke-test
|
|
|
|
# uncomment once statsmodels is updated.
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
python /ray/python/ray/tune/examples/bohb_example.py
|
|
|
|
# Moved to bottom because flaky
|
|
$SUPPRESS_OUTPUT docker run --rm --shm-size=${SHM_SIZE} --memory=${MEMORY_SIZE} --memory-swap=-1 "$DOCKER_SHA" \
|
|
pytest /ray/python/ray/tune/tests/test_cluster.py
|