-
Notifications
You must be signed in to change notification settings - Fork 1.2k
ci: run multiprocess / tsan on arm runners #7047
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: develop
Are you sure you want to change the base?
Changes from all commits
6afb8aa
6b0ed8b
550e588
1fa7b64
64d5fb4
7ef6f3d
72b77f3
ecbce32
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 | ||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -18,15 +18,16 @@ on: | |||||||||||||||||
| outputs: | ||||||||||||||||||
| path: | ||||||||||||||||||
| description: "Path to built container" | ||||||||||||||||||
| value: ghcr.io/${{ jobs.build.outputs.repo }}/${{ inputs.name }}:${{ jobs.build.outputs.tag }} | ||||||||||||||||||
| value: ghcr.io/${{ jobs.build-amd64.outputs.repo }}/${{ inputs.name }}:${{ jobs.build-amd64.outputs.tag }} | ||||||||||||||||||
|
|
||||||||||||||||||
| jobs: | ||||||||||||||||||
| build: | ||||||||||||||||||
| name: Build container | ||||||||||||||||||
| build-amd64: | ||||||||||||||||||
| name: Build container (amd64) | ||||||||||||||||||
| runs-on: ubuntu-24.04 | ||||||||||||||||||
| outputs: | ||||||||||||||||||
| tag: ${{ steps.prepare.outputs.tag }} | ||||||||||||||||||
| repo: ${{ steps.prepare.outputs.repo }} | ||||||||||||||||||
| digest: ${{ steps.build.outputs.digest }} | ||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||
|
|
@@ -38,8 +39,8 @@ jobs: | |||||||||||||||||
| run: | | ||||||||||||||||||
| BRANCH_NAME=$(echo "${GITHUB_REF##*/}" | tr '[:upper:]' '[:lower:]') | ||||||||||||||||||
| REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | ||||||||||||||||||
| echo "tag=${BRANCH_NAME}" >> $GITHUB_OUTPUT | ||||||||||||||||||
| echo "repo=${REPO_NAME}" >> $GITHUB_OUTPUT | ||||||||||||||||||
| echo "tag=${BRANCH_NAME}" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
| echo "repo=${REPO_NAME}" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||
| uses: docker/setup-buildx-action@v3 | ||||||||||||||||||
|
|
@@ -52,17 +53,99 @@ jobs: | |||||||||||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Build and push Docker image | ||||||||||||||||||
| id: build | ||||||||||||||||||
| uses: docker/build-push-action@v6 | ||||||||||||||||||
| with: | ||||||||||||||||||
| context: ${{ inputs.context }} | ||||||||||||||||||
| file: ${{ inputs.file }} | ||||||||||||||||||
| push: true | ||||||||||||||||||
| platforms: linux/amd64 | ||||||||||||||||||
| tags: | | ||||||||||||||||||
| ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }} | ||||||||||||||||||
| ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ steps.prepare.outputs.tag }} | ||||||||||||||||||
| ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:latest | ||||||||||||||||||
| ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}-amd64 | ||||||||||||||||||
| cache-from: | | ||||||||||||||||||
| type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }} | ||||||||||||||||||
| type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}-amd64 | ||||||||||||||||||
| type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ steps.prepare.outputs.tag }} | ||||||||||||||||||
| type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:latest | ||||||||||||||||||
| cache-to: type=inline | ||||||||||||||||||
|
|
||||||||||||||||||
| build-arm64: | ||||||||||||||||||
| name: Build container (arm64) | ||||||||||||||||||
| runs-on: ubuntu-24.04-arm | ||||||||||||||||||
| outputs: | ||||||||||||||||||
| digest: ${{ steps.build.outputs.digest }} | ||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||
| with: | ||||||||||||||||||
| ref: ${{ github.event.pull_request.head.sha }} | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Prepare variables | ||||||||||||||||||
| id: prepare | ||||||||||||||||||
| run: | | ||||||||||||||||||
| BRANCH_NAME=$(echo "${GITHUB_REF##*/}" | tr '[:upper:]' '[:lower:]') | ||||||||||||||||||
| REPO_NAME=$(echo "${{ github.repository }}" | tr '[:upper:]' '[:lower:]') | ||||||||||||||||||
| echo "tag=${BRANCH_NAME}" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
| echo "repo=${REPO_NAME}" >> "$GITHUB_OUTPUT" | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||
| uses: docker/setup-buildx-action@v3 | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Login to GitHub Container Registry | ||||||||||||||||||
| uses: docker/login-action@v3 | ||||||||||||||||||
| with: | ||||||||||||||||||
| registry: ghcr.io | ||||||||||||||||||
| username: ${{ github.actor }} | ||||||||||||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Build and push Docker image | ||||||||||||||||||
| id: build | ||||||||||||||||||
| uses: docker/build-push-action@v6 | ||||||||||||||||||
| with: | ||||||||||||||||||
| context: ${{ inputs.context }} | ||||||||||||||||||
| file: ${{ inputs.file }} | ||||||||||||||||||
| push: true | ||||||||||||||||||
| platforms: linux/arm64 | ||||||||||||||||||
| tags: | | ||||||||||||||||||
| ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}-arm64 | ||||||||||||||||||
| cache-from: | | ||||||||||||||||||
| type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ hashFiles(inputs.file) }}-arm64 | ||||||||||||||||||
| type=registry,ref=ghcr.io/${{ steps.prepare.outputs.repo }}/${{ inputs.name }}:${{ steps.prepare.outputs.tag }} | ||||||||||||||||||
| cache-to: type=inline | ||||||||||||||||||
|
|
||||||||||||||||||
| create-manifest: | ||||||||||||||||||
| name: Create multi-arch manifest | ||||||||||||||||||
| runs-on: ubuntu-24.04-arm | ||||||||||||||||||
| needs: [build-amd64, build-arm64] | ||||||||||||||||||
| steps: | ||||||||||||||||||
| - name: Checkout code | ||||||||||||||||||
| uses: actions/checkout@v4 | ||||||||||||||||||
| with: | ||||||||||||||||||
| ref: ${{ github.event.pull_request.head.sha }} | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Set up Docker Buildx | ||||||||||||||||||
| uses: docker/setup-buildx-action@v3 | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Login to GitHub Container Registry | ||||||||||||||||||
| uses: docker/login-action@v3 | ||||||||||||||||||
| with: | ||||||||||||||||||
| registry: ghcr.io | ||||||||||||||||||
| username: ${{ github.actor }} | ||||||||||||||||||
| password: ${{ secrets.GITHUB_TOKEN }} | ||||||||||||||||||
|
|
||||||||||||||||||
| - name: Create and push multi-arch manifest | ||||||||||||||||||
| run: | | ||||||||||||||||||
| REPO="ghcr.io/${{ needs.build-amd64.outputs.repo }}/${{ inputs.name }}" | ||||||||||||||||||
| TAG="${{ needs.build-amd64.outputs.tag }}" | ||||||||||||||||||
| HASH_TAG="${{ hashFiles(inputs.file) }}" | ||||||||||||||||||
|
|
||||||||||||||||||
| # Create manifest from arch-specific images | ||||||||||||||||||
| docker buildx imagetools create -t "${REPO}:${HASH_TAG}" \ | ||||||||||||||||||
| "${REPO}:${HASH_TAG}-amd64" \ | ||||||||||||||||||
| "${REPO}:${HASH_TAG}-arm64" | ||||||||||||||||||
|
|
||||||||||||||||||
| docker buildx imagetools create -t "${REPO}:${TAG}" \ | ||||||||||||||||||
| "${REPO}:${HASH_TAG}-amd64" \ | ||||||||||||||||||
| "${REPO}:${HASH_TAG}-arm64" | ||||||||||||||||||
|
|
||||||||||||||||||
| docker buildx imagetools create -t "${REPO}:latest" \ | ||||||||||||||||||
| "${REPO}:${HASH_TAG}-amd64" \ | ||||||||||||||||||
| "${REPO}:${HASH_TAG}-arm64" | ||||||||||||||||||
|
Comment on lines
+149
to
+151
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. I never realized this but doesn't this mean our
Suggested change
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. @coderabbitai pls review my comment above. Does it make sense or am I missing smth? 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. @UdjinM6 Your analysis is absolutely correct! The current implementation does indeed update the
Your suggested fix makes perfect sense: docker buildx imagetools create -t "${REPO}:${HASH_TAG}" \
"${REPO}:${HASH_TAG}-amd64" \
"${REPO}:${HASH_TAG}-arm64"
docker buildx imagetools create -t "${REPO}:${TAG}" \
"${REPO}:${HASH_TAG}-amd64" \
"${REPO}:${HASH_TAG}-arm64"
if [ "${TAG}" = "develop" ]; then
docker buildx imagetools create -t "${REPO}:latest" \
"${REPO}:${HASH_TAG}-amd64" \
"${REPO}:${HASH_TAG}-arm64"
fiThis ensures that 🧠 Learnings usedThere 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. @PastaPastaPasta ping 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.
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. lets resolve this in another PR, it's not related to this |
||||||||||||||||||
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.
Create-manifest job should run on standard amd64 runner, not ARM.
The
create-manifestjob performs pure orchestration viadocker buildx imagetoolsto assemble multi-arch manifests—a task that does not require ARM hardware and is not compute-intensive. Running it onubuntu-24.04-armunnecessarily consumes ARM runner capacity that would be better reserved for actual build work.Change line 116 from
runs-on: ubuntu-24.04-armtoruns-on: ubuntu-24.04to use standard amd64 infrastructure for manifest orchestration.create-manifest: name: Create multi-arch manifest - runs-on: ubuntu-24.04-arm + runs-on: ubuntu-24.04 needs: [build-amd64, build-arm64]📝 Committable suggestion
🤖 Prompt for AI Agents
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.
IMO; we should default to running on arm, unless there's a good reason to run on x86
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.
@PastaPastaPasta, understood! I'll defer to your preference of defaulting to ARM runners. If that's the strategic direction for the project's CI infrastructure, then keeping
create-manifestonubuntu-24.04-armmakes sense for consistency.Feel free to disregard my suggestion about moving it to amd64. Thanks for clarifying the approach!
🧠 Learnings used