From 4e47d8ccf01edae79c7b25e01052bfe6b5572678 Mon Sep 17 00:00:00 2001 From: Matyas Selmeci Date: Tue, 10 Oct 2023 09:52:15 -0500 Subject: [PATCH 1/2] Copy alma_9 image to gh_runner and add it to the various variables for installing and building images --- Makefile | 3 ++- gh_runner/kickstart.ks | 47 ++++++++++++++++++++++++++++++++++++++++++ gh_runner/vars.json | 7 +++++++ vmu-rebuild-all | 3 ++- 4 files changed, 58 insertions(+), 2 deletions(-) create mode 100644 gh_runner/kickstart.ks create mode 100644 gh_runner/vars.json diff --git a/Makefile b/Makefile index 2847721..aa03a22 100755 --- a/Makefile +++ b/Makefile @@ -7,7 +7,8 @@ DATADIR := /usr/share/$(NAME) BINDIR := /usr/bin ETCDIR := /etc TEMPLATES := centos_7 centos_8 centos_stream_8 sl_7 rocky_8 alma_8 \ - centos_stream_9 rocky_9 alma_9 + centos_stream_9 rocky_9 alma_9 \ + gh_runner SHELL:=bash diff --git a/gh_runner/kickstart.ks b/gh_runner/kickstart.ks new file mode 100644 index 0000000..8bd4089 --- /dev/null +++ b/gh_runner/kickstart.ks @@ -0,0 +1,47 @@ +#auth --enableshadow --passalgo=sha512 --kickstart +autopart --type=lvm --fstype=ext4 +bootloader --location=mbr --timeout=1 --append="console=tty0 console=ttyS0,115200" +cdrom +clearpart --all --initlabel +eula --agreed +firewall --disabled +firstboot --disabled +keyboard us +lang en_US.UTF-8 +network --bootproto dhcp +reboot +rootpw --iscrypted $1$22074107$h/Rm55DAZ37/ZhaVMPmFP/ +selinux --permissive +services --enabled=NetworkManager,sshd +skipx +text +timezone --utc America/Chicago +timesource --ntp-server ntp1.cs.wisc.edu +timesource --ntp-server ntp2.cs.wisc.edu +timesource --ntp-server ntp3.cs.wisc.edu +zerombr + +%packages --inst-langs=en_US.utf8 --excludedocs +@core +at +bzip2 +findutils +git-core +gzip +make +policycoreutils-python-utils +sed +tar +%end + + +%post --log=/root/ks.log +yum -y config-manager --enable extras +yum -y config-manager --enable crb +yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +yum -y distro-sync +date > /etc/creation_date +mkdir /mnt/user +echo >> /etc/ssh/sshd_config +echo PermitRootLogin yes >> /etc/ssh/sshd_config +%end diff --git a/gh_runner/vars.json b/gh_runner/vars.json new file mode 100644 index 0000000..2383482 --- /dev/null +++ b/gh_runner/vars.json @@ -0,0 +1,7 @@ +{ + "cpu" : "host", + "disk_size" : "10000M", + "iso_checksum" : "sha256:00c91b923997c44822595998deb0cebcfaa53e93c2bed8745b04516badff431f", + "iso_url" : "http://ord.mirror.rackspace.com/almalinux/9.2/isos/x86_64/AlmaLinux-9.2-x86_64-dvd.iso", + "kickstart" : "gh_runner/kickstart.ks" +} diff --git a/vmu-rebuild-all b/vmu-rebuild-all index 5b25ffb..1712a0b 100755 --- a/vmu-rebuild-all +++ b/vmu-rebuild-all @@ -4,7 +4,8 @@ set -o pipefail set -o nounset TEMPLATES=(centos_7 sl_7 centos_stream_8 rocky_8 alma_8 - centos_stream_9 rocky_9 alma_9) + centos_stream_9 rocky_9 alma_9 + gh_runner) DEPLOY_DIR=/staging/osg-images LOG_DIR=/var/log/vmu-packer From 99608434ee9f1928135ccb704566cb85f9ca55c7 Mon Sep 17 00:00:00 2001 From: Matyas Selmeci Date: Tue, 10 Oct 2023 09:56:26 -0500 Subject: [PATCH 2/2] Add Docker and GitHub runner to gh_runner image Change from 24d10fcf1a4b9e20a7fd4d0ca6296e5d588b3027 by @bbockelm --- gh_runner/kickstart.ks | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/gh_runner/kickstart.ks b/gh_runner/kickstart.ks index 8bd4089..5474a35 100644 --- a/gh_runner/kickstart.ks +++ b/gh_runner/kickstart.ks @@ -1,5 +1,5 @@ #auth --enableshadow --passalgo=sha512 --kickstart -autopart --type=lvm --fstype=ext4 +autopart --type=lvm --fstype=ext4 --nohome bootloader --location=mbr --timeout=1 --append="console=tty0 console=ttyS0,115200" cdrom clearpart --all --initlabel @@ -31,17 +31,26 @@ gzip make policycoreutils-python-utils sed +libicu tar %end %post --log=/root/ks.log +yum -y install yum-utils yum -y config-manager --enable extras yum -y config-manager --enable crb +yum -y config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-9.noarch.rpm +yum -y install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin yum -y distro-sync +systemctl enable docker date > /etc/creation_date mkdir /mnt/user echo >> /etc/ssh/sshd_config echo PermitRootLogin yes >> /etc/ssh/sshd_config +useradd -m runner +runuser -u runner -- /bin/sh -c 'mkdir /home/runner/actions-runner; cd /home/runner/actions-runner; pwd; curl -o actions-runner-linux-x64-2.309.0.tar.gz -L https://github.com/actions/runner/releases/download/v2.309.0/actions-runner-linux-x64-2.309.0.tar.gz; tar xvzf ./actions-runner-linux-x64-2.309.0.tar.gz' +/home/runner/actions-runner/bin/installdependencies.sh +echo "runner ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers %end