From 3266e81d74e09bbeb2f04beb569813bd9c2f8e8f Mon Sep 17 00:00:00 2001 From: Jusong Yu Date: Fri, 8 Sep 2023 16:23:51 +0200 Subject: [PATCH] runner setup --- aarch64-runner/setup.sh | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 aarch64-runner/setup.sh diff --git a/aarch64-runner/setup.sh b/aarch64-runner/setup.sh new file mode 100644 index 00000000..a31847df --- /dev/null +++ b/aarch64-runner/setup.sh @@ -0,0 +1,29 @@ +#!/bin/bash +set -ex + +GITHUB_RUNNER_USER="runner-user" + +if [ "$EUID" -ne 0 ]; then + echo "Please run as root" + exit 1 +fi + +# Install homebrew +/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install.sh)" + + +echo "Setting up runner-user, who will run GitHub Actions runner" +adduser --disabled-password --gecos "" ${GITHUB_RUNNER_USER} +mkdir /home/${GITHUB_RUNNER_USER}/.ssh/ +cp "/home/${SUDO_USER}/.ssh/authorized_keys" "/home/${GITHUB_RUNNER_USER}/.ssh/authorized_keys" +chown --recursive ${GITHUB_RUNNER_USER}:${GITHUB_RUNNER_USER} /home/${GITHUB_RUNNER_USER}/.ssh + +echo "Setting up python3" +brew install python3 +curl -sS https://bootstrap.pypa.io/get-pip.py | python3 + +echo "Setting up docker" +brew install docker + +usermod -aG docker ${GITHUB_RUNNER_USER} +chmod 666 /var/run/docker.sock