Skip to content

Commit 14bc931

Browse files
authored
feat(ci,docker): change vcs import to COPY src (#4738)
* introduce src-imported stage Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * empty Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * generate install package lists * append || true Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * cat packages Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * chore(docker): separate `rosdep install` and `colcon build` RUN commands (#4719) * wip Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * wip Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * Update Dockerfile * Update Dockerfile * install pacmod * rename * Revert "install pacmod" This reverts commit ebff10f. * install pacmod3 * register pamod3 repos * ignore hadolint * revert * run set-dev-env.sh * pip install * copy * rosdep update * vcs import outside dockerfile Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * refine order and remove /autoware/src at last * fix hadolint * remove tar files Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> * shell: bash Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp> --------- Signed-off-by: Yutaka Kondo <yutaka.kondo@youtalk.jp>
1 parent 4998cac commit 14bc931

File tree

4 files changed

+53
-7
lines changed

4 files changed

+53
-7
lines changed

.github/actions/docker-build-and-push/action.yaml

+18
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,12 @@ runs:
151151
overwrite: true
152152
if-no-files-found: error
153153

154+
- name: Remove tar file - prebuilt
155+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
156+
run: |
157+
rm /tmp/prebuilt.tar
158+
shell: bash
159+
154160
- name: Upload Artifact - devel
155161
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
156162
id: artifact-upload-step-devel
@@ -163,6 +169,12 @@ runs:
163169
overwrite: true
164170
if-no-files-found: error
165171

172+
- name: Remove tar file - devel
173+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
174+
run: |
175+
rm /tmp/devel.tar
176+
shell: bash
177+
166178
- name: Upload Artifact - runtime
167179
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
168180
id: artifact-upload-step-runtime
@@ -175,6 +187,12 @@ runs:
175187
overwrite: true
176188
if-no-files-found: error
177189

190+
- name: Remove tar file - runtime
191+
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
192+
run: |
193+
rm /tmp/runtime.tar
194+
shell: bash
195+
178196
- name: Output artifact URLs
179197
id: output-artifact-urls
180198
run: |

.github/workflows/docker-build-and-push-main-self-hosted.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,25 @@ jobs:
5656
- name: Check out repository
5757
uses: actions/checkout@v4
5858

59+
- name: Install vcstool
60+
run: |
61+
sudo apt-get -y update
62+
sudo apt-get -y install python3-pip
63+
pip install --no-cache-dir vcstool
64+
65+
- name: Set git config
66+
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
67+
with:
68+
token: ${{ secrets.GITHUB_TOKEN }}
69+
5970
- name: Free disk space
6071
uses: ./.github/actions/free-disk-space
6172

73+
- name: Run vcs import
74+
run: |
75+
mkdir src
76+
vcs import src < autoware.repos
77+
6278
- name: Build 'autoware-openadk'
6379
uses: ./.github/actions/docker-build-and-push
6480
with:

.github/workflows/docker-build-and-push-main.yaml

+16
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,25 @@ jobs:
5151
- name: Check out repository
5252
uses: actions/checkout@v4
5353

54+
- name: Install vcstool
55+
run: |
56+
sudo apt-get -y update
57+
sudo apt-get -y install python3-pip
58+
pip install --no-cache-dir vcstool
59+
60+
- name: Set git config
61+
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
62+
with:
63+
token: ${{ secrets.GITHUB_TOKEN }}
64+
5465
- name: Free disk space
5566
uses: ./.github/actions/free-disk-space
5667

68+
- name: Run vcs import
69+
run: |
70+
mkdir src
71+
vcs import src < autoware.repos
72+
5773
- name: Build 'autoware-openadk'
5874
uses: ./.github/actions/docker-build-and-push
5975
with:

docker/autoware-openadk/Dockerfile

+3-7
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,10 @@ WORKDIR /autoware
4040
RUN --mount=type=ssh \
4141
./setup-dev-env.sh -y rosdep \
4242
&& pip uninstall -y ansible ansible-core \
43-
&& pip install --no-cache-dir vcstool \
4443
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
4544

46-
WORKDIR /autoware
47-
COPY autoware.repos /autoware/
48-
RUN --mount=type=ssh \
49-
mkdir src \
50-
&& vcs import src < autoware.repos
45+
# Copy repository files
46+
COPY src /autoware/src
5147

5248
# Generate install package lists
5349
RUN rosdep update && rosdep keys --ignore-src --from-paths src \
@@ -83,7 +79,6 @@ RUN --mount=type=ssh \
8379
&& find / -name 'libnv*.a' -delete
8480

8581
# Install rosdep dependencies
86-
COPY --from=src-imported /autoware/src /autoware/src
8782
COPY --from=src-imported /rosdep-all-depend-packages.txt /tmp/rosdep-all-depend-packages.txt
8883
# hadolint ignore=SC2002
8984
RUN --mount=type=ssh \
@@ -92,6 +87,7 @@ RUN --mount=type=ssh \
9287
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache
9388

9489
# Build Autoware
90+
COPY --from=src-imported /autoware/src /autoware/src
9591
RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \
9692
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --cmake-args \
9793
" -Wno-dev" \

0 commit comments

Comments
 (0)