Skip to content

ci: add ARM64 cross-compilation and unit test workflow#2255

Open
tomassrnka wants to merge 4 commits intomainfrom
ci/arm64-tests
Open

ci: add ARM64 cross-compilation and unit test workflow#2255
tomassrnka wants to merge 4 commits intomainfrom
ci/arm64-tests

Conversation

@tomassrnka
Copy link
Copy Markdown
Member

@tomassrnka tomassrnka commented Mar 29, 2026

Summary

  • Add pr-tests-arm64.yml workflow with a cross-compile job (ubuntu-24.04, GOARCH=arm64) and a native ARM64 unit test matrix (ubuntu-24.04-arm) covering api, orchestrator, envd, shared, and db packages
  • Wire the new arm64-tests workflow into pull-request.yml as a required status check
  • Add setup-arm64-runner.sh bootstrap script for provisioning self-hosted ARM64 runners with Go, Docker, and dependencies

Part of #1875. This PR should be merged after the corresponding code PRs land (the workflow references packages that need ARM64-compatible build tags and test fixes).

Test plan

  • Verify pr-tests-arm64.yml triggers on PRs that modify Go files or workflow configs
  • Confirm the cross-compile job builds all five packages with GOARCH=arm64 on an x86 runner
  • Confirm the native ARM64 test matrix runs unit tests on ubuntu-24.04-arm runners
  • Verify pull-request.yml correctly gates on the new arm64-tests workflow
  • Review setup-arm64-runner.sh installs correct Go version and dependencies

🤖 Generated with Claude Code

@cursor
Copy link
Copy Markdown

cursor bot commented Mar 29, 2026

PR Summary

Medium Risk
Moderate risk because it adds a new required ARM64 CI gate and introduces host-level runner setup steps (sysctl/hugepages/nbd) that could cause flaky CI or misconfigured self-hosted runners if assumptions differ. The Go changes are small but touch concurrency/logging behavior in NBD handling and a timing-sensitive test.

Overview
Adds a new PR workflow that cross-compiles all Go packages for arm64 on x86 and runs an arm64 unit-test matrix on ARM runners (including extra setup for envd/orchestrator), and wires it into the main pull-request workflow as an additional check. Also introduces a bootstrap script for provisioning ARM64 self-hosted runners (KVM check, sysctls, hugepages, NBD module/udev rules, fd limits), fixes a goroutine closure capture issue in orchestrator NBD direct-path mounting, and makes the post-processor logging test safe for concurrent writes by using a mutex-protected buffer.

Written by Cursor Bugbot for commit fca173f. This will update automatically on new commits. Configure here.

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.

Autofix Details

Bugbot Autofix prepared a fix for the issue found in the latest run.

  • ✅ Fixed: Inconsistent checkout action version across workflows
    • Updated both occurrences of actions/checkout@v4 to actions/checkout@v5 in pr-tests-arm64.yml to match the version used in all other workflow files.

Create PR

Or push these changes by commenting:

@cursor push d5995dfe75
Preview (d5995dfe75)
diff --git a/.github/workflows/pr-tests-arm64.yml b/.github/workflows/pr-tests-arm64.yml
--- a/.github/workflows/pr-tests-arm64.yml
+++ b/.github/workflows/pr-tests-arm64.yml
@@ -11,7 +11,7 @@
     runs-on: ubuntu-24.04
     steps:
       - name: Checkout repository
-        uses: actions/checkout@v4
+        uses: actions/checkout@v5
 
       - name: Setup Go
         uses: ./.github/actions/go-setup-cache
@@ -67,7 +67,7 @@
       fail-fast: false
     steps:
       - name: Checkout repository
-        uses: actions/checkout@v4
+        uses: actions/checkout@v5
 
       - name: Setup Go
         uses: ./.github/actions/go-setup-cache

This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.

Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4b424a7b03

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Copy link
Copy Markdown

@claude claude bot left a comment

Choose a reason for hiding this comment

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

This PR adds ARM64 as a required status check using self-hosted runners — if those runners aren't provisioned before merging, all future PRs will be blocked; also worth confirming the prerequisite code PRs have landed as the description notes.

Extended reasoning...

Overview

Adds a new pr-tests-arm64.yml workflow (cross-compile on x86 + native ARM64 unit test matrix), wires it into pull-request.yml as a required check, and provides a setup-arm64-runner.sh bootstrap script. The one bug found is a nit: actions/checkout@v4 in the new workflow vs @v5 used everywhere else.

Security Risks

No security concerns — this is purely CI/CD infrastructure for testing purposes. The setup script runs as root on self-hosted runners (expected for provisioning).

Level of Scrutiny

Medium. The change is additive CI config, but adding arm64-tests as a required status check without path filters means it will gate every PR. If ubuntu-24.04-arm self-hosted runners are not reliably available, this will block all future PRs. The PR description explicitly states it should be merged after corresponding code PRs — that sequencing dependency deserves human verification.

Other Factors

The environment-specific setup (hugepages, nbd, userfaultfd) in the workflow steps can be flaky on GitHub-hosted ARM runners. The checkout@v4 nit is minor. The overall structure looks sound, but the operational risk of making a potentially-unavailable runner a merge gate is significant enough for a human to validate readiness.

@tomassrnka tomassrnka force-pushed the ci/arm64-tests branch 3 times, most recently from 1b0c14a to bbdd0fb Compare April 2, 2026 13:00
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.

e2b and others added 4 commits April 2, 2026 17:40
- Add pr-tests-arm64.yml with cross-compile job (ubuntu-24.04) and
  native ARM64 unit test matrix (ubuntu-24.04-arm)
- Wire arm64-tests into pull-request.yml
- Add setup-arm64-runner.sh for self-hosted runner provisioning

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Align with repo convention of actions/checkout@v5
- Add timeout-minutes: 15 to cross-compile job to prevent hangs

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- path_direct.go: capture deviceIndex before goroutine closure. The
  outer for-loop is not a range loop, so Go 1.22+ loop variable fix
  doesn't apply — deviceIndex is reassigned on each retry iteration.
- postprocessor_test.go: use sync.Mutex-wrapped buffer instead of bare
  bytes.Buffer. The PostProcessor goroutine and test goroutine write
  to the buffer concurrently.

Both races were exposed by running tests with -race on ARM64 (weaker
memory model makes races more likely to manifest).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Busybox binary is no longer committed to git (downloaded at build time
from fc-busybox release). Add fetch-busybox to:
- cross-compile job (with BUILD_ARCH=arm64 for correct binary)
- orchestrator ARM64 test setup

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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.

2 participants