-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #85 from mantidproject/0_add_self_hosted_runner
Use self hosted github runner
- Loading branch information
Showing
10 changed files
with
90 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,7 +4,7 @@ on: push | |
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
runs-on: self-hosted | ||
defaults: | ||
run: | ||
shell: bash -l {0} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[defaults] | ||
remote_user=ubuntu |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
- name: Deploy self-hosted github runner for vesuvio repository | ||
hosts: all | ||
vars: | ||
package_updates_reboot: true # dannixon.system.package_updates | ||
|
||
roles: | ||
- role: dannixon.system.package_updates | ||
tags: "initial-setup" | ||
- role: dannixon.system.interactive_users | ||
tags: "initial-setup" | ||
- role: geerlingguy.docker | ||
become: yes | ||
tags: "initial-setup" | ||
- role: host | ||
become: yes | ||
tags: runner | ||
- role: runner | ||
become: yes | ||
tags: runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
[all] | ||
172.16.110.198 runner_name=vesuvio-runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
- name: Remove docker image | ||
community.docker.docker_image: | ||
state: absent | ||
force_absent: true | ||
name: vesuvio-runner |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
- name: Copy setup script to host | ||
copy: | ||
src: setup/setup.sh | ||
dest: /tmp/setup.sh | ||
mode: '0755' | ||
|
||
- name: Copy dockerfile to host | ||
copy: | ||
src: ../docker/runner.Dockerfile | ||
dest: /tmp/runner.Dockerfile | ||
mode: '0755' | ||
notify: | ||
- Remove docker image | ||
|
||
- meta: flush_handlers |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
- name: Build docker image | ||
community.docker.docker_image: | ||
build: | ||
path: /tmp/ | ||
dockerfile: runner.Dockerfile | ||
name: vesuvio-runner | ||
source: build | ||
|
||
- name: Deploy dockerized github runner | ||
community.docker.docker_container: | ||
name: "{{ runner_name }}" | ||
image: vesuvio-runner | ||
detach: yes | ||
init: yes | ||
network_mode: host | ||
recreate: yes | ||
pull: no | ||
shm_size: 512M | ||
volumes: | ||
- /tmp/setup.sh:/home/setup.sh | ||
command: /home/setup.sh | ||
user: nonroot | ||
|
||
- name: Remove setup script | ||
ansible.builtin.file: | ||
path: /tmp/setup.sh | ||
state: absent |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /bin/bash | ||
set -ex | ||
mkdir /home/nonroot/actions-runner && cd /home/nonroot/actions-runner | ||
curl -o actions-runner-linux-x64-2.311.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.311.0/actions-runner-linux-x64-2.311.0.tar.gz | ||
tar xzf ./actions-runner-linux-x64-2.311.0.tar.gz | ||
./config.sh --url https://github.com/mantidproject/vesuvio --token AWZQ65WBHOW75IEIVFMRX63FP6IBQ | ||
./run.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
FROM ubuntu:focal-20231128 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
curl \ | ||
tar \ | ||
apt-transport-https \ | ||
libicu66 \ | ||
libglu1-mesa \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
RUN useradd -m nonroot |