Skip to content

CI: Centos 7 GHA runner

Regina Obe edited this page Dec 19, 2022 · 3 revisions

this is done on osgeo8 host

lxc launch images:centos/7 centtie-7-pgrouting
lxc exec centtie-7-pgrouting bash

in container configure dev tools needed to compile and test pgrouting

sudo yum install epel-release
sudo yum update
sudo yum install cmake3
sudo yum install wget curl git #git appeared to install perl as well
sudo yum install bzip2 #needed to extract tar.bz2
sudo yum install gcc gcc-c++ make
sudo yum install -y perl-Digest-SHA #needed for self-hosted github runners to get shasum
sudo visudo #unremark out the %wheel with NOPASSWD: ALL and remark out the other
sudo cmake3 --version

mkdir /projects
cd /projects
# the default boost I get when running yum install boost is 1.53, so pulled from source instead
wget https://boostorg.jfrog.io/artifactory/main/release/1.69.0/source/boost_1_69_0.tar.bz2
tar -xvf boost_1_69_0.tar.bz2
cd boost_1_*
./bootstrap.sh --prefix=/opt/boost
sudo ./b2 install --prefix=/opt/boost --with=all


# install postgresql from yum.postgresql.org 
sudo tee /etc/yum.repos.d/pgdg.repo<<EOF
[pgdg-15]
name=PostgreSQL for 15 RHEL/CentOS 7 - x86_64
baseurl=https://download.postgresql.org/pub/repos/yum/15/redhat/rhel-7-x86_64/
enabled=1
gpgcheck=0

[pgdg-depends]
name=PostgreSQL RHEL/CentOS 7 - x86_64 common
baseurl=https://download.postgresql.org/pub/repos/yum/common/redhat/rhel-7-x86_64/
enabled=1
gpgcheck=0
EOF

sudo yum install centos-release-scl #needed for llvm for postgreql15-devel
sudo yum update
sudo yum install postgresql15 postgresql15-server postgresql15-devel postgis33_15 pgtap_15
/usr/pgsql-15/bin/postgresql-15-setup initdb
systemctl enable postgresql-15
systemctl start postgresql-15

setup openssh

#this isn't needed for runner, but needed if not going thru lxc
yum install openssh-server
systemctl start sshd
systemctl enable sshd
mkdir ~/.ssh
#add public keys to authorized_keys

Update config of Default

  1. Change permissions of Default runner group https://github.com/organizations/pgRouting/settings/actions/runner-groups/1 to allow running on public repositiories

  2. Set to allow on public repositories but only selected repositories Pick pgrouting and gsoc-pgRouting

setup as a runner

# in root@osgeo8-centtie-7-pgrouting
sudo useradd gha-pgrouting
sudo usermod -G wheel gha-pgrouting
sudo su gha-pgrouting
cd ~/
#follow directions here - https://github.com/pgrouting/settings/actions/runners/new
# make sure to toggle to Linux x64
# make sure to add label centos-7 gcc-4.8.5
# to run once to test
sh run.sh
# to run as service
sudo sh svc.sh install
sudo sh svc.sh start