-
Notifications
You must be signed in to change notification settings - Fork 2
Add arm64 image #1
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
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 |
|---|---|---|
|
|
@@ -13,19 +13,29 @@ on: | |
| - "valhalla_python" | ||
| paths-ignore: | ||
| - '*.md' | ||
| pull_request: | ||
| branches: | ||
| - "valhalla_python" | ||
|
|
||
| concurrency: | ||
| group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.sha }} | ||
| cancel-in-progress: true | ||
|
|
||
| jobs: | ||
| build_manylinux: | ||
| name: manylinux_2_28_x86_64 | ||
| runs-on: ubuntu-22.04 | ||
| name: manylinux_2_28_${{ matrix.platform }} | ||
| runs-on: ${{ matrix.runner }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - platform: x86_64 | ||
| runner: ubuntu-22.04 | ||
| - platform: aarch64 | ||
| runner: ubuntu-22.04-arm | ||
|
|
||
| env: | ||
| POLICY: manylinux_2_28 | ||
| PLATFORM: x86_64 | ||
| PLATFORM: ${{ matrix.platform }} | ||
| COMMIT_SHA: ${{ github.sha }} | ||
|
|
||
| steps: | ||
|
|
@@ -39,13 +49,14 @@ jobs: | |
| if: github.event_name != 'workflow_dispatch' || fromJSON(github.event.inputs.useCache) | ||
| uses: actions/cache/restore@v4 | ||
| with: | ||
| path: .buildx-cache-manylinux_2_28_x86_64/ | ||
| key: buildx-cache-manylinux_2_28_x86_64-${{ hashFiles('docker/**') }} | ||
| restore-keys: buildx-cache-manylinux_2_28_x86_64- | ||
| path: .buildx-cache-manylinux_2_28_${{ matrix.platform }}/ | ||
| key: buildx-cache-manylinux_2_28_${{ matrix.platform }}-${{ hashFiles('docker/**') }} | ||
| restore-keys: buildx-cache-manylinux_2_28_${{ matrix.platform }}- | ||
|
|
||
| - name: Get branch name | ||
| run: | | ||
| echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
| echo "REPO_LOWERCASE=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | ||
|
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. Makes it properly working on forks: lowercase is needed because Docker doesn't allow any uppercase in repo name (
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. Ah I thought that was only the "docker" docker registry. |
||
|
|
||
| - name: Build image | ||
| run: ./build.sh | ||
|
|
@@ -54,12 +65,35 @@ jobs: | |
| if: always() | ||
| uses: actions/cache/save@v4 | ||
| with: | ||
| path: .buildx-cache-manylinux_2_28_x86_64/ | ||
| key: buildx-cache-manylinux_2_28_x86_64-${{ hashFiles('docker/**') }} | ||
| path: .buildx-cache-manylinux_2_28_${{ matrix.platform }}/ | ||
| key: buildx-cache-manylinux_2_28_${{ matrix.platform }}-${{ hashFiles('docker/**') }} | ||
|
|
||
| - name: Push image | ||
| if: github.event_name == 'push' | ||
| run: | | ||
| docker tag quay.io/pypa/manylinux_2_28_x86_64:${{ github.sha }} ghcr.io/valhalla/manylinux:2_28_${{ env.BRANCH }} | ||
| docker image rm quay.io/pypa/manylinux_2_28_x86_64:${{ github.sha }} | ||
| echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
| docker push ghcr.io/valhalla/manylinux:2_28_${{ env.BRANCH }} | ||
|
|
||
| docker tag quay.io/pypa/manylinux_2_28_${{ matrix.platform }}:${{ github.sha }} ghcr.io/${{ env.REPO_LOWERCASE }}:2_28_${{ matrix.platform }}_${{ env.BRANCH }} | ||
| docker push ghcr.io/${{ env.REPO_LOWERCASE }}:2_28_${{ matrix.platform }}_${{ env.BRANCH }} | ||
| docker image rm quay.io/pypa/manylinux_2_28_${{ matrix.platform }}:${{ github.sha }} | ||
|
|
||
| create_manifest: | ||
|
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. Creates "magic" image which contains both architectures under the same name. |
||
| name: Create multi-arch manifest | ||
| runs-on: ubuntu-24.04 | ||
|
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. Could do "-latest" where we can |
||
| needs: build_manylinux | ||
| if: github.event_name == 'push' | ||
|
|
||
| steps: | ||
| - name: Get branch name | ||
| run: | | ||
| echo "BRANCH=${GITHUB_REF##*/}" >> $GITHUB_ENV | ||
| echo "REPO_LOWERCASE=$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV | ||
|
|
||
| - name: Create and push manifest | ||
| run: | | ||
| echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.actor }} --password-stdin | ||
|
|
||
| docker manifest create ghcr.io/${{ env.REPO_LOWERCASE }}:2_28_${{ env.BRANCH }} \ | ||
| --amend ghcr.io/${{ env.REPO_LOWERCASE }}:2_28_x86_64_${{ env.BRANCH }} \ | ||
| --amend ghcr.io/${{ env.REPO_LOWERCASE }}:2_28_aarch64_${{ env.BRANCH }} | ||
| docker manifest push ghcr.io/${{ env.REPO_LOWERCASE }}:2_28_${{ env.BRANCH }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,6 +18,11 @@ check_var "${FREEXL_DOWNLOAD_URL}" | |
| fetch_source "${FREEXL_ROOT}.tar.gz" "$FREEXL_DOWNLOAD_URL" | ||
| tar -xzf "${FREEXL_ROOT}.tar.gz" | ||
| pushd "${FREEXL_ROOT}" | ||
| # Update config.guess and config.sub for aarch64 support | ||
| if [ -f /usr/share/automake-*/config.guess ]; then | ||
| cp -f /usr/share/automake-*/config.guess . | ||
|
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. This I don't really understand. We're copying some config stuff from automake?
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. Well, tbh it is something what I got as a tip from Claude Code when doing this(yes, these days it is how people actually do software engineering 😂 ). My understanding of what happens: these dependencies have these |
||
| cp -f /usr/share/automake-*/config.sub . | ||
| fi | ||
| ./configure | ||
| make -j$(nproc) | ||
| DESTDIR=/manylinux-rootfs make install | ||
|
|
||
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.
Probably a good idea to have CI running for PRs...
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.
Yeah totally! Didn't ever expect PRs tbh😄 and I usually commit directly to master in this repo
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.
Can you also ignore md files?
Uh oh!
There was an error while loading. Please reload this page.
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.
Do you want me to create yet another PR? :) Now I understand that it was merged by mistake 😄