From ad4670b171569b16f47a8ab5761971c348d31e3d Mon Sep 17 00:00:00 2001 From: Ayaz Salikhov Date: Mon, 4 Jul 2022 20:44:12 +0400 Subject: [PATCH] Add docs to setup aarch64 runner --- aarch64-runner/setup.sh | 23 +++++++++++++++++++++++ docs/index.rst | 1 + docs/maintaining/aarch64-runner.md | 11 +++++++++++ 3 files changed, 35 insertions(+) create mode 100755 aarch64-runner/setup.sh create mode 100644 docs/maintaining/aarch64-runner.md diff --git a/aarch64-runner/setup.sh b/aarch64-runner/setup.sh new file mode 100755 index 00000000..7aa09c05 --- /dev/null +++ b/aarch64-runner/setup.sh @@ -0,0 +1,23 @@ +#!/bin/bash -e + +GITHUB_RUNNER_USER="runner-user" + +if [ "$EUID" -ne 0 ]; then + echo "Please run as root" + exit 1 +fi + +apt-get update --yes +apt-get upgrade --yes + +echo "Creating runner-user, who will run GitHub Actions runner" +adduser --disabled-password --gecos "" ${GITHUB_RUNNER_USER} + +echo "Setting up python3" +apt-get install --yes --no-install-recommends python3 +curl -sS https://bootstrap.pypa.io/get-pip.py | python3 + +echo "Setting up docker" +apt-get install --yes --no-install-recommends docker.io +usermod -aG docker ${GITHUB_RUNNER_USER} +chmod 666 /var/run/docker.sock diff --git a/docs/index.rst b/docs/index.rst index 7c3e9e03..54ddb166 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -31,6 +31,7 @@ Table of Contents :maxdepth: 2 :caption: Maintainer Guide + maintaining/aarch64-runner maintaining/tasks .. toctree:: diff --git a/docs/maintaining/aarch64-runner.md b/docs/maintaining/aarch64-runner.md new file mode 100644 index 00000000..2de18866 --- /dev/null +++ b/docs/maintaining/aarch64-runner.md @@ -0,0 +1,11 @@ +# Creating aarch64 self-hosted GitHub runner + +For `aarch64` runners, we have self-hosted VMs, provided by [Oracle OCI](https://www.oracle.com/cloud/). + +To setup new runner, please: + +1. Create an Oracle `VM.Standard.A1.Flex` with `1 OCPU` and `4 GB` using `Ubuntu 22.04` image. +2. Run: `/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/mathbunnyru/docker-stacks/asalikhov/new_build_system/aarch64-runner/setup.sh)"` + This will perform initial runner setup and create a non-root user `runner-user`. +3. Setup new GitHub Runner with this user: +4. Run under `root` user in Runner directory: `./svc.sh install runner-user`