2022-03-22 11:03:15 -04:00
|
|
|
#cloud-config
|
|
|
|
|
|
|
|
users:
|
|
|
|
- default
|
|
|
|
- name: github-actions-runner-user
|
|
|
|
groups: docker
|
|
|
|
sudo: ALL=(ALL) NOPASSWD:ALL
|
2022-09-15 03:37:16 -04:00
|
|
|
homedir: /home/github-actions-runner-user
|
2022-03-22 11:03:15 -04:00
|
|
|
|
|
|
|
package_update: true
|
|
|
|
packages:
|
|
|
|
- git
|
|
|
|
- cryptsetup
|
|
|
|
- build-essential
|
|
|
|
- libguestfs-tools
|
|
|
|
- ca-certificates
|
|
|
|
- curl
|
|
|
|
- gnupg
|
|
|
|
- lsb-release
|
|
|
|
- jq
|
|
|
|
- pv
|
|
|
|
|
|
|
|
runcmd:
|
|
|
|
- [sudo, chmod, "+r", "/boot/vmlinuz*"]
|
|
|
|
- [/bin/bash, -c, "curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg"]
|
|
|
|
- [/bin/bash, -c, "echo \"deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable\" | tee /etc/apt/sources.list.d/docker.list > /dev/null "]
|
|
|
|
- [apt-get, update]
|
2022-09-15 03:37:16 -04:00
|
|
|
- [apt-get, install, -y, docker-ce, docker-ce-cli, containerd.io, libssl-dev, pigz]
|
2022-03-22 11:03:15 -04:00
|
|
|
- [chmod, 666, /dev/kvm]
|
|
|
|
- [mkdir, -p, /actions-runner]
|
|
|
|
- [curl, -o, "/actions-runner/actions-runner-linux-x64-2.286.1.tar.gz", -L, "https://github.com/actions/runner/releases/download/v2.286.1/actions-runner-linux-x64-2.286.1.tar.gz"]
|
|
|
|
- [/bin/bash, -c, "cd /actions-runner && tar xzf /actions-runner/actions-runner-linux-x64-2.286.1.tar.gz"]
|
2022-09-15 03:37:16 -04:00
|
|
|
- [sed, -i, "s:# insert anything to setup env when running as a service:export HOME=/home/github-actions-runner-user:", runsvc.sh]
|
2022-03-22 11:03:15 -04:00
|
|
|
- [chown, -R, github-actions-runner-user:github-actions-runner-user, /actions-runner]
|
2022-09-15 03:37:16 -04:00
|
|
|
- [sudo, -u, github-actions-runner-user, /bin/bash, -c, "cd /actions-runner && /actions-runner/config.sh --url https://github.com/edgelesssys/constellation --ephemeral --labels nested-virt --replace --unattended --token $(curl -u api:$(gcloud secrets versions access latest --secret=constellation-images-coreos-builder-github-token) -X POST -H 'Accept: application/vnd.github.v3+json' https://api.github.com/repos/edgelesssys/constellation/actions/runners/registration-token | jq -r .token)"]
|
2022-03-22 11:03:15 -04:00
|
|
|
- [/bin/bash, -c, "cd /actions-runner && ./svc.sh install"]
|
2022-04-04 08:02:53 -04:00
|
|
|
- [/bin/bash, -c, "systemctl enable --now actions.runner.edgelesssys-constellation.$(hostname).service"]
|