Skip to content

Commit 1b8943c

Browse files
authored
Removes additional sbatch and fixes default profile in cluster deployment (#1229)
# Description In the slum workflow, currently, there was an unnecessary `sbatch` command; this PR removes it. In addition, the profile argument was marked as optional, but when a job was submitted, and job arguments were passed, it became necessary. This PR fixes this behavior. ## Type of change - Bug fix (non-breaking change which fixes an issue) ## Checklist - [x] I have run the [`pre-commit` checks](https://pre-commit.com/) with `./isaaclab.sh --format` - [ ] I have made corresponding changes to the documentation - [x] My changes generate no new warnings - [ ] I have added tests that prove my fix is effective or that my feature works - [ ] I have updated the changelog and the corresponding version in the extension's `config/extension.toml` file - [x] I have added my name to the `CONTRIBUTORS.md` or my name already exists there
1 parent cc7112c commit 1b8943c

File tree

1 file changed

+11
-7
lines changed

1 file changed

+11
-7
lines changed

docker/cluster/cluster_interface.sh

Lines changed: 11 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,9 @@ submit_job() {
6262

6363
case $CLUSTER_JOB_SCHEDULER in
6464
"SLURM")
65-
CMD=sbatch
6665
job_script_file=submit_job_slurm.sh
6766
;;
6867
"PBS")
69-
CMD=bash
7068
job_script_file=submit_job_pbs.sh
7169
;;
7270
*)
@@ -75,7 +73,7 @@ submit_job() {
7573
;;
7674
esac
7775

78-
ssh $CLUSTER_LOGIN "cd $CLUSTER_ISAACLAB_DIR && $CMD $CLUSTER_ISAACLAB_DIR/docker/cluster/$job_script_file \"$CLUSTER_ISAACLAB_DIR\" \"isaac-lab-$profile\" ${@}"
76+
ssh $CLUSTER_LOGIN "cd $CLUSTER_ISAACLAB_DIR && bash $CLUSTER_ISAACLAB_DIR/docker/cluster/$job_script_file \"$CLUSTER_ISAACLAB_DIR\" \"isaac-lab-$profile\" ${@}"
7977
}
8078

8179
#==
@@ -162,11 +160,17 @@ case $command in
162160
scp $SCRIPT_DIR/exports/isaac-lab-$profile.tar $CLUSTER_LOGIN:$CLUSTER_SIF_PATH/isaac-lab-$profile.tar
163161
;;
164162
job)
165-
[ $# -ge 1 ] && profile=$1 && shift
163+
if [ $# -ge 1 ]; then
164+
passed_profile=$1
165+
if [ -f ".env.$passed_profile" ]; then
166+
profile=$passed_profile
167+
shift
168+
fi
169+
fi
166170
job_args="$@"
167-
echo "Executing job command"
168-
[ -n "$profile" ] && echo "Using profile: $profile"
169-
[ -n "$job_args" ] && echo "Job arguments: $job_args"
171+
echo "[INFO] Executing job command"
172+
[ -n "$profile" ] && echo -e "\tUsing profile: $profile"
173+
[ -n "$job_args" ] && echo -e "\tJob arguments: $job_args"
170174
source $SCRIPT_DIR/.env.cluster
171175
# Get current date and time
172176
current_datetime=$(date +"%Y%m%d_%H%M%S")

0 commit comments

Comments
 (0)