Skip to content

Commit

Permalink
feat(ci,docker): change vcs import to COPY src (#4738)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
youtalk authored May 23, 2024
1 parent 4998cac commit 14bc931
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 7 deletions.
18 changes: 18 additions & 0 deletions .github/actions/docker-build-and-push/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,12 @@ runs:
overwrite: true
if-no-files-found: error

- name: Remove tar file - prebuilt
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
run: |
rm /tmp/prebuilt.tar
shell: bash

- name: Upload Artifact - devel
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
id: artifact-upload-step-devel
Expand All @@ -163,6 +169,12 @@ runs:
overwrite: true
if-no-files-found: error

- name: Remove tar file - devel
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
run: |
rm /tmp/devel.tar
shell: bash

- name: Upload Artifact - runtime
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
id: artifact-upload-step-runtime
Expand All @@ -175,6 +187,12 @@ runs:
overwrite: true
if-no-files-found: error

- name: Remove tar file - runtime
if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.artifacts-destination == 'tarball' }}
run: |
rm /tmp/runtime.tar
shell: bash

- name: Output artifact URLs
id: output-artifact-urls
run: |
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/docker-build-and-push-main-self-hosted.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,25 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Install vcstool
run: |
sudo apt-get -y update
sudo apt-get -y install python3-pip
pip install --no-cache-dir vcstool
- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Free disk space
uses: ./.github/actions/free-disk-space

- name: Run vcs import
run: |
mkdir src
vcs import src < autoware.repos
- name: Build 'autoware-openadk'
uses: ./.github/actions/docker-build-and-push
with:
Expand Down
16 changes: 16 additions & 0 deletions .github/workflows/docker-build-and-push-main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -51,9 +51,25 @@ jobs:
- name: Check out repository
uses: actions/checkout@v4

- name: Install vcstool
run: |
sudo apt-get -y update
sudo apt-get -y install python3-pip
pip install --no-cache-dir vcstool
- name: Set git config
uses: autowarefoundation/autoware-github-actions/set-git-config@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}

- name: Free disk space
uses: ./.github/actions/free-disk-space

- name: Run vcs import
run: |
mkdir src
vcs import src < autoware.repos
- name: Build 'autoware-openadk'
uses: ./.github/actions/docker-build-and-push
with:
Expand Down
10 changes: 3 additions & 7 deletions docker/autoware-openadk/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -40,14 +40,10 @@ WORKDIR /autoware
RUN --mount=type=ssh \
./setup-dev-env.sh -y rosdep \
&& pip uninstall -y ansible ansible-core \
&& pip install --no-cache-dir vcstool \
&& apt-get autoremove -y && apt-get clean -y && rm -rf /var/lib/apt/lists/* "$HOME"/.cache

WORKDIR /autoware
COPY autoware.repos /autoware/
RUN --mount=type=ssh \
mkdir src \
&& vcs import src < autoware.repos
# Copy repository files
COPY src /autoware/src

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

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

# Build Autoware
COPY --from=src-imported /autoware/src /autoware/src
RUN source /opt/ros/"$ROS_DISTRO"/setup.bash \
&& colcon build --cmake-args -DCMAKE_BUILD_TYPE=Release --cmake-args \
" -Wno-dev" \
Expand Down

0 comments on commit 14bc931

Please sign in to comment.