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

Enable arm64 runner #601

Merged
merged 1 commit into from
Nov 8, 2023
Merged

Conversation

ivanvc
Copy link
Member

@ivanvc ivanvc commented Nov 7, 2023

Enable tests to run on the ARM64 runner. Fixes #583.

@serathius
Copy link
Member

Please sign a DCO

@ahrtr
Copy link
Member

ahrtr commented Nov 8, 2023

It's almost identical to the existing workflow running on ubuntu-latest. Let's create a template to be shared by both of them. This can be addressed in a followup PR. Thanks.

name: Tests
on: [push, pull_request]
jobs:
test-linux:
strategy:
fail-fast: false
matrix:
target:
- linux-amd64-unit-test-1-cpu
- linux-amd64-unit-test-2-cpu
- linux-amd64-unit-test-4-cpu
- linux-amd64-unit-test-4-cpu-race
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21.1"
- run: make fmt
- env:
TARGET: ${{ matrix.target }}
run: |
case "${TARGET}" in
linux-amd64-unit-test-1-cpu)
CPU=1 make test
;;
linux-amd64-unit-test-2-cpu)
CPU=2 make test
;;
linux-amd64-unit-test-4-cpu)
CPU=4 make test
;;
linux-amd64-unit-test-4-cpu-race)
# XXX: By default, the Github Action runner will terminate the process
# if it has high resource usage. Try to use GOGC to limit memory and
# cpu usage here to prevent unexpected terminating. It can be replaced
# with GOMEMLIMIT=2048MiB if the go-version is updated to >=1.19.x.
#
# REF: https://github.com/actions/runner-images/issues/6680#issuecomment-1335778010
GOGC=30 CPU=4 ENABLE_RACE=true make test
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0

@Elbehery
Copy link
Member

Elbehery commented Nov 8, 2023

It's almost identical to the existing workflow running on ubuntu-latest. Let's create a template to be shared by both of them. This can be addressed in a followup PR. Thanks.

name: Tests
on: [push, pull_request]
jobs:
test-linux:
strategy:
fail-fast: false
matrix:
target:
- linux-amd64-unit-test-1-cpu
- linux-amd64-unit-test-2-cpu
- linux-amd64-unit-test-4-cpu
- linux-amd64-unit-test-4-cpu-race
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
with:
go-version: "1.21.1"
- run: make fmt
- env:
TARGET: ${{ matrix.target }}
run: |
case "${TARGET}" in
linux-amd64-unit-test-1-cpu)
CPU=1 make test
;;
linux-amd64-unit-test-2-cpu)
CPU=2 make test
;;
linux-amd64-unit-test-4-cpu)
CPU=4 make test
;;
linux-amd64-unit-test-4-cpu-race)
# XXX: By default, the Github Action runner will terminate the process
# if it has high resource usage. Try to use GOGC to limit memory and
# cpu usage here to prevent unexpected terminating. It can be replaced
# with GOMEMLIMIT=2048MiB if the go-version is updated to >=1.19.x.
#
# REF: https://github.com/actions/runner-images/issues/6680#issuecomment-1335778010
GOGC=30 CPU=4 ENABLE_RACE=true make test
;;
*)
echo "Failed to find target"
exit 1
;;
esac
- name: golangci-lint
uses: golangci/golangci-lint-action@3a919529898de77ec3da873e3063ca4b10e7f5cc # v3.7.0

i can create the template @ahrtr

@ahrtr
Copy link
Member

ahrtr commented Nov 8, 2023

i can create the template @ahrtr

Sure, after this PR is merged (but it shouldn't block you work/investigate it for now. FYI. there is some examples under etcd workflow ). Please raise a followup ticket.

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

Hey @ivanvc - Thanks for raising this, looks like a great start.

As mentioned above you just need to sign off your commit so the developer certificate of origin (DCO) check passes.

To do this you can run something like:

git reset --soft HEAD~1
git commit -s -a -m "Enable arm64 runner"
git push --force

Signed-off-by: Ivan Valdes <ivan@vald.es>
@ivanvc
Copy link
Member Author

ivanvc commented Nov 8, 2023

Hey @jmhbnz, I just did it :)

Copy link
Member

@jmhbnz jmhbnz left a comment

Choose a reason for hiding this comment

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

LGTM - Thanks @ivanvc!

Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

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

LGTM

Thanks.

@ahrtr ahrtr merged commit 2b3dc46 into etcd-io:master Nov 8, 2023
13 checks passed
@ivanvc ivanvc deleted the setup-workflow-on-arm64 branch November 8, 2023 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Setup workflow running on arm64
5 participants