From 95f972690451f0400323e7be5cb7c73cdd9fdcd7 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Wed, 15 Jan 2025 15:36:25 +0100 Subject: [PATCH 01/12] remove rmw-zenoh build from src --- .gitlab-ci/docker-ros.yml | 5 ----- README.md | 3 --- action.yml | 7 +------ docker/Dockerfile | 24 +----------------------- docker/entrypoint.sh | 1 - scripts/build.sh | 1 - scripts/ci.sh | 1 - 7 files changed, 2 insertions(+), 40 deletions(-) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 4f374f9..edb25e6 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -40,7 +40,6 @@ variables: REGISTRY_USER: ${CI_REGISTRY_USER} # Docker registry username REGISTRY: ${CI_REGISTRY} # Docker registry to push images to RMW_IMPLEMENTATION: 'rmw_cyclonedds_cpp' # RMW implementation to use (only for ROS 2) - RMW_ZENOH_GIT_REF: '' # Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp` ROS_DISTRO: '' # ROS Distro (required if ROS is not installed in `base-image`) SLIM_BUILD_ARGS: '--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false' # Arguments to `slim build` (except for `--target` and `--tag`) TARGET: run # Target stage of Dockerfile (comma-separated list) [dev|run] @@ -204,10 +203,6 @@ run-arm64: fi - git clone --branch master --depth 1 https://github.com/ros-industrial/industrial_ci.git .industrial_ci - test -f ${BUILD_CONTEXT}/.repos || echo "repositories:" > ${BUILD_CONTEXT}/.repos - - |- - if [ "$RMW_IMPLEMENTATION" = "rmw_zenoh_cpp" ]; then - export UNDERLAY="/opt/ws_rmw_zenoh/install" - fi script: .industrial_ci/gitlab.sh Test dev-amd64: diff --git a/README.md b/README.md index e2f9501..e5532e8 100644 --- a/README.md +++ b/README.md @@ -466,9 +466,6 @@ The password of the custom user is set to its username (`dockeruser:dockeruser` ROS 2 middleware implementation *default:* `rmw_cyclonedds_cpp` *supported values:* `rmw_zenoh_cpp`, `rmw_fastrtps_cpp`, `rmw_cyclonedds_cpp`, `rmw_gurumdds_cpp`, ... -- **`rmw-zenoh-git-ref` | `RMW_ZENOH_GIT_REF`** - Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp` - *default:* `$ROS_DISTRO` - **`ros-distro` | `ROS_DISTRO`** ROS Distro *required if ROS is not installed in `base-image`* diff --git a/action.yml b/action.yml index 5ff0d68..6c72560 100644 --- a/action.yml +++ b/action.yml @@ -104,8 +104,6 @@ inputs: rmw-implementation: description: "RMW implementation to use (only for ROS 2)" default: rmw_cyclonedds_cpp - rmw-zenoh-git-ref: - description: "Git ref of rmw_zenoh repo to build if `RMW_IMPLEMENTATION=rmw_zenoh_cpp`" slim-build-args: description: "Arguments to `slim build` (except for `--target` and `--tag`)" default: '--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false' @@ -207,7 +205,6 @@ runs: IMAGE_TAG: ${{ inputs.image-tag }} PLATFORM: ${{ inputs.platform }} RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} - RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} ROS_DISTRO: ${{ inputs.ros-distro }} SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} @@ -225,7 +222,7 @@ runs: uses: ros-industrial/industrial_ci@master env: ADDITIONAL_DEBS: git - AFTER_INIT_EMBED: '[[ "$RMW_IMPLEMENTATION" == "rmw_zenoh_cpp" ]] && export UNDERLAY="/opt/ws_rmw_zenoh/install" ; [[ -n ${{ inputs.git-https-server }} ]] && git config --global url.https://${{ inputs.git-https-user }}:${{ inputs.git-https-password }}@${{ inputs.git-https-server }}.insteadOf https://${{ inputs.git-https-server }}' + AFTER_INIT_EMBED: '[[ -n ${{ inputs.git-https-server }} ]] && git config --global url.https://${{ inputs.git-https-user }}:${{ inputs.git-https-password }}@${{ inputs.git-https-server }}.insteadOf https://${{ inputs.git-https-server }}' DOCKER_IMAGE: ${{ steps.build-images.outputs.INDUSTRIAL_CI_IMAGE }} DOCKER_PULL: false DOCKER_RUN_OPTS: -u root:root @@ -271,7 +268,6 @@ runs: IMAGE_TAG: ${{ inputs.image-tag }} PLATFORM: ${{ inputs.platform }} RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} - RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} ROS_DISTRO: ${{ inputs.ros-distro }} SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} @@ -313,7 +309,6 @@ runs: IMAGE_TAG: latest PLATFORM: ${{ inputs.platform }} RMW_IMPLEMENTATION: ${{ inputs.rmw-implementation }} - RMW_ZENOH_GIT_REF: ${{ inputs.rmw-zenoh-git-ref }} ROS_DISTRO: ${{ inputs.ros-distro }} SLIM_BUILD_ARGS: ${{ inputs.slim-build-args }} SLIM_IMAGE_NAME: ${{ steps.slim-image-name.outputs.lowercase }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 4a01948..8ec9a63 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -222,29 +222,8 @@ RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc # install desired ROS 2 middleware ARG RMW_IMPLEMENTATION ENV RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION:-rmw_cyclonedds_cpp} -ARG RMW_ZENOH_GIT_REF RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ - if [[ "$RMW_IMPLEMENTATION" == "rmw_zenoh_cpp" ]]; then \ - if [[ ! -d /opt/ws_rmw_zenoh/src ]]; then \ - mkdir -p /opt/ws_rmw_zenoh/src && \ - git clone https://github.com/ros2/rmw_zenoh.git /opt/ws_rmw_zenoh/src/rmw_zenoh && \ - cd /opt/ws_rmw_zenoh/src/rmw_zenoh && \ - git checkout ${RMW_ZENOH_GIT_REF:-${ROS_DISTRO}} && \ - cd - && \ - if [[ "$(lsb_release -r | awk '{print $2}')" == "22.04" ]]; then \ - git clone -b 2.2.x https://github.com/eProsima/Fast-CDR.git /opt/ws_rmw_zenoh/src/Fast-CDR ; \ - fi && \ - (rosdep init || true) && \ - rosdep update --rosdistro $ROS_DISTRO && \ - apt-get update && \ - cd /opt/ws_rmw_zenoh && \ - rosdep install -y --from-paths src --ignore-src --rosdistro $ROS_DISTRO && \ - rm -rf /var/lib/apt/lists/* && \ - source /opt/ros/${ROS_DISTRO}/setup.bash && \ - colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release && \ - echo "source /opt/ws_rmw_zenoh/install/setup.bash" >> ~/.bashrc ; \ - fi ; \ - elif [[ "$ROS_VERSION" == "2" ]]; then \ + if [[ "$ROS_VERSION" == "2" ]]; then \ apt-get update && \ RMW_PACKAGE=ros-$ROS_DISTRO-$(echo $RMW_IMPLEMENTATION | tr '_' '-') && \ apt-get install -y $RMW_PACKAGE && \ @@ -279,7 +258,6 @@ FROM dev AS build # build ROS workspace RUN if [[ -x "$(command -v colcon)" ]]; then \ source /opt/ros/${ROS_DISTRO}/setup.bash && \ - [[ -f /opt/ws_rmw_zenoh/install/setup.bash ]] && source /opt/ws_rmw_zenoh/install/setup.bash ; \ [[ -f /opt/ws_base_image/install/setup.bash ]] && source /opt/ws_base_image/install/setup.bash ; \ colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release ; \ elif [[ -x "$(command -v catkin)" ]]; then \ diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index be7921c..b68734d 100755 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -3,7 +3,6 @@ set -e # source ROS workspace source /opt/ros/$ROS_DISTRO/setup.bash -[[ -f /opt/ws_rmw_zenoh/install/setup.bash ]] && source /opt/ws_rmw_zenoh/install/setup.bash [[ -f /opt/ws_base_image/install/setup.bash ]] && source /opt/ws_base_image/install/setup.bash [[ -f $WORKSPACE/devel/setup.bash ]] && source $WORKSPACE/devel/setup.bash [[ -f $WORKSPACE/install/setup.bash ]] && source $WORKSPACE/install/setup.bash diff --git a/scripts/build.sh b/scripts/build.sh index b0270c8..d9c2240 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -34,7 +34,6 @@ build_image() { $(if [[ -n "${GIT_SSH_KNOWN_HOST_KEYS}" ]]; then echo "--build-arg GIT_SSH_KNOWN_HOST_KEYS=${GIT_SSH_KNOWN_HOST_KEYS}"; fi) \ $(if [[ -n "${GIT_SSH_PRIVATE_KEY}" ]]; then echo "--build-arg GIT_SSH_PRIVATE_KEY=${GIT_SSH_PRIVATE_KEY}"; fi) \ $(if [[ -n "${RMW_IMPLEMENTATION}" ]]; then echo "--build-arg RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION}"; fi) \ - $(if [[ -n "${RMW_ZENOH_GIT_REF}" ]]; then echo "--build-arg RMW_ZENOH_GIT_REF=${RMW_ZENOH_GIT_REF}"; fi) \ $(if [[ -n "${ROS_DISTRO}" ]]; then echo "--build-arg ROS_DISTRO=${ROS_DISTRO}"; fi) \ $(if [[ -n "${VCS_IMPORT_FILE}" ]]; then echo "--build-arg VCS_IMPORT_FILE=${VCS_IMPORT_FILE}"; fi) \ . diff --git a/scripts/ci.sh b/scripts/ci.sh index 0dc312a..7987865 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -40,7 +40,6 @@ GIT_SSH_KNOWN_HOST_KEYS="${GIT_SSH_KNOWN_HOST_KEYS:-}" GIT_SSH_PRIVATE_KEY="${GIT_SSH_PRIVATE_KEY:-}" IMAGE="${IMAGE_NAME}:${IMAGE_TAG}" RMW_IMPLEMENTATION="${RMW_IMPLEMENTATION:-}" -RMW_ZENOH_GIT_REF="${RMW_ZENOH_GIT_REF:-}" ROS_DISTRO="${ROS_DISTRO:-}" SLIM_BUILD_ARGS="${SLIM_BUILD_ARGS:-'--sensor-ipc-mode proxy --continue-after=10 --show-clogs --http-probe=false'}" SLIM_IMAGE="${SLIM_IMAGE_NAME}:${SLIM_IMAGE_TAG}" From 5d3eb86e0df9ac83c67d00765650efb554c984f4 Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Thu, 23 Jan 2025 09:47:30 +0000 Subject: [PATCH 02/12] add args for before/after_dependency_identification.sh custom scripts --- docker/Dockerfile | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 49d8402..96484ce 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -42,6 +42,12 @@ RUN apt-get update && \ # copy contents of repository COPY . src/target +# run custom script before dependency identification +ARG BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT="docker/before_dependency_identification.sh" +RUN if [[ -f src/target/${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT} ]]; then \ + /bin/bash src/target/${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ + fi + # clone .repos upstream dependencies ARG GIT_HTTPS_SERVER= ARG GIT_HTTPS_USER= @@ -125,6 +131,7 @@ RUN echo "pip install pip \\" >> $WORKSPACE/.install-dependencies.sh && \ echo ";" >> $WORKSPACE/.install-dependencies.sh # add custom installation commands to install script +# TODO: rename custom.sh to after_dependency_installation.sh ARG CUSTOM_SCRIPT_FILE="docker/custom.sh" ARG ENABLE_RECURSIVE_CUSTOM_SCRIPT="false" RUN if [[ $ENABLE_RECURSIVE_CUSTOM_SCRIPT == 'true' ]]; then \ @@ -137,6 +144,12 @@ RUN if [[ $ENABLE_RECURSIVE_CUSTOM_SCRIPT == 'true' ]]; then \ ARG ADDITIONAL_FILES_DIR="docker/additional-files" RUN rm -rf src/target/${ADDITIONAL_FILES_DIR} +# run custom script after dependency identification +ARG AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT="docker/after_dependency_identification.sh" +RUN if [[ -f src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ]]; then \ + /bin/bash src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ + fi + ############ dependencies-install ############################################## FROM ${BASE_IMAGE} AS dependencies-install ARG TARGETARCH From 528bf8c4ebf97ff03e7d42a940854fa9bc55c2ea Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Thu, 23 Jan 2025 10:15:22 +0000 Subject: [PATCH 03/12] add args for before/after_dependency_installation.sh custom scripts --- docker/Dockerfile | 33 ++++++++++++++++++++------------- 1 file changed, 20 insertions(+), 13 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 96484ce..7a3d8ef 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -45,7 +45,7 @@ COPY . src/target # run custom script before dependency identification ARG BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT="docker/before_dependency_identification.sh" RUN if [[ -f src/target/${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT} ]]; then \ - /bin/bash src/target/${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ + src/target/${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ fi # clone .repos upstream dependencies @@ -91,9 +91,17 @@ RUN echo "colcon list -p --base-paths src/ --packages-select \\" >> $WORKSPACE/. chmod +x $WORKSPACE/.remove-packages.sh && \ $WORKSPACE/.remove-packages.sh 2> /dev/null | xargs rm -rf -# create install script with list of rosdep dependencies -RUN echo "set -e" > $WORKSPACE/.install-dependencies.sh && \ - source /opt/ros/$ROS_DISTRO/setup.bash && \ +# create install script to run in dependencies-install stage +RUN echo "set -e" > $WORKSPACE/.install-dependencies.sh + +# add custom script to run before dependency installation to install script +ARG BEFORE_DEPENDENCY_INSTALLATION_SCRIPT="docker/before_dependency_installation.sh" +RUN if [[ -f src/target/${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT} ]]; then \ + cat src/target/${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT} >> $WORKSPACE/.install-dependencies.sh ; \ + fi + +# add list of rosdep dependencies to install script +RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ apt-get update && \ (rosdep init || true) && \ rosdep update --rosdistro ${ROS_DISTRO} && \ @@ -130,14 +138,13 @@ RUN echo "pip install pip \\" >> $WORKSPACE/.install-dependencies.sh && \ fi && \ echo ";" >> $WORKSPACE/.install-dependencies.sh -# add custom installation commands to install script -# TODO: rename custom.sh to after_dependency_installation.sh -ARG CUSTOM_SCRIPT_FILE="docker/custom.sh" -ARG ENABLE_RECURSIVE_CUSTOM_SCRIPT="false" -RUN if [[ $ENABLE_RECURSIVE_CUSTOM_SCRIPT == 'true' ]]; then \ - find . -type f -name $(basename ${CUSTOM_SCRIPT_FILE}) -exec sed '$a\' {} >> $WORKSPACE/.install-dependencies.sh \; ; \ - elif [[ -f src/target/${CUSTOM_SCRIPT_FILE} ]]; then \ - cat src/target/${CUSTOM_SCRIPT_FILE} >> $WORKSPACE/.install-dependencies.sh ; \ +# add custom script to run after dependency installation to install script +ARG AFTER_DEPENDENCY_INSTALLATION_SCRIPT="docker/after_dependency_installation.sh" +ARG ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT="false" +RUN if [[ $ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT == 'true' ]]; then \ + find . -type f -name $(basename ${AFTER_DEPENDENCY_INSTALLATION_SCRIPT}) -exec sed '$a\' {} >> $WORKSPACE/.install-dependencies.sh \; ; \ + elif [[ -f src/target/${AFTER_DEPENDENCY_INSTALLATION_SCRIPT} ]]; then \ + cat src/target/${AFTER_DEPENDENCY_INSTALLATION_SCRIPT} >> $WORKSPACE/.install-dependencies.sh ; \ fi # remove additional-files folder from copied repository content to avoid redundancies @@ -147,7 +154,7 @@ RUN rm -rf src/target/${ADDITIONAL_FILES_DIR} # run custom script after dependency identification ARG AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT="docker/after_dependency_identification.sh" RUN if [[ -f src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ]]; then \ - /bin/bash src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ + src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ fi ############ dependencies-install ############################################## From 73f3b07c4b973cc516ee953ff31e93f5835f351b Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Thu, 23 Jan 2025 13:00:44 +0000 Subject: [PATCH 04/12] make custom scripts executable --- docker/Dockerfile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7a3d8ef..9ae32ac 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -45,6 +45,7 @@ COPY . src/target # run custom script before dependency identification ARG BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT="docker/before_dependency_identification.sh" RUN if [[ -f src/target/${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT} ]]; then \ + chmod +x src/target/${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT} && \ src/target/${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ fi @@ -92,7 +93,8 @@ RUN echo "colcon list -p --base-paths src/ --packages-select \\" >> $WORKSPACE/. $WORKSPACE/.remove-packages.sh 2> /dev/null | xargs rm -rf # create install script to run in dependencies-install stage -RUN echo "set -e" > $WORKSPACE/.install-dependencies.sh +RUN echo "set -e" > $WORKSPACE/.install-dependencies.sh && \ + chmod +x $WORKSPACE/.install-dependencies.sh # add custom script to run before dependency installation to install script ARG BEFORE_DEPENDENCY_INSTALLATION_SCRIPT="docker/before_dependency_installation.sh" @@ -111,7 +113,6 @@ RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ ROS_PACKAGE_PATH=$(pwd):$ROS_PACKAGE_PATH rosdep install --os $OS -y --simulate --from-paths src --ignore-src \ | sed -E "s/'apt-get install -y ([^']+)' \(alternative 1\/1\)/apt-get install -y \1/" \ | tee -a $WORKSPACE/.install-dependencies.sh && \ - chmod +x $WORKSPACE/.install-dependencies.sh && \ rm -rf /var/lib/apt/lists/* # add additionally specified apt dependencies to install script @@ -154,6 +155,7 @@ RUN rm -rf src/target/${ADDITIONAL_FILES_DIR} # run custom script after dependency identification ARG AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT="docker/after_dependency_identification.sh" RUN if [[ -f src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ]]; then \ + chmod +x src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} && \ src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ fi From 2fcee9387f9c5242aa48ffc5e4b68a011eaafc63 Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Thu, 23 Jan 2025 13:08:24 +0000 Subject: [PATCH 05/12] fix line break in install script --- docker/Dockerfile | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 9ae32ac..8012f16 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -99,7 +99,8 @@ RUN echo "set -e" > $WORKSPACE/.install-dependencies.sh && \ # add custom script to run before dependency installation to install script ARG BEFORE_DEPENDENCY_INSTALLATION_SCRIPT="docker/before_dependency_installation.sh" RUN if [[ -f src/target/${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT} ]]; then \ - cat src/target/${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT} >> $WORKSPACE/.install-dependencies.sh ; \ + cat src/target/${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT} >> $WORKSPACE/.install-dependencies.sh && \ + echo "" >> $WORKSPACE/.install-dependencies.sh ; \ fi # add list of rosdep dependencies to install script @@ -148,6 +149,9 @@ RUN if [[ $ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT == 'true' ]]; t cat src/target/${AFTER_DEPENDENCY_INSTALLATION_SCRIPT} >> $WORKSPACE/.install-dependencies.sh ; \ fi +# log install script +RUN cat $WORKSPACE/.install-dependencies.sh + # remove additional-files folder from copied repository content to avoid redundancies ARG ADDITIONAL_FILES_DIR="docker/additional-files" RUN rm -rf src/target/${ADDITIONAL_FILES_DIR} From d30ca2ac8ab7dba0bd18d1f6592bdcebd96cd42c Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Thu, 23 Jan 2025 13:28:10 +0000 Subject: [PATCH 06/12] propagate new variables throughout entire pipeline --- .gitlab-ci/docker-ros.yml | 15 +++++++----- README.md | 50 +++++++++++++++++++++++++-------------- action.yml | 42 ++++++++++++++++++++++---------- scripts/build.sh | 6 ++++- scripts/ci.sh | 7 ++++-- 5 files changed, 81 insertions(+), 39 deletions(-) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 5c3cdc4..86f92b3 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -12,21 +12,24 @@ variables: ADDITIONAL_DEBS_FILE: docker/additional-debs.txt # Relative filepath to file containing additional apt deb packages to install ADDITIONAL_FILES_DIR: docker/additional-files # Relative path to directory containing additional files to copy into image" ADDITIONAL_PIP_FILE: docker/additional-pip-requirements.txt # Relative filepath to file containing additional pip packages to install + AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: docker/after_dependency_identification.sh # Relative filepath to script containing commands to run after dependency identification + AFTER_DEPENDENCY_INSTALLATION_SCRIPT: docker/after_dependency_installation.sh # Relative filepath to script containing commands to run after dependency installation BASE_IMAGE: '' # Base image name:tag (required) + BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: docker/before_dependency_identification.sh # Relative filepath to script containing commands to run before dependency identification + BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: docker/before_dependency_installation.sh # Relative filepath to script containing commands to run before dependency installation BLACKLISTED_PACKAGES_FILE: docker/blacklisted-packages.txt # Relative filepath to file containing the blacklisted packages BUILD_CONTEXT: . # Build context of Docker build process COMMAND: '' # Launch command of run image (required if target=run) CMAKE_ARGS: '-DCMAKE_BUILD_TYPE=Release' # CMake arguments to pass to `colcon build` - CUSTOM_SCRIPT_FILE: docker/custom.sh # Relative filepath to script containing custom installation commands DISABLE_ROS_INSTALLATION: 'false' # Disable automatic installation of `ros-$ROS_DISTRO-ros-core` package, e.g., if ROS is already installed in `base-image` and package is not available for the OS DOCKER_ROS_GIT_REF: main # Git ref of *docker-ros* to run in CI ENABLE_INDUSTRIAL_CI: 'false' # Enable industrial_ci ENABLE_PUSH_AS_LATEST: 'false' # Push images with tag `latest`/`latest-dev` in addition to the configured image names - ENABLE_RECURSIVE_ADDITIONAL_DEBS: 'false' # Enable recursive discovery of files named `additional-debs-file` - ENABLE_RECURSIVE_ADDITIONAL_PIP: 'false' # Enable recursive discovery of files named `additional-pip-file` - ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: 'false' # Enable recursive discovery of files named `blacklisted-packages-file` - ENABLE_RECURSIVE_CUSTOM_SCRIPT: 'false' # Enable recursive discovery of files named `custom-script-file` - ENABLE_RECURSIVE_VCS_IMPORT: 'true' # Enable recursive discovery of files named `*.repos` + ENABLE_RECURSIVE_ADDITIONAL_DEBS: 'false' # Enable recursive discovery of files named `additional-debs-file` + ENABLE_RECURSIVE_ADDITIONAL_PIP: 'false' # Enable recursive discovery of files named `additional-pip-file` + ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT: 'false' # Enable recursive discovery of files named `after-dependency-installation-script` + ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: 'false' # Enable recursive discovery of files named `blacklisted-packages-file` + ENABLE_RECURSIVE_VCS_IMPORT: 'true' # Enable recursive discovery of files named `*.repos` ENABLE_SINGLEARCH_PUSH: 'false' # Enable push of single arch images with [-amd64|-arm64] postfix ENABLE_SLIM: 'true' # Enable an extra slimmed run image via slim (only if run stage is targeted) GIT_HTTPS_PASSWORD: ${CI_JOB_TOKEN} # Password for cloning private Git repositories via HTTPS diff --git a/README.md b/README.md index 41330bc..122df5b 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ - [Package Blacklist](#package-blacklist) - [Extra System Dependencies (*apt*)](#extra-system-dependencies-apt) - [Extra System Dependencies (*pip*)](#extra-system-dependencies-pip) - - [Custom Installation Script](#custom-installation-script) + - [Custom Installation Scripts](#custom-installation-scripts) - [Extra Image Files](#extra-image-files) - [Additional Information](#additional-information) - [User Setup](#user-setup) @@ -52,13 +52,14 @@ We recommend to use *docker-ros* in combination with our other tools for Docker The Dockerfile performs the following steps to build these images: 1. All dependency repositories that are defined in a `.repos` file anywhere in the repository are cloned using [*vcstool*](https://github.com/dirk-thomas/vcstool). 2. *(optional)* Packages blacklisted in a special file `blacklisted-packages.txt` are removed from the workspace (see [*Advanced Dependencies*](#package-blacklist)). -3. The ROS dependencies listed in each package's `package.xml` are installed by [*rosdep*](https://docs.ros.org/en/independent/api/rosdep/html/). -4. *(optional)* Additional apt dependencies from a special file `additional-debs.txt` are installed, if needed (see [*Advanced Dependencies*](#extra-system-dependencies-apt)). -5. *(optional)* Additional pip requirements from a special file `additional-pip-requirements.txt` are installed, if needed (see [*Advanced Dependencies*](#extra-system-dependencies-pip)). -6. *(optional)* A special folder `additional-files/` is copied into the images, if needed (see [*Advanced Dependencies*](#extra-image-files)). -7. *(optional)* A special script `custom.sh` is executed to perform further arbitrary installation commands, if needed (see [*Advanced Dependencies*](#custom-installation-script)). -8. *(deployment)* All ROS packages are built using `catkin` (ROS) or `colcon` (ROS2). -9. *(deployment)* A custom launch command is configured to run on container start. +3. *(optional)* A special script `before_dependency_installation.sh` is executed to perform arbitrary installation commands, if needed (see [*Advanced Dependencies*](#custom-installation-scripts)). +4. The ROS dependencies listed in each package's `package.xml` are installed by [*rosdep*](https://docs.ros.org/en/independent/api/rosdep/html/). +5. *(optional)* Additional apt dependencies from a special file `additional-debs.txt` are installed, if needed (see [*Advanced Dependencies*](#extra-system-dependencies-apt)). +6. *(optional)* Additional pip requirements from a special file `additional-pip-requirements.txt` are installed, if needed (see [*Advanced Dependencies*](#extra-system-dependencies-pip)). +7. *(optional)* A special folder `additional-files/` is copied into the images, if needed (see [*Advanced Dependencies*](#extra-image-files)). +8. *(optional)* A special script `after_dependency_installation.sh` is executed to perform arbitrary installation commands, if needed (see [*Advanced Dependencies*](#custom-installation-scripts)). +9. *(deployment)* All ROS packages are built using `catkin` (ROS) or `colcon` (ROS2). +10. *(deployment)* A custom launch command is configured to run on container start. ### Prerequisites @@ -322,11 +323,15 @@ If your ROS-based repository requires Python dependencies that cannot be install Create a file `additional-pip-requirements.txt` in your `docker` folder (or configure a different `ADDITIONAL_PIP_FILE`) and list any other Python dependencies that need to be installed via *pip*. -### Custom Installation Script +### Custom Installation Scripts -If your ROS-based repository requires to execute any other installation or pre-/post-installation steps, you can use a special `custom.sh` script. +If your ROS-based repository requires to execute any other installation or pre-/post-installation steps, you can specify multiple custom scripts that are executed during the image building process. See the [configuration variable documentation](#configuration-variables) for the following variables. +- `BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT` +- `AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT` +- `BEFORE_DEPENDENCY_INSTALLATION_SCRIPT` +- `AFTER_DEPENDENCY_INSTALLATION_SCRIPT` -Create a script `custom.sh` in your `docker` folder (or configure a different `CUSTOM_SCRIPT_FILE`) that executes arbitrary commands as part of the image building process. +Create those scripts in your `docker` folder (or configure different filepaths via the specified environment variables). ### Extra Image Files @@ -366,9 +371,21 @@ The password of the custom user is set to its username (`dockeruser:dockeruser` - **`additional-pip-file` | `ADDITIONAL_PIP_FILE`** Relative filepath to file containing additional pip packages to install *default:* `docker/additional-pip-requirements.txt` +- **`after-dependency-identification-script` | `AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT`** + Relative filepath to script containing commands to run after dependency identification + *default:* `docker/after_dependency_identification.sh` +- **`after-dependency-installation-script` | `AFTER_DEPENDENCY_INSTALLATION_SCRIPT`** + Relative filepath to script containing commands to run after dependency installation + *default:* `docker/after_dependency_installation.sh` - **`base-image` | `BASE_IMAGE`** Base image `name:tag` - *required* + *required* +- **`before-dependency-identification-script` | `BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT`** + Relative filepath to script containing commands to run before dependency identification + *default:* `docker/before_dependency_identification.sh` +- **`before-dependency-installation-script` | `BEFORE_DEPENDENCY_INSTALLATION_SCRIPT`** + Relative filepath to script containing commands to run before dependency installation + *default:* `docker/before_dependency_installation.sh` - **`blacklisted-packages-file` | `BLACKLISTED_PACKAGES_FILE`** Relative filepath to file containing blacklisted packages *default:* `docker/blacklisted-packages.txt` @@ -381,9 +398,6 @@ The password of the custom user is set to its username (`dockeruser:dockeruser` - **`cmake-args` | `CMAKE_ARGS`** CMake arguments to pass to `colcon build` *default:* `"-DCMAKE_BUILD_TYPE=Release"` -- **`custom-script-file` | `CUSTOM_SCRIPT_FILE`** - Relative filepath to script containing custom installation commands - *default:* `docker/custom.sh` - **`dev-image-name` | `DEV_IMAGE_NAME`** Image name of dev image *default:* `` @@ -421,12 +435,12 @@ The password of the custom user is set to its username (`dockeruser:dockeruser` - **`enable-recursive-additional-pip` | `ENABLE_RECURSIVE_ADDITIONAL_PIP`** Enable recursive discovery of files named `additional-pip-file` *default:* `false` +- **`enable-recursive-after-dependency-installation-script` | `ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT`** + Enable recursive discovery of files named `after-dependency-installation-script` + *default:* `false` - **`enable-recursive-blacklisted-packages` | `ENABLE_RECURSIVE_BLACKLISTED_PACKAGES`** Enable recursive discovery of files named `blacklisted-packages-file` *default:* `false` -- **`enable-recursive-custom-script` | `ENABLE_RECURSIVE_CUSTOM_SCRIPT`** - Enable recursive discovery of files named `custom-script-file` - *default:* `false` - **`enable-recursive-vcs-import` | `ENABLE_RECURSIVE_VCS_IMPORT`** Enable recursive discovery of files named `*.repos` *default:* `true` diff --git a/action.yml b/action.yml index 86a5b5c..a2af0ca 100644 --- a/action.yml +++ b/action.yml @@ -14,9 +14,21 @@ inputs: additional-pip-file: description: "Relative filepath to file containing additional pip packages to install" default: docker/additional-pip-requirements.txt + after-dependency-identification-script: + description: "Relative filepath to script containing commands to run after dependency identification" + default: docker/after_dependency_identification.sh + after-dependency-installation-script: + description: "Relative filepath to script containing commands to run after dependency installation" + default: docker/after_dependency_installation.sh base-image: description: "Base image name:tag" required: true + before-dependency-identification-script: + description: "Relative filepath to script containing commands to run before dependency identification" + default: docker/before_dependency_identification.sh + before-dependency-installation-script: + description: "Relative filepath to script containing commands to run before dependency installation" + default: docker/before_dependency_installation.sh blacklisted-packages-file: description: "Relative filepath to file containing blacklisted packages to remove from workspace" default: docker/blacklisted-packages.txt @@ -28,9 +40,6 @@ inputs: cmake-args: description: "CMake arguments to pass to `colcon build`" default: "-DCMAKE_BUILD_TYPE=Release" - custom-script-file: - description: "Relative filepath to script containing custom installation commands" - default: docker/custom.sh dev-image-name: description: "Image name of dev image" default: ghcr.io/${{ github.repository }} @@ -60,12 +69,12 @@ inputs: enable-recursive-additional-pip: description: "Enable recursive discovery of files named `additional-pip-file`" default: false + enable-recursive-after-dependency-installation-script: + description: "Enable recursive discovery of files named `after-dependency-installation-script`" + default: false enable-recursive-blacklisted-packages: description: "Enable recursive discovery of files named `blacklisted-packages-file`" default: false - enable-recursive-custom-script: - description: "Enable recursive discovery of files named `custom-script-file`" - default: false enable-singlearch-push: description: "Enable push of single arch images with [-amd64|-arm64] postfix" default: false @@ -188,18 +197,21 @@ runs: ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} + AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.after-dependency-identification-script }} + AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.after-dependency-installation-script }} BASE_IMAGE: ${{ inputs.base-image }} + BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.before-dependency-identification-script }} + BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.before-dependency-installation-script }} BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} COMMAND: ${{ inputs.command }} CMAKE_ARGS: ${{ inputs.cmake-args }} - CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} DEV_IMAGE_NAME: ${{ steps.dev-image-name.outputs.lowercase }} DEV_IMAGE_TAG: ${{ inputs.dev-image-tag }} DISABLE_ROS_INSTALLATION: ${{ inputs.disable-ros-installation }} ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} + ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-after-dependency-installation-script }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} - ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} ENABLE_SLIM: ${{ inputs.enable-slim }} GIT_HTTPS_PASSWORD: ${{ inputs.git-https-password }} @@ -252,18 +264,21 @@ runs: ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} + AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.after-dependency-identification-script }} + AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.after-dependency-installation-script }} BASE_IMAGE: ${{ inputs.base-image }} + BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.before-dependency-identification-script }} + BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.before-dependency-installation-script }} BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} COMMAND: ${{ inputs.command }} CMAKE_ARGS: ${{ inputs.cmake-args }} - CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} DEV_IMAGE_NAME: ${{ steps.dev-image-name.outputs.lowercase }} DEV_IMAGE_TAG: ${{ inputs.dev-image-tag }} DISABLE_ROS_INSTALLATION: ${{ inputs.disable-ros-installation }} ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} + ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-after-dependency-installation-script }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} - ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} ENABLE_SINGLEARCH_PUSH: ${{ inputs.enable-singlearch-push }} ENABLE_SLIM: ${{ inputs.enable-slim }} @@ -295,18 +310,21 @@ runs: ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} + AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.after-dependency-identification-script }} + AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.after-dependency-installation-script }} BASE_IMAGE: ${{ inputs.base-image }} + BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.before-dependency-identification-script }} + BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.before-dependency-installation-script }} BLACKLISTED_PACKAGES_FILE: ${{ inputs.blacklisted-packages-file }} COMMAND: ${{ inputs.command }} CMAKE_ARGS: ${{ inputs.cmake-args }} - CUSTOM_SCRIPT_FILE: ${{ inputs.custom-script-file }} DEV_IMAGE_NAME: ${{ steps.dev-image-name.outputs.lowercase }} DEV_IMAGE_TAG: latest-dev DISABLE_ROS_INSTALLATION: ${{ inputs.disable-ros-installation }} ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} + ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-after-dependency-installation-script }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} - ENABLE_RECURSIVE_CUSTOM_SCRIPT: ${{ inputs.enable-recursive-custom-script }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} ENABLE_SINGLEARCH_PUSH: ${{ inputs.enable-singlearch-push }} ENABLE_SLIM: ${{ inputs.enable-slim }} diff --git a/scripts/build.sh b/scripts/build.sh index 3cca38f..1d0f4b8 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -39,14 +39,18 @@ build_image() { add_arg_if_set "ADDITIONAL_DEBS_FILE" add_arg_if_set "ADDITIONAL_FILES_DIR" add_arg_if_set "ADDITIONAL_PIP_FILE" + add_arg_if_set "AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT" + add_arg_if_set "AFTER_DEPENDENCY_INSTALLATION_SCRIPT" + add_arg_if_set "BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT" + add_arg_if_set "BEFORE_DEPENDENCY_INSTALLATION_SCRIPT" add_arg_if_set "BLACKLISTED_PACKAGES_FILE" add_arg_if_set "CMAKE_ARGS" add_arg_if_set "CUSTOM_SCRIPT_FILE" add_arg_if_set "DISABLE_ROS_INSTALLATION" add_arg_if_set "ENABLE_RECURSIVE_ADDITIONAL_DEBS" add_arg_if_set "ENABLE_RECURSIVE_ADDITIONAL_PIP" + add_arg_if_set "ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT" add_arg_if_set "ENABLE_RECURSIVE_BLACKLISTED_PACKAGES" - add_arg_if_set "ENABLE_RECURSIVE_CUSTOM_SCRIPT" add_arg_if_set "ENABLE_RECURSIVE_VCS_IMPORT" add_arg_if_set "GIT_HTTPS_PASSWORD" add_arg_if_set "GIT_HTTPS_SERVER" diff --git a/scripts/ci.sh b/scripts/ci.sh index e19d103..3d63b4e 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -22,15 +22,18 @@ SLIM_IMAGE_TAG="${SLIM_IMAGE_TAG:-${IMAGE_TAG}-slim}" ADDITIONAL_DEBS_FILE="${ADDITIONAL_DEBS_FILE:-}" ADDITIONAL_FILES_DIR="${ADDITIONAL_FILES_DIR:-}" ADDITIONAL_PIP_FILE="${ADDITIONAL_PIP_FILE:-}" +AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT="${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT:-}" +AFTER_DEPENDENCY_INSTALLATION_SCRIPT="${AFTER_DEPENDENCY_INSTALLATION_SCRIPT:-}" +BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT="${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT:-}" +BEFORE_DEPENDENCY_INSTALLATION_SCRIPT="${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT:-}" BLACKLISTED_PACKAGES_FILE="${BLACKLISTED_PACKAGES_FILE:-}" CMAKE_ARGS="${CMAKE_ARGS:-}" -CUSTOM_SCRIPT_FILE="${CUSTOM_SCRIPT_FILE:-}" DEV_IMAGE="${DEV_IMAGE_NAME}:${DEV_IMAGE_TAG}" DISABLE_ROS_INSTALLATION="${DISABLE_ROS_INSTALLATION:-}" ENABLE_RECURSIVE_ADDITIONAL_DEBS="${ENABLE_RECURSIVE_ADDITIONAL_DEBS:-}" ENABLE_RECURSIVE_ADDITIONAL_PIP="${ENABLE_RECURSIVE_ADDITIONAL_PIP:-}" +ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT="${ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT:-}" ENABLE_RECURSIVE_BLACKLISTED_PACKAGES="${ENABLE_RECURSIVE_BLACKLISTED_PACKAGES:-}" -ENABLE_RECURSIVE_CUSTOM_SCRIPT="${ENABLE_RECURSIVE_CUSTOM_SCRIPT:-}" ENABLE_RECURSIVE_VCS_IMPORT="${ENABLE_RECURSIVE_VCS_IMPORT:-}" ENABLE_SINGLEARCH_PUSH="${ENABLE_SINGLEARCH_PUSH:-false}" ENABLE_SLIM="${ENABLE_SLIM:-true}" From ed3e273f8331f7810b902ca1d2b9448320a7f083 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Fri, 24 Jan 2025 14:24:05 +0100 Subject: [PATCH 07/12] only install middleware if ROS installation is not disabled via flag --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 8ec9a63..7575c13 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -223,7 +223,7 @@ RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc ARG RMW_IMPLEMENTATION ENV RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION:-rmw_cyclonedds_cpp} RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ - if [[ "$ROS_VERSION" == "2" ]]; then \ + if [[ "$ROS_VERSION" == "2" && "$DISABLE_ROS_INSTALLATION" != "true"]]; then \ apt-get update && \ RMW_PACKAGE=ros-$ROS_DISTRO-$(echo $RMW_IMPLEMENTATION | tr '_' '-') && \ apt-get install -y $RMW_PACKAGE && \ From 73c815e6e51604a52247edfd4cff7edd616effb9 Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Fri, 24 Jan 2025 23:31:30 +0100 Subject: [PATCH 08/12] fix condition in dockerfile --- docker/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 6e9b5df..e1d8597 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -223,7 +223,7 @@ RUN echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc ARG RMW_IMPLEMENTATION ENV RMW_IMPLEMENTATION=${RMW_IMPLEMENTATION:-rmw_cyclonedds_cpp} RUN source /opt/ros/$ROS_DISTRO/setup.bash && \ - if [[ "$ROS_VERSION" == "2" && "$DISABLE_ROS_INSTALLATION" != "true"]]; then \ + if [[ "$ROS_VERSION" == "2" && "$DISABLE_ROS_INSTALLATION" != "true" ]]; then \ apt-get update && \ RMW_PACKAGE=ros-$ROS_DISTRO-$(echo $RMW_IMPLEMENTATION | tr '_' '-') && \ apt-get install -y $RMW_PACKAGE && \ From 185f96b8cfd9e3cb9a98c31cc99a69f9209a9ddb Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Fri, 31 Jan 2025 14:46:11 +0000 Subject: [PATCH 09/12] remove AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT --- .gitlab-ci/docker-ros.yml | 1 - README.md | 4 ---- action.yml | 6 ------ docker/Dockerfile | 7 ------- scripts/build.sh | 1 - scripts/ci.sh | 1 - 6 files changed, 20 deletions(-) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 86f92b3..1bf3663 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -12,7 +12,6 @@ variables: ADDITIONAL_DEBS_FILE: docker/additional-debs.txt # Relative filepath to file containing additional apt deb packages to install ADDITIONAL_FILES_DIR: docker/additional-files # Relative path to directory containing additional files to copy into image" ADDITIONAL_PIP_FILE: docker/additional-pip-requirements.txt # Relative filepath to file containing additional pip packages to install - AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: docker/after_dependency_identification.sh # Relative filepath to script containing commands to run after dependency identification AFTER_DEPENDENCY_INSTALLATION_SCRIPT: docker/after_dependency_installation.sh # Relative filepath to script containing commands to run after dependency installation BASE_IMAGE: '' # Base image name:tag (required) BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: docker/before_dependency_identification.sh # Relative filepath to script containing commands to run before dependency identification diff --git a/README.md b/README.md index 122df5b..1f562de 100644 --- a/README.md +++ b/README.md @@ -327,7 +327,6 @@ Create a file `additional-pip-requirements.txt` in your `docker` folder (or conf If your ROS-based repository requires to execute any other installation or pre-/post-installation steps, you can specify multiple custom scripts that are executed during the image building process. See the [configuration variable documentation](#configuration-variables) for the following variables. - `BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT` -- `AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT` - `BEFORE_DEPENDENCY_INSTALLATION_SCRIPT` - `AFTER_DEPENDENCY_INSTALLATION_SCRIPT` @@ -371,9 +370,6 @@ The password of the custom user is set to its username (`dockeruser:dockeruser` - **`additional-pip-file` | `ADDITIONAL_PIP_FILE`** Relative filepath to file containing additional pip packages to install *default:* `docker/additional-pip-requirements.txt` -- **`after-dependency-identification-script` | `AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT`** - Relative filepath to script containing commands to run after dependency identification - *default:* `docker/after_dependency_identification.sh` - **`after-dependency-installation-script` | `AFTER_DEPENDENCY_INSTALLATION_SCRIPT`** Relative filepath to script containing commands to run after dependency installation *default:* `docker/after_dependency_installation.sh` diff --git a/action.yml b/action.yml index a2af0ca..5d40f19 100644 --- a/action.yml +++ b/action.yml @@ -14,9 +14,6 @@ inputs: additional-pip-file: description: "Relative filepath to file containing additional pip packages to install" default: docker/additional-pip-requirements.txt - after-dependency-identification-script: - description: "Relative filepath to script containing commands to run after dependency identification" - default: docker/after_dependency_identification.sh after-dependency-installation-script: description: "Relative filepath to script containing commands to run after dependency installation" default: docker/after_dependency_installation.sh @@ -197,7 +194,6 @@ runs: ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} - AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.after-dependency-identification-script }} AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.after-dependency-installation-script }} BASE_IMAGE: ${{ inputs.base-image }} BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.before-dependency-identification-script }} @@ -264,7 +260,6 @@ runs: ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} - AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.after-dependency-identification-script }} AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.after-dependency-installation-script }} BASE_IMAGE: ${{ inputs.base-image }} BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.before-dependency-identification-script }} @@ -310,7 +305,6 @@ runs: ADDITIONAL_DEBS_FILE: ${{ inputs.additional-debs-file }} ADDITIONAL_FILES_DIR: ${{ inputs.additional-files-dir }} ADDITIONAL_PIP_FILE: ${{ inputs.additional-pip-file }} - AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.after-dependency-identification-script }} AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.after-dependency-installation-script }} BASE_IMAGE: ${{ inputs.base-image }} BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: ${{ inputs.before-dependency-identification-script }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 8012f16..08fdb50 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -156,13 +156,6 @@ RUN cat $WORKSPACE/.install-dependencies.sh ARG ADDITIONAL_FILES_DIR="docker/additional-files" RUN rm -rf src/target/${ADDITIONAL_FILES_DIR} -# run custom script after dependency identification -ARG AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT="docker/after_dependency_identification.sh" -RUN if [[ -f src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ]]; then \ - chmod +x src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} && \ - src/target/${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT} ; \ - fi - ############ dependencies-install ############################################## FROM ${BASE_IMAGE} AS dependencies-install ARG TARGETARCH diff --git a/scripts/build.sh b/scripts/build.sh index 1d0f4b8..1935f9e 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -39,7 +39,6 @@ build_image() { add_arg_if_set "ADDITIONAL_DEBS_FILE" add_arg_if_set "ADDITIONAL_FILES_DIR" add_arg_if_set "ADDITIONAL_PIP_FILE" - add_arg_if_set "AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT" add_arg_if_set "AFTER_DEPENDENCY_INSTALLATION_SCRIPT" add_arg_if_set "BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT" add_arg_if_set "BEFORE_DEPENDENCY_INSTALLATION_SCRIPT" diff --git a/scripts/ci.sh b/scripts/ci.sh index 3d63b4e..b261759 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -22,7 +22,6 @@ SLIM_IMAGE_TAG="${SLIM_IMAGE_TAG:-${IMAGE_TAG}-slim}" ADDITIONAL_DEBS_FILE="${ADDITIONAL_DEBS_FILE:-}" ADDITIONAL_FILES_DIR="${ADDITIONAL_FILES_DIR:-}" ADDITIONAL_PIP_FILE="${ADDITIONAL_PIP_FILE:-}" -AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT="${AFTER_DEPENDENCY_IDENTIFICATION_SCRIPT:-}" AFTER_DEPENDENCY_INSTALLATION_SCRIPT="${AFTER_DEPENDENCY_INSTALLATION_SCRIPT:-}" BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT="${BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT:-}" BEFORE_DEPENDENCY_INSTALLATION_SCRIPT="${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT:-}" From 935cd7bd66c084a692f944df8148e6ecb1d39094 Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Fri, 31 Jan 2025 14:48:06 +0000 Subject: [PATCH 10/12] let AFTER_DEPENDENCY_INSTALLATION_SCRIPT default to docker/custom.sh for backwards compatibility --- .gitlab-ci/docker-ros.yml | 2 +- README.md | 4 ++-- action.yml | 2 +- docker/Dockerfile | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 1bf3663..7e0d41e 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -12,7 +12,7 @@ variables: ADDITIONAL_DEBS_FILE: docker/additional-debs.txt # Relative filepath to file containing additional apt deb packages to install ADDITIONAL_FILES_DIR: docker/additional-files # Relative path to directory containing additional files to copy into image" ADDITIONAL_PIP_FILE: docker/additional-pip-requirements.txt # Relative filepath to file containing additional pip packages to install - AFTER_DEPENDENCY_INSTALLATION_SCRIPT: docker/after_dependency_installation.sh # Relative filepath to script containing commands to run after dependency installation + AFTER_DEPENDENCY_INSTALLATION_SCRIPT: docker/custom.sh # Relative filepath to script containing commands to run after dependency installation BASE_IMAGE: '' # Base image name:tag (required) BEFORE_DEPENDENCY_IDENTIFICATION_SCRIPT: docker/before_dependency_identification.sh # Relative filepath to script containing commands to run before dependency identification BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: docker/before_dependency_installation.sh # Relative filepath to script containing commands to run before dependency installation diff --git a/README.md b/README.md index 1f562de..4e985fd 100644 --- a/README.md +++ b/README.md @@ -57,7 +57,7 @@ The Dockerfile performs the following steps to build these images: 5. *(optional)* Additional apt dependencies from a special file `additional-debs.txt` are installed, if needed (see [*Advanced Dependencies*](#extra-system-dependencies-apt)). 6. *(optional)* Additional pip requirements from a special file `additional-pip-requirements.txt` are installed, if needed (see [*Advanced Dependencies*](#extra-system-dependencies-pip)). 7. *(optional)* A special folder `additional-files/` is copied into the images, if needed (see [*Advanced Dependencies*](#extra-image-files)). -8. *(optional)* A special script `after_dependency_installation.sh` is executed to perform arbitrary installation commands, if needed (see [*Advanced Dependencies*](#custom-installation-scripts)). +8. *(optional)* A special script `custom.sh` is executed to perform arbitrary installation commands, if needed (see [*Advanced Dependencies*](#custom-installation-scripts)). 9. *(deployment)* All ROS packages are built using `catkin` (ROS) or `colcon` (ROS2). 10. *(deployment)* A custom launch command is configured to run on container start. @@ -372,7 +372,7 @@ The password of the custom user is set to its username (`dockeruser:dockeruser` *default:* `docker/additional-pip-requirements.txt` - **`after-dependency-installation-script` | `AFTER_DEPENDENCY_INSTALLATION_SCRIPT`** Relative filepath to script containing commands to run after dependency installation - *default:* `docker/after_dependency_installation.sh` + *default:* `docker/custom.sh` - **`base-image` | `BASE_IMAGE`** Base image `name:tag` *required* diff --git a/action.yml b/action.yml index 5d40f19..1e0fa1e 100644 --- a/action.yml +++ b/action.yml @@ -16,7 +16,7 @@ inputs: default: docker/additional-pip-requirements.txt after-dependency-installation-script: description: "Relative filepath to script containing commands to run after dependency installation" - default: docker/after_dependency_installation.sh + default: docker/custom.sh base-image: description: "Base image name:tag" required: true diff --git a/docker/Dockerfile b/docker/Dockerfile index 08fdb50..723ddbd 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -141,7 +141,7 @@ RUN echo "pip install pip \\" >> $WORKSPACE/.install-dependencies.sh && \ echo ";" >> $WORKSPACE/.install-dependencies.sh # add custom script to run after dependency installation to install script -ARG AFTER_DEPENDENCY_INSTALLATION_SCRIPT="docker/after_dependency_installation.sh" +ARG AFTER_DEPENDENCY_INSTALLATION_SCRIPT="docker/custom.sh" ARG ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT="false" RUN if [[ $ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT == 'true' ]]; then \ find . -type f -name $(basename ${AFTER_DEPENDENCY_INSTALLATION_SCRIPT}) -exec sed '$a\' {} >> $WORKSPACE/.install-dependencies.sh \; ; \ From 1fb133c3cd54586ca7c585dda4b908c011f93244 Mon Sep 17 00:00:00 2001 From: Lennart Reiher Date: Fri, 31 Jan 2025 14:52:19 +0000 Subject: [PATCH 11/12] add ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT --- .gitlab-ci/docker-ros.yml | 1 + README.md | 3 +++ action.yml | 6 ++++++ docker/Dockerfile | 5 ++++- scripts/build.sh | 1 + scripts/ci.sh | 1 + 6 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.gitlab-ci/docker-ros.yml b/.gitlab-ci/docker-ros.yml index 7e0d41e..cfa6031 100644 --- a/.gitlab-ci/docker-ros.yml +++ b/.gitlab-ci/docker-ros.yml @@ -27,6 +27,7 @@ variables: ENABLE_RECURSIVE_ADDITIONAL_DEBS: 'false' # Enable recursive discovery of files named `additional-debs-file` ENABLE_RECURSIVE_ADDITIONAL_PIP: 'false' # Enable recursive discovery of files named `additional-pip-file` ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT: 'false' # Enable recursive discovery of files named `after-dependency-installation-script` + ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: 'false' # Enable recursive discovery of files named `before-dependency-installation-script` ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: 'false' # Enable recursive discovery of files named `blacklisted-packages-file` ENABLE_RECURSIVE_VCS_IMPORT: 'true' # Enable recursive discovery of files named `*.repos` ENABLE_SINGLEARCH_PUSH: 'false' # Enable push of single arch images with [-amd64|-arm64] postfix diff --git a/README.md b/README.md index 4e985fd..9550c52 100644 --- a/README.md +++ b/README.md @@ -434,6 +434,9 @@ The password of the custom user is set to its username (`dockeruser:dockeruser` - **`enable-recursive-after-dependency-installation-script` | `ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT`** Enable recursive discovery of files named `after-dependency-installation-script` *default:* `false` +- **`enable-recursive-before-dependency-installation-script` | `ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT`** + Enable recursive discovery of files named `before-dependency-installation-script` + *default:* `false` - **`enable-recursive-blacklisted-packages` | `ENABLE_RECURSIVE_BLACKLISTED_PACKAGES`** Enable recursive discovery of files named `blacklisted-packages-file` *default:* `false` diff --git a/action.yml b/action.yml index 1e0fa1e..0540d6d 100644 --- a/action.yml +++ b/action.yml @@ -69,6 +69,9 @@ inputs: enable-recursive-after-dependency-installation-script: description: "Enable recursive discovery of files named `after-dependency-installation-script`" default: false + enable-recursive-before-dependency-installation-script: + description: "Enable recursive discovery of files named `before-dependency-installation-script`" + default: false enable-recursive-blacklisted-packages: description: "Enable recursive discovery of files named `blacklisted-packages-file`" default: false @@ -207,6 +210,7 @@ runs: ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-after-dependency-installation-script }} + ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-before-dependency-installation-script }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} ENABLE_SLIM: ${{ inputs.enable-slim }} @@ -273,6 +277,7 @@ runs: ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-after-dependency-installation-script }} + ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-before-dependency-installation-script }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} ENABLE_SINGLEARCH_PUSH: ${{ inputs.enable-singlearch-push }} @@ -318,6 +323,7 @@ runs: ENABLE_RECURSIVE_ADDITIONAL_DEBS: ${{ inputs.enable-recursive-additional-debs }} ENABLE_RECURSIVE_ADDITIONAL_PIP: ${{ inputs.enable-recursive-additional-pip }} ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-after-dependency-installation-script }} + ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT: ${{ inputs.enable-recursive-before-dependency-installation-script }} ENABLE_RECURSIVE_BLACKLISTED_PACKAGES: ${{ inputs.enable-recursive-blacklisted-packages }} ENABLE_RECURSIVE_VCS_IMPORT: ${{ inputs.enable-recursive-vcs-import }} ENABLE_SINGLEARCH_PUSH: ${{ inputs.enable-singlearch-push }} diff --git a/docker/Dockerfile b/docker/Dockerfile index 723ddbd..48bb373 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -98,7 +98,10 @@ RUN echo "set -e" > $WORKSPACE/.install-dependencies.sh && \ # add custom script to run before dependency installation to install script ARG BEFORE_DEPENDENCY_INSTALLATION_SCRIPT="docker/before_dependency_installation.sh" -RUN if [[ -f src/target/${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT} ]]; then \ +ARG ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT="false" +RUN if [[ $ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT == 'true' ]]; then \ + find . -type f -name $(basename ${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT}) -exec sed '$a\' {} >> $WORKSPACE/.install-dependencies.sh \; ; \ + elif [[ -f src/target/${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT} ]]; then \ cat src/target/${BEFORE_DEPENDENCY_INSTALLATION_SCRIPT} >> $WORKSPACE/.install-dependencies.sh && \ echo "" >> $WORKSPACE/.install-dependencies.sh ; \ fi diff --git a/scripts/build.sh b/scripts/build.sh index 1935f9e..81888ff 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -49,6 +49,7 @@ build_image() { add_arg_if_set "ENABLE_RECURSIVE_ADDITIONAL_DEBS" add_arg_if_set "ENABLE_RECURSIVE_ADDITIONAL_PIP" add_arg_if_set "ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT" + add_arg_if_set "ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT" add_arg_if_set "ENABLE_RECURSIVE_BLACKLISTED_PACKAGES" add_arg_if_set "ENABLE_RECURSIVE_VCS_IMPORT" add_arg_if_set "GIT_HTTPS_PASSWORD" diff --git a/scripts/ci.sh b/scripts/ci.sh index b261759..f56f0c7 100755 --- a/scripts/ci.sh +++ b/scripts/ci.sh @@ -32,6 +32,7 @@ DISABLE_ROS_INSTALLATION="${DISABLE_ROS_INSTALLATION:-}" ENABLE_RECURSIVE_ADDITIONAL_DEBS="${ENABLE_RECURSIVE_ADDITIONAL_DEBS:-}" ENABLE_RECURSIVE_ADDITIONAL_PIP="${ENABLE_RECURSIVE_ADDITIONAL_PIP:-}" ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT="${ENABLE_RECURSIVE_AFTER_DEPENDENCY_INSTALLATION_SCRIPT:-}" +ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT="${ENABLE_RECURSIVE_BEFORE_DEPENDENCY_INSTALLATION_SCRIPT:-}" ENABLE_RECURSIVE_BLACKLISTED_PACKAGES="${ENABLE_RECURSIVE_BLACKLISTED_PACKAGES:-}" ENABLE_RECURSIVE_VCS_IMPORT="${ENABLE_RECURSIVE_VCS_IMPORT:-}" ENABLE_SINGLEARCH_PUSH="${ENABLE_SINGLEARCH_PUSH:-false}" From 8008a0c8155964d3f74007dc5dc5b012c5b86bcc Mon Sep 17 00:00:00 2001 From: Jean-Pierre Busch Date: Mon, 3 Feb 2025 14:51:01 +0100 Subject: [PATCH 12/12] add targetarch env to dependencies stage --- docker/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/docker/Dockerfile b/docker/Dockerfile index 7bd78c0..45494fa 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -2,6 +2,8 @@ ARG BASE_IMAGE ############ dependencies ###################################################### FROM ${BASE_IMAGE} AS dependencies +ARG TARGETARCH +ENV TARGETARCH=${TARGETARCH} USER root SHELL ["/bin/bash", "-c"]