Skip to content
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

CI: use Linux ARM runners. #2366

Merged
merged 4 commits into from
Jan 21, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 14 additions & 10 deletions .github/workflows/commit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -106,18 +106,22 @@ jobs:
run: bash <(curl -s https://codecov.io/bash)

test_scratch:
name: ${{ matrix.arch }}, Linux (scratch), Go-${{ matrix.go-version }}
runs-on: ubuntu-22.04
name: ${{ matrix.platform.arch }}, Linux (scratch), Go-${{ matrix.go-version }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false # don't fail fast as sometimes failures are arch/OS specific
matrix: # Use versions consistent with wazero's Go support policy.
go-version:
- "1.23" # Current Go version
- "1.21" # Floor Go version of wazero (current - 2)
arch:
- "amd64"
- "arm64"
- "riscv64"
platform:
- os: ubuntu-22.04
arch: amd64
- os: ubuntu-22.04-arm
arch: arm64
Copy link
Contributor

@anuraaga anuraaga Jan 21, 2025

Choose a reason for hiding this comment

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

Shouldn't we add to the normal test task too?

Another note is personally, running this for every arch seems like overkill. amd64 was added for #385, while arm64 was here because it required qemu. Now it doesn't require qemu, so I'm wondering if we need both amd64 and arm64 in this matrix.

Copy link
Member

Choose a reason for hiding this comment

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

yeah I would rather delete this for amd64 and arm64

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I used this because it's a “reduced” test suite compared to “full” (same way I used it for the VMs, although cross compilation helps there).

But I can drop this and run the full test suite on Linux ARM.

Or not at all (we stopped running any tests on macOS AMD64). I run a bunch of these other configurations (including BSD ARM) on my own repo, so it's not like it's untested.

Copy link
Member

Choose a reason for hiding this comment

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

so up to you but we want to reduce the CI costs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well at least for this run, scratch+AMD was faster than base+AMD (and scratch+ARM is faster still).

I dunno what's cheaper by the minute?

If we wanna reduce costs we can drop some of the targets I added, or move them to something we manually run (e.g. before a release).

If we make them manually triggered I can at least run them for free on a fork, that's easy enough to do.

- os: ubuntu-22.04
arch: riscv64
qemu: true

steps:

Expand All @@ -132,11 +136,11 @@ jobs:
go list -f '{{.Dir}}' ./... | egrep -v 'spectest' | xargs -Ipkg go test pkg -c -o pkg.test
go build -o wazerocli ./cmd/wazero
env:
GOARCH: ${{ matrix.arch }}
GOARCH: ${{ matrix.platform.arch }}
CGO_ENABLED: 0

- name: Set up QEMU
if: ${{ matrix.arch != 'amd64' }}
if: ${{ matrix.platform.qemu }}
uses: docker/setup-qemu-action@v3
with: # Avoid docker.io rate-limits; built with internal-images.yml
image: ghcr.io/tetratelabs/wazero/internal-binfmt
Expand All @@ -146,11 +150,11 @@ jobs:
run: |
echo 'FROM scratch' >> Dockerfile
echo 'CMD ["/test"]' >> Dockerfile
docker buildx build -t wazero:test --platform linux/${{ matrix.arch }} .
docker buildx build -t wazero:test --platform linux/${{ matrix.platform.arch }} .

- name: Run built test binaries
# This runs all tests compiled above in sequence. Note: This mounts /tmp to allow t.TempDir() in tests.
run: find . -name "*.test" | xargs -Itestbin docker run --platform linux/${{ matrix.arch }} -v $(pwd)/testbin:/test -v $(pwd)/wazerocli:/wazero -e WAZEROCLI=/wazero --tmpfs /tmp --rm -t wazero:test
run: find . -name "*.test" | xargs -Itestbin docker run --platform linux/${{ matrix.platform.arch }} -v $(pwd)/testbin:/test -v $(pwd)/wazerocli:/wazero -e WAZEROCLI=/wazero --tmpfs /tmp --rm -t wazero:test

test_bsd:
name: amd64, ${{ matrix.os.name }}
Expand Down
Loading