ray_template/deployment_scripts/start-ray-worker.sh

26 lines
773 B
Bash
Raw Permalink Normal View History

2024-01-05 12:22:52 +00:00
#!/bin/bash
if [ $# -ne 5 ]; then
echo "Usage: $0 <ws_dir> <env_archive> <ray_address> <redis_password> <obj_store_memory>"
exit 1
fi
export WS_DIR=$1
export ENV_ARCHIVE=$2
export RAY_ADDRESS=$3
export REDIS_PASSWORD=$4
export OBJECT_STORE_MEMORY=$5
2024-01-05 15:08:04 +00:00
export ENV_PATH=/run/user/$PBS_JOBID/ray_env # We use the ram disk to extract the environment packages since a large number of files decreases the performance of the parallel file system.
2024-01-05 12:22:52 +00:00
mkdir -p $ENV_PATH
tar -xzf $WS_DIR/$ENV_ARCHIVE -C $ENV_PATH
source $ENV_PATH/bin/activate
conda-unpack
ray start --address=$RAY_ADDRESS \
--redis-password=$REDIS_PASSWORD \
--object-store-memory=$OBJECT_STORE_MEMORY \
--block
2024-01-05 15:08:04 +00:00
rm -rf $ENV_PATH # It's nice to clean up before you terminate the job