Skip to content

Commit 84158cf

Browse files
d4l3kfacebook-github-bot
authored andcommitted
slurmint: made the script more robust to different system configurations (#516)
Summary: This updates the slurmint script to be more robust to environment changes since we switched to a new slurm cluster. It removes the hardcoded `/home/ubuntu` and uses venv provided by miniconda so we don't need virtualenv installed on the host. Pull Request resolved: #516 Test Plan: env SLURM_INSTANCE_MASTER=... scripts/slurmint.sh Reviewed By: priyaramani Differential Revision: D37123645 Pulled By: d4l3k fbshipit-source-id: 83871bf1377f958d1db79c56687c5cfce149c3dc
1 parent 42e9b44 commit 84158cf

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

scripts/slurmint.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ if [[ -z "${SLURM_INSTANCE_MASTER}" ]]; then
2020
fi
2121

2222
JOB="$USER-$(uuidgen)"
23-
DIR="/home/ubuntu/integ-tests/$JOB"
23+
DIR="integ-tests/$JOB"
2424
VENV="$DIR/venv"
2525

2626
function run_cmd {
@@ -45,7 +45,7 @@ SCRIPT="scripts/slurmtest.sh"
4545
REMOTE_SCRIPT="$DIR/$(basename "$SCRIPT")"
4646

4747
run_cmd mkdir -p "$DIR"
48-
run_cmd virtualenv -p /home/ubuntu/miniconda3/bin/python "$VENV"
48+
run_cmd miniconda3/bin/python -m venv "$VENV"
4949
run_scp "$WHEEL" "$REMOTE_WHEEL"
5050
run_scp "$SCRIPT" "$REMOTE_SCRIPT"
5151
run_cmd "$REMOTE_SCRIPT" "$REMOTE_WHEEL" "$VENV"

scripts/slurmtest.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@
77

88
set -ex
99

10-
REMOTE_WHEEL="$1"
11-
VENV="$2"
10+
REMOTE_WHEEL="$(realpath $1)"
11+
VENV="$(realpath $2)"
1212

1313
BASE_DIR="$(dirname "$REMOTE_WHEEL")"
1414
DIR="$BASE_DIR/project"
@@ -30,7 +30,7 @@ pip install torch==1.10.2+cpu -f https://download.pytorch.org/whl/cpu/torch_stab
3030

3131
cat <<EOT > .torchxconfig
3232
[slurm]
33-
partition=compute
33+
partition=queue1
3434
time=10
3535
comment=hello
3636
job_dir=$JOB_DIR

0 commit comments

Comments
 (0)