From 5ba29191abc77615246dad8921ba6aa996c6a938 Mon Sep 17 00:00:00 2001 From: Gyuho Lee Date: Sat, 8 May 2021 01:51:31 -0700 Subject: [PATCH] github action: README for self-hosted-linux-arm64-graviton2-tests.yml Signed-off-by: Gyuho Lee --- ...elf-hosted-linux-arm64-graviton2-tests.yml | 27 ++-- ...-hosted-linux-arm64-graviton2-tests.yml.md | 136 ++++++++++++++++++ scripts/update_dep.sh | 2 +- 3 files changed, 151 insertions(+), 14 deletions(-) create mode 100644 .github/workflows/self-hosted-linux-arm64-graviton2-tests.yml.md diff --git a/.github/workflows/self-hosted-linux-arm64-graviton2-tests.yml b/.github/workflows/self-hosted-linux-arm64-graviton2-tests.yml index d695e2a2688c..226ca546c9e7 100644 --- a/.github/workflows/self-hosted-linux-arm64-graviton2-tests.yml +++ b/.github/workflows/self-hosted-linux-arm64-graviton2-tests.yml @@ -2,22 +2,23 @@ name: Linux ARM64 Graviton2 on: push: - branches: [ master ] + branches: [master] pull_request: - branches: [ master ] + branches: [master] jobs: test: runs-on: [self-hosted, linux, ARM64, graviton2] steps: - - uses: actions/checkout@v2 - - name: install git gcc - run: | - sudo yum install -y git gcc - - uses: actions/setup-go@v2 - with: - go-version: '^1.16.4' - - run: go version - - run: date - - name: Run tests - run: TEST_OPTS="PASSES='fmt build unit integration_e2e'" make test + - uses: actions/checkout@v2 + - name: install dependencies + run: | + sudo amazon-linux-extras install epel + sudo yum install -y git gcc ShellCheck + - uses: actions/setup-go@v2 + with: + go-version: "^1.16.4" + - run: go version + - run: date + - name: Run tests + run: TEST_OPTS="PASSES='fmt bom dep build unit integration_e2e'" make test diff --git a/.github/workflows/self-hosted-linux-arm64-graviton2-tests.yml.md b/.github/workflows/self-hosted-linux-arm64-graviton2-tests.yml.md new file mode 100644 index 000000000000..e2ae22b92100 --- /dev/null +++ b/.github/workflows/self-hosted-linux-arm64-graviton2-tests.yml.md @@ -0,0 +1,136 @@ + +## Graviton-based self-hosted github action worker + +### Step 1. Create an EC2 instance with Graviton + +Create an AWS Graviton-based EC2 instance. For example, + +``` +# or download from https://github.com/aws/aws-k8s-tester/releases +cd ${HOME}/go/src/github.com/aws/aws-k8s-tester +go install -v ./cmd/ec2-utils + +# create arm64 AL2 instance +AWS_K8S_TESTER_EC2_ON_FAILURE_DELETE=true \ +AWS_K8S_TESTER_EC2_LOG_COLOR=true \ +AWS_K8S_TESTER_EC2_REGION=us-west-2 \ +AWS_K8S_TESTER_EC2_S3_BUCKET_CREATE=true \ +AWS_K8S_TESTER_EC2_S3_BUCKET_CREATE_KEEP=true \ +AWS_K8S_TESTER_EC2_REMOTE_ACCESS_KEY_CREATE=true \ +AWS_K8S_TESTER_EC2_ASGS_FETCH_LOGS=false \ +AWS_K8S_TESTER_EC2_ASGS='{"GetRef.Name-arm64-al2-cpu":{"name":"GetRef.Name-arm64-al2-cpu","remote-access-user-name":"ec2-user","ami-type":"AL2_arm_64","image-id-ssm-parameter":"/aws/service/ami-amazon-linux-latest/amzn2-ami-hvm-arm64-gp2","instance-types":["m6g.xlarge"],"volume-size":40,"asg-min-size":1,"asg-max-size":1,"asg-desired-capacity":1}}' \ +AWS_K8S_TESTER_EC2_ROLE_CREATE=true \ +AWS_K8S_TESTER_EC2_VPC_CREATE=true \ +ec2-utils create instances --enable-prompt=true --auto-path +``` + +### Step 2. Install github action on the host + +SSH into the instance, and install the github action self-hosted runner (see [install scripts](https://github.com/etcd-io/etcd/settings/actions/runners/new?arch=arm64&os=linux)). + +### Step 3. Configure github action on the host + +SSH into the instance, and configure the github action self-hosted runner. + +First, we need disable ICU install (see [actions/runner issue on ARM64](https://github.com/actions/runner/issues/629)): + +``` +sudo yum install -y patch +``` + +And write this bash script: + +``` +#!/bin/bash -e + +patch -p1 <