Repository navigation
Enable ARM64 build #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 | ||
|
|
||
| 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 | ||
|
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 | ||
|
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" | ||
|
|
@@ -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
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| +6 −5 | .github/workflows/compose-oci.yml | |
| +54 −28 | .github/workflows/ghcr-cleanup.yml | |
| +6 −5 | .gitlab-ci.template.yml | |
| +15 −3 | README.md | |
| +20 −5 | scripts/generate_helm.py | |
| +25 −0 | scripts/generate_readme.py | |
| +1 −1 | scripts/templates/helm_chart.yaml.j2 | |
| +10 −1 | scripts/templates/package_readme.md.j2 | |
| +14 −8 | tests/test_generate_compose.py | |
| +32 −10 | tests/test_generate_helm.py | |
| +136 −0 | tests/test_generate_readme.py |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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