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

Arm64 builds #10702

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
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
21 changes: 18 additions & 3 deletions .github/workflows/build-k3s.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@ name: Build K3s
on:
workflow_call:
inputs:
arch:
type: string
description: 'Architecture to build'
default: 'ubuntu-latest'
upload-repo:
type: boolean
required: false
Expand All @@ -18,11 +22,16 @@ permissions:
jobs:
build:
name: Build
runs-on: ubuntu-latest
runs-on: ${{ inputs.arch }} # defaults to ubuntu-latest, for arm64 use oracle-aarch64-4cpu-16gb
timeout-minutes: 20
steps:
- name: Checkout K3s
uses: actions/checkout@v4
- name: Setup Arm64 Runner
if: contains(inputs.arch, 'aarch64')
run: |
sudo apt-get update
sudo apt-get install -y make
- name: Build K3s binary
run: |
DOCKER_BUILDKIT=1 SKIP_IMAGE=1 SKIP_AIRGAP=1 SKIP_VALIDATE=1 GOCOVER=1 make
Expand All @@ -44,9 +53,15 @@ jobs:
- name: "Save K3s image"
if: inputs.upload-image == true
run: docker image save rancher/k3s -o ./dist/artifacts/k3s-image.tar
- name: "Upload K3s binary"
if: inputs.upload-repo == false
- name: "Upload K3s Artifacts"
if: inputs.upload-repo == false && inputs.arch == 'ubuntu-latest'
uses: actions/upload-artifact@v4
with:
name: k3s
path: dist/artifacts/k3s*
- name: "Upload K3s Arm64 Artifacts"
if: contains(inputs.arch, 'aarch64')
uses: actions/upload-artifact@v4
with:
name: k3s-arm64
path: dist/artifacts/k3s*
54 changes: 54 additions & 0 deletions .github/workflows/e2e.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ jobs:
uses: ./.github/workflows/build-k3s.yaml
with:
upload-image: true
build-arm64:
if : github.repository == 'k3s-io/k3s'
uses: ./.github/workflows/build-k3s.yaml
with:
arch: oracle-aarch64-4cpu-16gb
upload-image: true
e2e:
name: "E2E Tests"
needs: build
Expand Down Expand Up @@ -119,3 +125,51 @@ jobs:
. ./tests/docker/test-helpers
. ./tests/docker/test-run-${{ matrix.dtest }}
echo "Did test-run-${{ matrix.dtest }} pass $?"
docker-arm64:
needs: build-arm64
name: Docker Tests Arm64
if: github.repository == 'k3s-io/k3s'
runs-on: oracle-aarch64-4cpu-16gb
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
dtest: [basics, bootstraptoken, cacerts, compat, upgrade]
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
- name: Install Go
uses: actions/setup-go@v5
with:
go-version-file: 'go.mod'
cache: false
- name: Install Support Tools
run: |
sudo apt-get update && sudo apt-get install -y wget gawk openssh-client openssh-server net-tools iptables
sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_arm64 -O /usr/bin/yq &&\
sudo chmod +x /usr/bin/yq
curl -LO "https://dl.k8s.io/release/$(curl -L -s https://dl.k8s.io/release/stable.txt)/bin/linux/arm64/kubectl"
sudo install -o root -g root -m 0755 kubectl /usr/local/bin/kubectl
- name: "Download k3s image"
uses: actions/download-artifact@v4
with:
name: k3s-arm64
path: ./dist/artifacts
- name: Load k3s image
run: docker image load -i ./dist/artifacts/k3s-image.tar
- name: Run ${{ matrix.dtest }} Test
run: |
mv ./dist/artifacts/k3s-arm64 ./dist/artifacts/k3s
chmod +x ./dist/artifacts/k3s
. ./scripts/version.sh
. ./tests/docker/test-helpers
. ./tests/docker/test-run-${{ matrix.dtest }}
echo "Did test-run-${{ matrix.dtest }} pass $?"
- name: On Failure, Launch Debug Session
uses: dereknola/[email protected]
if: ${{ failure() }}
with:
## If no one connects after 5 minutes, shut down server.
wait-timeout-minutes: 5
5 changes: 5 additions & 0 deletions tests/docker/test-run-basics
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,11 @@ export NUM_SERVERS=1
export NUM_AGENTS=1
export WAIT_SERVICES="${all_services[@]}"

if [ "$(uname -i)" = "aarch64" ]; then
export SERVER_ARGS="--snapshotter=native"
export AGENT_ARGS="--snapshotter=native"
fi

start-test() {
use-local-storage-volume
docker exec $(cat $TEST_DIR/servers/1/metadata/name) check-config || true
Expand Down
Loading