From 7bb468307d9a96a080b69efd9d227b475abd80c6 Mon Sep 17 00:00:00 2001 From: paulbourelly999 <77466294+paulbourelly999@users.noreply.github.com> Date: Mon, 6 May 2024 09:44:21 -0400 Subject: [PATCH] Fix target directory for cloned ros1_bridge repository to ensure it is built in final image (#237) # PR Details ## Description This PR updates `checkout.bash` to change the target directory in which the `ros1_bridge` repo is cloned into when the `BRANCH` environment variable is set to `develop`. Prior to this change, when `BRANCH` was set to `develop`, the `ros1_bridge` repo was cloned into /home/carma/src, but the `install.sh` script only builds ROS 2 packages located at ~/.base-image/ros2_msgs_ws ## Related GitHub Issue NA ## Related Jira Key CAR-6031 ## Motivation and Context See above ## How Has This Been Tested? Local integration test CI (docker/docker action) ## Types of changes - [x] Defect fix (non-breaking change that fixes an issue) - [ ] New feature (non-breaking change that adds functionality) - [ ] Breaking change (fix or feature that cause existing functionality to change) ## Checklist: - [ ] I have added any new packages to the sonar-scanner.properties file - [ ] My change requires a change to the documentation. - [ ] I have updated the documentation accordingly. - [x] I have read the [**CONTRIBUTING**](https://github.com/usdot-fhwa-stol/carma-platform/blob/develop/Contributing.md) document. - [ ] I have added tests to cover my changes. - [ ] All new and existing tests passed. --------- Co-authored-by: Misheel Bayartsengel --- .github/workflows/docker.yml | 2 ++ docker/checkout.bash | 22 ++++++++++++---------- docker/install.sh | 5 ++++- 3 files changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index 738b884..d861d53 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -7,3 +7,5 @@ on: jobs: docker: uses: usdot-fhwa-stol/actions/.github/workflows/docker.yml@main + with: + runner: ubuntu-latest-16-cores \ No newline at end of file diff --git a/docker/checkout.bash b/docker/checkout.bash index 65c9ddc..f39aa6b 100755 --- a/docker/checkout.bash +++ b/docker/checkout.bash @@ -1,13 +1,13 @@ #!/bin/bash # Copyright (C) 2018-2021 LEIDOS. -# +# # Licensed under the Apache License, Version 2.0 (the "License"); you may not # use this file except in compliance with the License. You may obtain a copy of # the License at -# +# # http://www.apache.org/licenses/LICENSE-2.0 -# +# # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the @@ -41,20 +41,22 @@ cd ${dir}/src # clone carma repos - +# Currently autoware.ai is being cloned into a hardcoded directory +# that the install script is also hardcoded to look for. This should be uncoupled: +# https://github.com/usdot-fhwa-stol/carma-platform/issues/2374 if [[ "$BRANCH" == "develop" ]]; then cd /home/carma/ git clone https://github.com/usdot-fhwa-stol/autoware.ai.git --depth 1 --branch carma-"$BRANCH" - cd ${dir}/src + cd ${dir}/src git clone https://github.com/usdot-fhwa-stol/ros1_bridge.git --depth 1 --branch "$BRANCH" elif [[ "$BRANCH" == "master" ]]; then - cd /home/carma/ + cd /home/carma/ git clone https://github.com/usdot-fhwa-stol/autoware.ai.git --depth 1 --branch carma-"$BRANCH" - cd /home/carma/.base-image/workspace/src + cd ${dir}/src git clone https://github.com/usdot-fhwa-stol/ros1_bridge.git --depth 1 --branch carma-"$BRANCH" else - cd /home/carma/ + cd /home/carma/ git clone https://github.com/usdot-fhwa-stol/autoware.ai.git --depth 1 --branch "$BRANCH" - cd /home/carma/.base-image/workspace/src - git clone https://github.com/usdot-fhwa-stol/ros1_bridge.git --depth 1 --branch "$BRANCH" + cd ${dir}/src + git clone https://github.com/usdot-fhwa-stol/ros1_bridge.git --depth 1 --branch "$BRANCH" fi diff --git a/docker/install.sh b/docker/install.sh index 1cf1886..54cd28f 100755 --- a/docker/install.sh +++ b/docker/install.sh @@ -1,7 +1,10 @@ #!/bin/bash set -e + +# Checkout dependent repositories +/home/carma/.base-image/ros1_msgs_ws/src/carma_msgs/docker/checkout.bash -r /home/carma/.base-image/workspace + # ROS 1 msgs setup -/home/carma/.base-image/ros1_msgs_ws/src/carma_msgs/docker/checkout.bash cp -R /home/carma/autoware.ai/messages /home/carma/.base-image/ros1_msgs_ws/src/autoware.ai/ cp -R /home/carma/autoware.ai/jsk_common_msgs /home/carma/.base-image/ros1_msgs_ws/src/autoware.ai/ cp -R /home/carma/autoware.ai/jsk_recognition /home/carma/.base-image/ros1_msgs_ws/src/autoware.ai/