1.3.6. How to use the CI Pipeline

The CI pipeline is a gitlab pipeline that is triggered on every push to the repository. It is used to test whether the container and catkin still builds. It also builds and deploys the documentation to the gitlab pages.

1.3.6.1. How to setup a project gitlab runner

In case the IT department does not provide a gitlab runner, you can setup your own gitlab runner. The following steps are necessary to setup a gitlab runner:

  1. Go to the gitlab project and click on Settings -> CI/CD -> Runners settings. There you can create a new project runner.

    1. You need to at least use as_ros as the tag for the runner.

  2. Install the gitlab runner on the machine that will run the gitlab runner. The installation instructions can be found at https://docs.gitlab.com/runner/install/docker.html

    1. Use local system volume mounts to start the Runner container:

      docker run -d --name gitlab-runner --restart always \
         -v /srv/gitlab-runner/config:/etc/gitlab-runner \
         -v /var/run/docker.sock:/var/run/docker.sock \
         gitlab/gitlab-runner:latest
      
    2. Enter the container:

      docker exec -it gitlab-runner /bin/bash
      
    3. Register the runner:

      gitlab-runner register \
         --url "https://gitlab.curemannheim.de" \
         --executor "docker" \
         --docker-image "docker:24.0.5" \
         --description "docker-runner" \
         --docker-volumes "/cache" \
         --docker-volumes "/var/run/docker.sock:/var/run/docker.sock"
      
    4. Edit the config.toml file, [runner.docker] should look like this:

      sudo nano /srv/gitlab-runner/config/config.toml
      
      [runners.docker]
         tls_verify = false
         image = "docker:24.0.5"
         privileged = false
         disable_entrypoint_overwrite = false
         oom_kill_disable = false
         disable_cache = false
         volumes = ["/cache", "/var/run/docker.sock:/var/run/docker.sock"]
         shm_size = 0
         network_mtu = 0
         allowed_pull_policies = ["always", "never"]