diff --git a/docker/container.sh b/docker/container.sh index e16fad5847..78a257acff 100755 --- a/docker/container.sh +++ b/docker/container.sh @@ -34,6 +34,7 @@ print_help () { echo -e "\tstop [profile] Stop the docker container and remove it." 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 "\tconfig [profile] Parse, resolve and render compose file in canonical format." echo -e "\n" echo -e "[profile] is the optional container profile specification and [job_args] optional arguments specific" echo -e "to the executed script" @@ -257,7 +258,7 @@ profile_arg="$2" # Capture the second argument as the potential profile argument # Check mode argument and resolve the container profile case $mode in - build|start|enter|copy|stop|push) + build|start|enter|copy|stop|push|config) resolve_image_extension "$profile_arg" true ;; job) @@ -299,10 +300,11 @@ case $mode in copy) # Check that desired container is running, exit if it isn't 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 -e "\t - /workspace/isaaclab/logs -> ${SCRIPT_DIR}/artifacts/logs" - echo -e "\t - /workspace/isaaclab/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}/logs -> ${SCRIPT_DIR}/artifacts/logs" + echo -e "\t - ${DOCKER_ISAACLAB_PATH}/docs/_build -> ${SCRIPT_DIR}/artifacts/docs/_build" + echo -e "\t - ${DOCKER_ISAACLAB_PATH}/data_storage -> ${SCRIPT_DIR}/artifacts/data_storage" # enter the script directory pushd ${SCRIPT_DIR} > /dev/null 2>&1 # We have to remove before copying because repeated copying without deletion @@ -315,9 +317,9 @@ case $mode in mkdir -p ./artifacts/docs # copy the artifacts - docker cp isaac-lab-$container_profile:/workspace/isaaclab/logs ./artifacts/logs - docker cp isaac-lab-$container_profile:/workspace/isaaclab/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}/logs ./artifacts/logs + docker cp isaac-lab-$container_profile:${DOCKER_ISAACLAB_PATH}/docs/_build ./artifacts/docs/_build + 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." popd > /dev/null 2>&1 ;; @@ -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}" fi ;; + config) + pushd ${SCRIPT_DIR} > /dev/null 2>&1 + docker compose $add_yamls $add_envs $add_profiles config + ;; *) # Not recognized mode echo "[Error] Invalid command provided: $mode" diff --git a/docker/docker-compose.yaml b/docker/docker-compose.yaml index b6441edc3d..d127247288 100644 --- a/docker/docker-compose.yaml +++ b/docker/docker-compose.yaml @@ -36,10 +36,10 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes # be reflected within the container immediately - type: bind source: ../source - target: /workspace/isaaclab/source + target: ${DOCKER_ISAACLAB_PATH}/source - type: bind source: ../docs - target: /workspace/isaaclab/docs + target: ${DOCKER_ISAACLAB_PATH}/docs # The effect of these volumes is twofold: # 1. Prevent root-owned files from flooding the _build and logs dir # on the host machine @@ -47,13 +47,13 @@ x-default-isaac-lab-volumes: &default-isaac-lab-volumes # to the host machine - type: volume source: isaac-lab-docs - target: /workspace/isaaclab/docs/_build + target: ${DOCKER_ISAACLAB_PATH}/docs/_build - type: volume source: isaac-lab-logs - target: /workspace/isaaclab/logs + target: ${DOCKER_ISAACLAB_PATH}/logs - type: volume source: isaac-lab-data - target: /workspace/isaaclab/data_storage + target: ${DOCKER_ISAACLAB_PATH}/data_storage x-default-isaac-lab-environment: &default-isaac-lab-environment - ISAACSIM_PATH=${DOCKER_ISAACLAB_PATH}/_isaac_sim