Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 53 additions & 4 deletions .github/workflows/docker-ros.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,18 +11,37 @@ on:
- main
workflow_dispatch:

permissions:
contents: read
packages: write

# Architecture tags must not be overwritten by another run before assembly/cleanup.
concurrency:
group: docker-ros-${{ github.ref }}
cancel-in-progress: false
Comment on lines +14 to +21

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where does that come from, or why do we need it?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

permissions explicitly allows the token to read repository contents and publish packages. The new manifest job uses GITHUB_TOKEN to push to GHCR, which requires packages: write. Whether this was already granted implicitly depends on repository settings. GitHub docs

concurrency prevents overlapping runs for the same ref from overwriting architecture tags during manifest assembly. Otherwise, a manifest could combine AMD64 from one commit with ARM64 from another. cancel-in-progress: false lets the active build finish. GitHub docs


jobs:
docker-ros:
runs-on: ubuntu-latest
strategy:
matrix:
target: [dev, run]
platform: [amd64, arm64]
include:
- platform: amd64
runner: ubuntu-latest
- platform: arm64
runner: ubuntu-24.04-arm
Comment thread
lostendo marked this conversation as resolved.
Resolved
runs-on: ${{ matrix.runner }}
steps:
- name: Free Disk Space (Ubuntu)
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
preinstalled-runtimes: true
Comment thread
lostendo marked this conversation as resolved.
Resolved
- uses: ika-rwth-aachen/docker-ros@main
with:
platform: amd64
target: dev,run
platform: ${{ matrix.platform }}
target: ${{ matrix.target }}
enable-singlearch-push: true
base-image: rwthika/ros2-cuda:jazzy-desktop-full
enable-build-required-packages-only: "false"
enable-recursive-vcs-import: "false"
Expand All @@ -32,3 +51,33 @@ jobs:
label-authors: Institute for Automotive Engineering (ika), RWTH Aachen University <[email protected]>
env:
TARGET_CMAKE_ARGS: -DCMAKE_EXPORT_COMPILE_COMMANDS=1

manifest:
needs: docker-ros
runs-on: ubuntu-latest
steps:
- name: Slugify ref name
id: slugify-ref-name
uses: gacts/github-slug@v1
with:
to-slug: ${{ github.head_ref || github.ref_name }}
- name: Login to GHCR
uses: docker/login-action@v4
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Docker buildx
uses: docker/setup-buildx-action@v4
- name: Push multi-arch manifests
shell: bash
env:
IMAGE_NAME: ghcr.io/${{ github.repository }}
IMAGE_TAG: ${{ github.ref_type == 'tag' && github.ref_name || 'latest' }}
# Match docker-ros's suffix for PRs and non-default branches.
IMAGE_POSTFIX: ${{ github.ref_type != 'tag' && github.ref != format('refs/heads/{0}', github.event.repository.default_branch) && format('_{0}_ci', steps.slugify-ref-name.outputs.slug) || '' }}
run: |
for suffix in '' '-dev' '-slim'; do
image="${IMAGE_NAME,,}:${IMAGE_TAG}${suffix}${IMAGE_POSTFIX}"
docker buildx imagetools create --tag "$image" "${image}-amd64" "${image}-arm64"
done
Comment on lines +55 to +83

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks to me like this could be integrated quite easily into docker-ros. That would probably be cleaner than copying this block everywhere. Alternatively, we could stick it in the dev-environment, but for now I'd lean toward trying it in docker-ros.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually we'll probably only need the last step here, because the remaining steps are already happening in docker-ros anyway.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These steps already run inside docker-ros, but in the matrix build jobs. The manifest job runs on a fresh runner, so it needs its own registry login and tooling, plus the branch suffix to find the correct tags. We could potentially use the runner’s preinstalled buildx, but otherwise we need these steps with the current setup.

2 changes: 1 addition & 1 deletion deployment/helm/Chart.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ description: Monitoring launch package
dependencies:
- repository: oci://ghcr.io/openads-project/openads-helm
name: openadservice
version: 1.2.0
version: 1.3.0
Loading