Skip to content

Commit

Permalink
Removes additional sbatch and fixes default profile in cluster deploy…
Browse files Browse the repository at this point in the history
…ment (isaac-sim#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
  • Loading branch information
pascal-roth authored Oct 13, 2024
1 parent cc7112c commit 1b8943c
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions docker/cluster/cluster_interface.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,9 @@ submit_job() {

case $CLUSTER_JOB_SCHEDULER in
"SLURM")
CMD=sbatch
job_script_file=submit_job_slurm.sh
;;
"PBS")
CMD=bash
job_script_file=submit_job_pbs.sh
;;
*)
Expand All @@ -75,7 +73,7 @@ submit_job() {
;;
esac

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

#==
Expand Down Expand Up @@ -162,11 +160,17 @@ case $command in
scp $SCRIPT_DIR/exports/isaac-lab-$profile.tar $CLUSTER_LOGIN:$CLUSTER_SIF_PATH/isaac-lab-$profile.tar
;;
job)
[ $# -ge 1 ] && profile=$1 && shift
if [ $# -ge 1 ]; then
passed_profile=$1
if [ -f ".env.$passed_profile" ]; then
profile=$passed_profile
shift
fi
fi
job_args="$@"
echo "Executing job command"
[ -n "$profile" ] && echo "Using profile: $profile"
[ -n "$job_args" ] && echo "Job arguments: $job_args"
echo "[INFO] Executing job command"
[ -n "$profile" ] && echo -e "\tUsing profile: $profile"
[ -n "$job_args" ] && echo -e "\tJob arguments: $job_args"
source $SCRIPT_DIR/.env.cluster
# Get current date and time
current_datetime=$(date +"%Y%m%d_%H%M%S")
Expand Down

0 comments on commit 1b8943c

Please sign in to comment.