Skip to content

build: Build multiarch image#124

Merged
lynnagara merged 10 commits intomainfrom
devservices-multiarch
May 8, 2026
Merged

build: Build multiarch image#124
lynnagara merged 10 commits intomainfrom
devservices-multiarch

Conversation

@lynnagara
Copy link
Copy Markdown
Member

Add linux/arm64 to the build-docker-image workflow alongside linux/amd64 so the published image runs natively on Apple Silicon.

This enables Sentry staff to more easily run on M-series mac.

Add linux/arm64 to the build-docker-image workflow alongside linux/amd64
so the published image runs natively on Apple Silicon. This enables Sentry
staff to more easily run on M-series mac.
@lynnagara lynnagara requested a review from a team as a code owner May 7, 2026 21:13
Comment thread .github/workflows/build-docker-image.yml Outdated
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 3fcc2e1. Configure here.

Comment thread .github/workflows/build-docker-image.yml Outdated
@lynnagara lynnagara marked this pull request as draft May 7, 2026 22:17
Comment thread .github/workflows/arm64-bench.yml Fixed
Comment thread .github/workflows/arm64-bench.yml Fixed
Comment thread .github/workflows/build-docker-image.yml Fixed
@@ -0,0 +1,88 @@
name: multiarch-build-workflow
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.

i made this a reusable workflow since many repos at sentry seem to need the same thing. might extract it later.

@lynnagara lynnagara marked this pull request as ready for review May 7, 2026 23:56
Comment on lines +47 to +57
# the assemble job stitches them into the multi-arch :sha and :latest.
# This is the same as Snuba's multiarch workflow.
tag_suffix: -${{ matrix.pair }}
ghcr: false
google_ar: true
google_ar_image_name: ${{ inputs.google_ar_image_name }}
google_workload_identity_provider: ${{ inputs.google_workload_identity_provider }}
google_service_account: ${{ inputs.google_service_account }}
# latest/nightly belong on the assembled manifest, not per-arch.
tag_latest: false
tag_nightly: false
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Bug: The build-arch job unconditionally pushes images to the production Google Artifact Registry on every PR run because google_ar: true is hardcoded, ignoring the inputs.push condition.
Severity: MEDIUM

Suggested Fix

Add a condition to the getsentry/action-build-and-push-images step within the build-arch job to respect the inputs.push input. For example, change google_ar: true to google_ar: ${{ inputs.push }}. This will ensure images are only pushed to the production registry when intended.

Prompt for AI Agent
Review the code at the location below. A potential bug has been identified by an AI
agent. Verify if this is a real issue. If it is, propose a fix; if not, explain why it's
not valid.

Location: .github/workflows/multiarch-build-workflow.yml#L42-L57

Potential issue: The `build-arch` job in the `multiarch-build-workflow.yml` workflow
unconditionally pushes per-architecture images to the production Google Artifact
Registry (GAR) on every pull request. The `getsentry/action-build-and-push-images` step
has `google_ar: true` hardcoded. While the workflow has an `inputs.push` parameter
intended to control this behavior, it is not used to gate the image push in the
`build-arch` job. This is a regression from the previous workflow, where pushing to GAR
was correctly conditioned on merges to the `main` branch, and will pollute the
production registry with intermediate images from every PR.

Did we get this right? 👍 / 👎 to inform future reviews.

# the assemble job stitches them into the multi-arch :sha and :latest.
# This is the same as Snuba's multiarch workflow.
tag_suffix: -${{ matrix.pair }}
ghcr: false
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.

Having GHCR images can be useful in sandboxes where we can't reach production images.

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.

The prod images are public. I've used it successfully in the sandbox here: https://github.com/getsentry/terraform-sandboxes.private/pull/427

@lynnagara lynnagara merged commit 54a11c6 into main May 8, 2026
17 checks passed
@lynnagara lynnagara deleted the devservices-multiarch branch May 8, 2026 17:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants