Skip to content

GitLab Runner Installation

This page is a tutorial to install GitLab Runner on a node of the Monolithe.

Docker Installation

# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc

# Add the repository to Apt sources:
echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
  $(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
  sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update

# Install the latest version
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Tested on Ubuntu 24.04 LTS.

# uninstall system packages related to docker
sudo dnf remove docker docker-client docker-client-latest docker-common docker-latest docker-latest-logrotate docker-logrotate docker-selinux docker-engine-selinux docker-engine

# setup the repository
sudo dnf -y install dnf-plugins-core
sudo dnf-3 config-manager --add-repo https://download.docker.com/linux/fedora/docker-ce.repo

# install docker
sudo dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

# start docker
sudo systemctl start docker

Tested on Fedora 39 and 40.

Try if it works:

sudo docker run hello-world

GitLab Runner Installation

# Add the official GitLab repository: 
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.deb.sh" | sudo bash

# Install the latest version of GitLab Runner, or skip to the next step to install a specific version
sudo apt install gitlab-runner

Warning

For now this is not working on Ubuntu 24.10 and it fails with the following error:

Installing /etc/apt/sources.list.d/runner_gitlab-runner.list...curl: (22) The requested URL returned error: 404

Download the right package:

# Replace ${arch} with any of the supported architectures, e.g. amd64, arm, arm64
# A full list of architectures can be found here https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/index.html
curl -LJO "https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/deb/gitlab-runner_${arch}.deb"

Install it:

# Replace ${arch} with any of the supported architectures, e.g. amd64, arm, arm64
sudo dpkg -i gitlab-runner_${arch}.deb

# Add the official GitLab repository: 
curl -L "https://packages.gitlab.com/install/repositories/runner/gitlab-runner/script.rpm.sh" | sudo bash 

# Install the latest version of GitLab Runner, or skip to the next step to install a specific version
sudo dnf install gitlab-runner

Warning

For now this is not working on Asahi Linux (Fedora 39) and it fails with the following error:

Downloading repository file: https://packages.gitlab.com/install/repositories/runner/gitlab-runner/config_file.repo?os=fedora-asahi-remix&dist=39&source=script
curl: (22) The requested URL returned error: 404

Download the right package:

# Replace ${arch} with any of the supported architectures, e.g. amd64, arm, arm64
# A full list of architectures can be found here https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/index.html
curl -LJO "https://s3.dualstack.us-east-1.amazonaws.com/gitlab-runner-downloads/latest/rpm/gitlab-runner_${arch}.rpm"

Install it:

# Replace ${arch} with any of the supported architectures, e.g. amd64, arm, arm64
sudo rpm -i gitlab-runner_<arch>.rpm

GitLab Runner Configuration

First you need to create a new runner from gitlab.lip6.fr. To do this you need to go in a project and then CI/CD Settings -> click on the New project runner blue button.

Here are the tags related to the architectures:

arm64, fma, neon [, armhf]
avx512bw, avx512f, avx2, avx, sse4.2, sse4.1, ssse3, sse3, sse2, x86_64

Tags that are not architecture dependent:

docker, powerful, linux

In Runner description put linux-alsoc-hostname where hostname is the name of the machine.

Once you picked the right tags and set a description you can continue the registration procedure by clicking on the Create runner blue button.

Then you will have to paste a command that look like this on the node :

sudo gitlab-runner register --url https://gitlab.lip6.fr --token glrt-a-token

Danger

sudo is very important in the previous command, in other case the runner will be attached to the current $USER.

Enter the GitLab instance URL:

https://gitlab.lip6.fr

Enter a name for the runner (if it is a Linux machine from the ALSOC team, replace hostname with the hostname of the machine where is running the runner):

linux-alsoc-hostname

Enter an executor:

docker

Enter the default Docker image:

ubuntu:24.04

To check if it works:

sudo gitlab-runner run

You are good to go!

Avoid Conflicts between GitLab Runner and SLURM

Danger

This section is a work in progress and does not work yet. The pre_build_script and post_build_script are run inside docker and don't work as it is intended. For now, you should not do the following steps and GitLab Runner will execute even if there is a running job on the node at the same time :-(.

Add pre and post script to be sure to run the job only if no on is using the current node. Open the config.toml file:

sudo vim /etc/gitlab-runner/config.toml

And after the executor = "docker" line in the [[runners]] section add the following lines:

  # reserve the whole current node in a exclusive way
  pre_build_script = '''
    /opt/slurm/bin/srun -p $HOSTNAME --J GitLab --exclusive --nodes=1 --pty bash -i
  '''
  # cancel all the jobs on the current node = kill the GitLab job
  post_build_script = '''
    /opt/slurm/bin/scancel -p $HOSTNAME
  '''

For this to take effect, restart the GitLab Runner service:

sudo systemctl restart gitlab-runner.service

List of Installed Nodes

  • brubeck.soc.lip6.fr
  • front.mono.proj.lip6.fr
  • xu4.mono.proj.lip6.fr
  • rpi4.mono.proj.lip6.fr
  • m1u.mono.proj.lip6.fr (manual install)
  • opi5.mono.proj.lip6.fr
  • em780.mono.proj.lip6.fr
  • x7ti.mono.proj.lip6.fr (manual install)