From 80d3512d615e31d0b16c09e94c37e3d41da266b2 Mon Sep 17 00:00:00 2001 From: Philip Keller Date: Fri, 7 Feb 2025 11:50:21 +0100 Subject: [PATCH 1/3] added PROJECT_ROOT handling for project-based isaac configs --- scripts/build_image_layers.sh | 8 ++++++++ scripts/run_dev.sh | 11 +++++++++++ 2 files changed, 19 insertions(+) diff --git a/scripts/build_image_layers.sh b/scripts/build_image_layers.sh index d2b723d7..65b31293 100755 --- a/scripts/build_image_layers.sh +++ b/scripts/build_image_layers.sh @@ -40,6 +40,14 @@ if [[ -f ~/.isaac_ros_common-config ]]; then . ~/.isaac_ros_common-config fi +# Override with config from project directory if exists (and is defined) +if [[ ! -z "${PROJECT_ROOT}" ]]; then + print_info "Sourcing project config at: ${PROJECT_ROOT}" + if [[ -f "${PROJECT_ROOT}/.isaac_ros_common-config" ]]; then + . "${PROJECT_ROOT}/.isaac_ros_common-config" + fi +fi + # Prepend configured docker search dirs if [ ${#CONFIG_DOCKER_SEARCH_DIRS[@]} -gt 0 ]; then for (( i=${#CONFIG_DOCKER_SEARCH_DIRS[@]}-1 ; i>=0 ; i-- )); do diff --git a/scripts/run_dev.sh b/scripts/run_dev.sh index 86f08e54..5bfc76dc 100755 --- a/scripts/run_dev.sh +++ b/scripts/run_dev.sh @@ -33,6 +33,17 @@ if [[ -f ~/.isaac_ros_common-config ]]; then . ~/.isaac_ros_common-config fi +# Override with config from project directory if exists (and is defined) +if [[ ! -z "${PROJECT_ROOT}" ]]; then + print_info "Sourcing project config at: ${PROJECT_ROOT}" + if [[ -f "${PROJECT_ROOT}/.isaac_ros_common-config" ]]; then + . "${PROJECT_ROOT}/.isaac_ros_common-config" + fi + + # Make the project root available to nested scripts, eg. build_image_layers.sh + export PROJECT_ROOT="${PROJECT_ROOT}" +fi + # Parse command-line args IMAGE_KEY=ros2_humble From b1f8cdde33316531783487bdd5edfb5e14d293af Mon Sep 17 00:00:00 2001 From: Philip Keller Date: Thu, 6 Mar 2025 21:53:56 +0100 Subject: [PATCH 2/3] added progress plain as default --- scripts/run_dev.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/run_dev.sh b/scripts/run_dev.sh index 5bfc76dc..9195575c 100755 --- a/scripts/run_dev.sh +++ b/scripts/run_dev.sh @@ -213,7 +213,7 @@ print_info "Launching Isaac ROS Dev container with image key ${BASE_IMAGE_KEY}: # Build image to launch if [[ $SKIP_IMAGE_BUILD -ne 1 ]]; then print_info "Building $BASE_IMAGE_KEY base as image: $BASE_NAME" - $ROOT/build_image_layers.sh --image_key "$BASE_IMAGE_KEY" --image_name "$BASE_NAME" + $ROOT/build_image_layers.sh --image_key "$BASE_IMAGE_KEY" --image_name "$BASE_NAME" -d "--progress=plain" # -d "--no-cache" # Check result if [ $? -ne 0 ]; then From b30f9f3f31cc865d529ac3856433a2e11ec534af Mon Sep 17 00:00:00 2001 From: Philip Keller Date: Thu, 20 Nov 2025 14:41:49 +0100 Subject: [PATCH 3/3] Integrated the option -c for custom bash commands after docker initialization --- scripts/run_dev.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/scripts/run_dev.sh b/scripts/run_dev.sh index 9195575c..2a03a627 100755 --- a/scripts/run_dev.sh +++ b/scripts/run_dev.sh @@ -55,7 +55,8 @@ fi ISAAC_ROS_DEV_DIR="${ISAAC_ROS_WS}" SKIP_IMAGE_BUILD=0 VERBOSE=0 -VALID_ARGS=$(getopt -o hvd:i:ba: --long help,verbose,isaac_ros_dev_dir:,image_key:,skip_image_build,docker_arg: -- "$@") +DOCKER_BASH_COMMAND="echo 'Docker-bash command is empty. Use it with -c.'" +VALID_ARGS=$(getopt -o hvd:i:ba:c: --long help,verbose,isaac_ros_dev_dir:,image_key:,skip_image_build,docker_arg:,bash_cmd: -- "$@") eval set -- "$VALID_ARGS" while [ : ]; do case "$1" in @@ -79,6 +80,10 @@ while [ : ]; do VERBOSE=1 shift ;; + -c | --bash_cmd) + DOCKER_BASH_COMMAND="$2" + shift 2 + ;; -h | --help) usage exit 0 @@ -288,6 +293,7 @@ fi # Run container from image print_info "Running $CONTAINER_NAME" +print_info "User-Bash command: $DOCKER_BASH_COMMAND" if [[ $VERBOSE -eq 1 ]]; then set -x fi @@ -303,4 +309,4 @@ docker run -it --rm \ --entrypoint /usr/local/bin/scripts/workspace-entrypoint.sh \ --workdir /workspaces/isaac_ros-dev \ $BASE_NAME \ - /bin/bash + /bin/bash -c "${DOCKER_BASH_COMMAND}; exec bash"