-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
ci: provide arm64 image build #83907
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
4f4d69e
a149bfb
18a452c
f056374
0dd270f
b383241
c8cdda8
aa9ec5a
b5651cb
dfb63e3
146ae51
068a106
a646685
36faf54
38edfad
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -19,8 +19,17 @@ env: | |
|
|
||
| jobs: | ||
| self-hosted: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| runs-on: ${{ matrix.os }} | ||
| strategy: | ||
| matrix: | ||
| include: | ||
| - os: ubuntu-24.04 | ||
| platform: amd64 | ||
| - os: ubuntu-24.04-arm | ||
| platform: arm64 | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
|
|
||
|
|
@@ -64,29 +73,144 @@ jobs: | |
| python3 -m tools.fast_editable --path . | ||
| python3 -m sentry.build.main | ||
|
|
||
| - run: docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< "$GHCR_TOKEN" | ||
| - run: docker login --username '${{ github.actor }}' --password '${{ github.token }}' ghcr.io | ||
| if: github.ref_name == 'master' && github.event_name != 'pull_request' | ||
|
|
||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | ||
|
|
||
| - name: Build | ||
| uses: docker/build-push-action@32945a339266b759abcbdc89316275140b0fc960 # v6.8.10 | ||
| with: | ||
| context: . | ||
| file: '{context}/self-hosted/Dockerfile' | ||
| cache-from: ghcr.io/getsentry/sentry:latest | ||
| cache-to: type=inline | ||
| platforms: linux/${{ matrix.platform }} | ||
| tags: sentry:${{ matrix.platform }} | ||
| outputs: type=docker,dest=/tmp/sentry-${{ matrix.platform }}.tar | ||
| push: false | ||
| build-args: | | ||
| SOURCE_COMMIT=${{ github.sha }} | ||
| TARGETARCH=${{ matrix.platform }} | ||
|
|
||
| - name: Upload Image | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||
| with: | ||
| name: sentry-${{ matrix.platform }} | ||
| path: /tmp/sentry-${{ matrix.platform }}.tar | ||
|
|
||
| assemble: | ||
| needs: [self-hosted] | ||
| if: ${{ github.ref_name == 'master' && github.event_name != 'pull_request' }} | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| contents: read | ||
| packages: write | ||
| steps: | ||
| - name: Docker Login | ||
| run: docker login --username '${{ github.actor }}' --password-stdin ghcr.io <<< "$GHCR_TOKEN" | ||
| env: | ||
| GHCR_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| if: github.event_name != 'pull_request' | ||
|
|
||
| - run: docker buildx create --driver docker-container --use | ||
| - name: Set up Docker Buildx | ||
| uses: docker/setup-buildx-action@b5ca514318bd6ebac0fb2aedd5d36ec1b5c232a2 # v3.10.0 | ||
|
|
||
| - run: | | ||
| if [ ${{ github.event_name }} = 'push' ]; then | ||
| args=( | ||
| --tag ghcr.io/getsentry/sentry-self-hosted:latest | ||
| --push | ||
| ) | ||
| - name: Download amd64 Image | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.2 | ||
| with: | ||
| name: sentry-amd64 | ||
| path: /tmp | ||
|
|
||
| - name: Load amd64 Image | ||
| run: docker load --input /tmp/sentry-amd64.tar | ||
|
|
||
| - name: Download arm64 Image | ||
| uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.2 | ||
| with: | ||
| name: sentry-arm64 | ||
| path: /tmp | ||
|
|
||
| - name: Load arm64 Image | ||
| run: docker load --input /tmp/sentry-arm64.tar | ||
|
|
||
| - name: Push to GitHub Container Registry | ||
| run: | | ||
| docker tag sentry:amd64 ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 | ||
| docker push ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 | ||
|
|
||
| docker tag sentry:arm64 ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 | ||
| docker push ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 | ||
|
|
||
| docker manifest create \ | ||
| ghcr.io/getsentry/sentry:${{ github.sha }} \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 | ||
|
|
||
| docker manifest push ghcr.io/getsentry/sentry:${{ github.sha }} | ||
|
|
||
| docker manifest create \ | ||
| ghcr.io/getsentry/sentry:latest \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 | ||
|
|
||
| docker manifest push ghcr.io/getsentry/sentry:latest | ||
|
|
||
| docker manifest create \ | ||
| ghcr.io/getsentry/sentry:nightly \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 | ||
|
|
||
| docker manifest push ghcr.io/getsentry/sentry:nightly | ||
|
|
||
| # These manifests below are being used for development purposes. | ||
| # We shall keep it as is. | ||
| docker manifest create \ | ||
| ghcr.io/getsentry/sentry-self-hosted:${{ github.sha }} \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 | ||
|
|
||
| docker manifest push ghcr.io/getsentry/sentry-self-hosted:${{ github.sha }} | ||
|
|
||
| docker manifest create \ | ||
| ghcr.io/getsentry/sentry-self-hosted:latest \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-amd64 \ | ||
| --amend ghcr.io/getsentry/sentry:${{ github.sha }}-arm64 | ||
|
|
||
| docker manifest push ghcr.io/getsentry/sentry-self-hosted:latest | ||
|
|
||
| publish-dockerhub: | ||
| needs: [assemble] | ||
| runs-on: ubuntu-latest | ||
| if: ${{ (github.ref_name == 'master') }} | ||
|
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. No
Collaborator
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. No need, the assemble itself already has this guard: if: ${{ github.ref_name == 'master' && github.event_name != 'pull_request' }}
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. Then why this check at all?
Collaborator
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. Double guard :)
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. Err, no please. Either have it full or none. No in between stuff. |
||
| steps: | ||
| - uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
| - name: Get short SHA for docker tag | ||
| id: short_sha | ||
| shell: bash | ||
| run: | | ||
| SHORT_SHA=$(git rev-parse --short "$GITHUB_SHA") | ||
| if [[ -z "$SHORT_SHA" ]]; then | ||
| echo "Short SHA empty? Re-running rev-parse." | ||
| git rev-parse --short "$GITHUB_SHA" | ||
| else | ||
| args=() | ||
| echo "sha=$SHORT_SHA" >> $GITHUB_OUTPUT | ||
| fi | ||
| - name: Push built docker image | ||
| shell: bash | ||
| env: | ||
| SHORT_SHA: ${{ steps.short_sha.outputs.sha }} | ||
| IMAGE_URL: ghcr.io/getsentry/sentry-self-hosted:${{ github.sha }} | ||
| run: | | ||
| # only login if the password is set | ||
| if [[ "${{ secrets.DOCKER_HUB_RW_TOKEN }}" ]]; then echo "${{ secrets.DOCKER_HUB_RW_TOKEN }}" | docker login --username=sentrybuilder --password-stdin; fi | ||
BYK marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| # We push 3 tags to Dockerhub: | ||
| # first, the full sha of the commit | ||
| docker buildx imagetools create --tag getsentry/sentry:${GITHUB_SHA} ghcr.io/getsentry/sentry:${{ github.sha }} | ||
|
|
||
| # second, the short sha of the commit | ||
| docker buildx imagetools create --tag getsentry/sentry:${SHORT_SHA} ghcr.io/getsentry/sentry:${{ github.sha }} | ||
|
|
||
| docker buildx build \ | ||
| --pull \ | ||
| --cache-from ghcr.io/getsentry/sentry-self-hosted:latest \ | ||
| --cache-to type=inline \ | ||
| --tag ghcr.io/getsentry/sentry-self-hosted:${{ github.sha }} \ | ||
| --file self-hosted/Dockerfile \ | ||
| --build-arg SOURCE_COMMIT=${{ github.sha }} \ | ||
| "${args[@]}" \ | ||
| . | ||
| # finally, nightly | ||
| docker buildx imagetools create --tag getsentry/sentry:nightly ghcr.io/getsentry/sentry:${{ github.sha }} | ||
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.
I believe this change is causing ci builds to fail for the 25.6.0 release:
https://github.com/getsentry/publish/actions/runs/15688973336/job/44199206790
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.
followed up #93640