You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
You can get the IP from the [Instances view](https://portal.bw-cloud.org/project/instances/). Note that there are two addresses here: an IPv4 (decimal) and an IPv6 (hexadecimal) address. New VMs on bwCloud only support IPv6 networks, so you need the second address.
30
33
31
34
## Setup GitLab Runner
32
35
33
36
- Install GitLab Runner via Docker:
34
37
35
38
```bash
36
39
sudo docker run -d --name gitlab-runner --restart always \
40
+
--network host \
41
+
-e GODEBUG="netdns=go+ipv6" \
37
42
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
38
43
-v /var/run/docker.sock:/var/run/docker.sock \
39
44
gitlab/gitlab-runner:latest
40
45
```
41
46
42
47
-`docker run -d --name gitlab-runner --restart always` runs the container in the background (`-d` means detached) names it `gitlab-runner` and makes sure that it always runs. The container is automatically restarted once it stops/crashes. If you want to stop the container, you have to stop it manually (`docker container stop`).
48
+
- The `--network host` and `-e GODEBUG="netdns=go+ipv6"` are needed in this IPv6-only VM (see section below).
43
49
-`-v /srv/gitlab-runner/config:/etc/gitlab-runner` mounts the directory `/srv/gitlab-runner/config` into the container.
44
50
-`-v /var/run/docker.sock:/var/run/docker.sock` mounts important Docker files into the container such that the container can start other containers (for pipelines).
45
51
-`gitlab/gitlab-runner:latest` is the GitLab Runner image used from Docker Hub.
@@ -51,10 +57,21 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
51
57
52
58
## Register Runner
53
59
54
-
-`sudo docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register`
You can register a runner using the following command. Notice again the `--network host` option, which tells Docker to use the host network stack. This is an important workaround for the fact that bwCloud only supports IPv6 networks:
- Default Docker image: `alpine:latest` (used for pipelines that do not specify any Docker image themselves, can be overwritten in configuration of pipeline)
@@ -65,3 +82,19 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
65
82
- More information:
66
83
-[Executors and their abilities](https://docs.gitlab.com/runner/executors/)
New bwCloud VMs only support IPv6 by default. Asking for IPv4 for a specific VM might be possible via the [helpdesk](https://bw-support.scc.kit.edu/). A few workarounds are needed to make the GitLab runner work in this IPv6-only environment.
89
+
90
+
First, we need to start Docker with `-e GODEBUG="netdns=go+ipv6"`. This is related to Go prioritizing IPv4 connections.
91
+
92
+
We also need to tell Docker to use the host network stack. We also need to replace the helper image with [the one from Docker Hub](https://hub.docker.com/r/gitlab/gitlab-runner-helper/tags?name=x86_64-v17.10.1) (depends on the GitLab version), since [`registry.gitlab.com` does not support IPv6](https://gitlab.com/gitlab-com/gl-infra/production-engineering/-/issues/18058). You can start without this setting, and see which image GitLab is trying to pull). Edit the `[runners.docker]` section in `/srv/gitlab-runner/config/config.toml`:
While we already pass `--network host` to `docker run`, setting this system-wide makes it easier to also start the job containers with the same settings.
0 commit comments