Unverified Commit ab3a126a authored by Farbod Farshidian's avatar Farbod Farshidian Committed by GitHub

Removes hardcoded paths in docker compose (#454)

Removes hardcoded IsaacLab folder path in docker compose.

## Type of change

- Bug fix

## 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
- [x] I have added tests that prove my fix is effective or that my
feature works
- [x] I have run all the tests with `./isaaclab.sh --test` and they pass
- [ ] 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
parent 55745eb3
...@@ -34,6 +34,7 @@ print_help () { ...@@ -34,6 +34,7 @@ print_help () {
echo -e "\tstop [profile] Stop the docker container and remove it." echo -e "\tstop [profile] Stop the docker container and remove it."
echo -e "\tpush [profile] Push the docker image to the cluster." echo -e "\tpush [profile] Push the docker image to the cluster."
echo -e "\tjob [profile] [job_args] Submit a job to the cluster." echo -e "\tjob [profile] [job_args] Submit a job to the cluster."
echo -e "\tconfig [profile] Parse, resolve and render compose file in canonical format."
echo -e "\n" echo -e "\n"
echo -e "[profile] is the optional container profile specification and [job_args] optional arguments specific" echo -e "[profile] is the optional container profile specification and [job_args] optional arguments specific"
echo -e "to the executed script" echo -e "to the executed script"
...@@ -257,7 +258,7 @@ profile_arg="$2" # Capture the second argument as the potential profile argument ...@@ -257,7 +258,7 @@ profile_arg="$2" # Capture the second argument as the potential profile argument
# Check mode argument and resolve the container profile # Check mode argument and resolve the container profile
case $mode in case $mode in
build|start|enter|copy|stop|push) build|start|enter|copy|stop|push|config)
resolve_image_extension "$profile_arg" true resolve_image_extension "$profile_arg" true
;; ;;
job) job)
...@@ -299,10 +300,11 @@ case $mode in ...@@ -299,10 +300,11 @@ case $mode in
copy) copy)
# Check that desired container is running, exit if it isn't # Check that desired container is running, exit if it isn't
is_container_running isaac-lab-$container_profile is_container_running isaac-lab-$container_profile
DOCKER_ISAACLAB_PATH=$(docker exec isaac-lab-$container_profile printenv DOCKER_ISAACLAB_PATH)
echo "[INFO] Copying artifacts from the 'isaac-lab-$container_profile' container..." echo "[INFO] Copying artifacts from the 'isaac-lab-$container_profile' container..."
echo -e "\t - /workspace/isaaclab/logs -> ${SCRIPT_DIR}/artifacts/logs" echo -e "\t - ${DOCKER_ISAACLAB_PATH}/logs -> ${SCRIPT_DIR}/artifacts/logs"
echo -e "\t - /workspace/isaaclab/docs/_build -> ${SCRIPT_DIR}/artifacts/docs/_build" echo -e "\t - ${DOCKER_ISAACLAB_PATH}/docs/_build -> ${SCRIPT_DIR}/artifacts/docs/_build"
echo -e "\t - /workspace/isaaclab/data_storage -> ${SCRIPT_DIR}/artifacts/data_storage" echo -e "\t - ${DOCKER_ISAACLAB_PATH}/data_storage -> ${SCRIPT_DIR}/artifacts/data_storage"
# enter the script directory # enter the script directory
pushd ${SCRIPT_DIR} > /dev/null 2>&1 pushd ${SCRIPT_DIR} > /dev/null 2>&1
# We have to remove before copying because repeated copying without deletion # We have to remove before copying because repeated copying without deletion
...@@ -315,9 +317,9 @@ case $mode in ...@@ -315,9 +317,9 @@ case $mode in
mkdir -p ./artifacts/docs mkdir -p ./artifacts/docs
# copy the artifacts # copy the artifacts
docker cp isaac-lab-$container_profile:/workspace/isaaclab/logs ./artifacts/logs docker cp isaac-lab-$container_profile:${DOCKER_ISAACLAB_PATH}/logs ./artifacts/logs
docker cp isaac-lab-$container_profile:/workspace/isaaclab/docs/_build ./artifacts/docs/_build docker cp isaac-lab-$container_profile:${DOCKER_ISAACLAB_PATH}/docs/_build ./artifacts/docs/_build
docker cp isaac-lab-$container_profile:/workspace/isaaclab/data_storage ./artifacts/data_storage docker cp isaac-lab-$container_profile:${DOCKER_ISAACLAB_PATH}/data_storage ./artifacts/data_storage
echo -e "\n[INFO] Finished copying the artifacts from the container." echo -e "\n[INFO] Finished copying the artifacts from the container."
popd > /dev/null 2>&1 popd > /dev/null 2>&1
;; ;;
...@@ -378,6 +380,10 @@ case $mode in ...@@ -378,6 +380,10 @@ case $mode in
ssh $CLUSTER_LOGIN "cd $CLUSTER_ISAACLAB_DIR && sbatch $CLUSTER_ISAACLAB_DIR/docker/cluster/submit_job.sh" "$CLUSTER_ISAACLAB_DIR" "isaac-lab-$container_profile" "${@:2}" ssh $CLUSTER_LOGIN "cd $CLUSTER_ISAACLAB_DIR && sbatch $CLUSTER_ISAACLAB_DIR/docker/cluster/submit_job.sh" "$CLUSTER_ISAACLAB_DIR" "isaac-lab-$container_profile" "${@:2}"
fi fi
;; ;;
config)
pushd ${SCRIPT_DIR} > /dev/null 2>&1
docker compose $add_yamls $add_envs $add_profiles config
;;
*) *)
# Not recognized mode # Not recognized mode
echo "[Error] Invalid command provided: $mode" echo "[Error] Invalid command provided: $mode"
......
...@@ -36,10 +36,10 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes ...@@ -36,10 +36,10 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes
# be reflected within the container immediately # be reflected within the container immediately
- type: bind - type: bind
source: ../source source: ../source
target: /workspace/isaaclab/source target: ${DOCKER_ISAACLAB_PATH}/source
- type: bind - type: bind
source: ../docs source: ../docs
target: /workspace/isaaclab/docs target: ${DOCKER_ISAACLAB_PATH}/docs
# The effect of these volumes is twofold: # The effect of these volumes is twofold:
# 1. Prevent root-owned files from flooding the _build and logs dir # 1. Prevent root-owned files from flooding the _build and logs dir
# on the host machine # on the host machine
...@@ -47,13 +47,13 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes ...@@ -47,13 +47,13 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes
# to the host machine # to the host machine
- type: volume - type: volume
source: isaac-lab-docs source: isaac-lab-docs
target: /workspace/isaaclab/docs/_build target: ${DOCKER_ISAACLAB_PATH}/docs/_build
- type: volume - type: volume
source: isaac-lab-logs source: isaac-lab-logs
target: /workspace/isaaclab/logs target: ${DOCKER_ISAACLAB_PATH}/logs
- type: volume - type: volume
source: isaac-lab-data source: isaac-lab-data
target: /workspace/isaaclab/data_storage target: ${DOCKER_ISAACLAB_PATH}/data_storage
x-default-isaac-lab-environment: &default-isaac-lab-environment x-default-isaac-lab-environment: &default-isaac-lab-environment
- ISAACSIM_PATH=${DOCKER_ISAACLAB_PATH}/_isaac_sim - ISAACSIM_PATH=${DOCKER_ISAACLAB_PATH}/_isaac_sim
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment