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
Copy file name to clipboardExpand all lines: 05_testing_and_ci/gitlab_ci_demo.md
+26-3Lines changed: 26 additions & 3 deletions
Original file line number
Diff line number
Diff line change
@@ -31,20 +31,44 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
31
31
32
32
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.
33
33
34
+
## Workarounds for IPv6
35
+
36
+
New bwCloud VMs only support IPv6 by default. Asking for IPv4 for a specific VM might be possible via the [helpdesk](https://bw-cloud.org/q/t).
37
+
38
+
A few workarounds are needed to make the GitLab runner work in this IPv6-only environment, especially since [`registry.gitlab.com` does not support IPv6](https://gitlab.com/gitlab-com/gl-infra/production-engineering/-/issues/18058) and the Docker support for IPv6 needs to be expliticly configured.
39
+
40
+
First, we need to tell Docker to use the host network and DNS. 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). Edit the `[runners.docker]` section in `/srv/gitlab-runner/config/config.toml`:
While you could pass `--network host` to `docker run`, setting this system-wide makes it easier to also start the job containers with the same settings.
49
+
50
+
Whenever changing this configuration file, we need to restart the runner (e.g., by restarting the respective container).
51
+
52
+
We also need to hard-code the IPv6 address that corresponds to the GitLab instance domain. Add the following line in the `/srv/gitlab-runner/custom-hosts`:
You can get this address by running `dig aaaa gitlab-sim.informatik.uni-stuttgart.de`.
59
+
34
60
## Setup GitLab Runner
35
61
36
62
- Install GitLab Runner via Docker:
37
63
38
64
```bash
39
65
sudo docker run -d --name gitlab-runner --restart always \
40
-
--network host \
41
66
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
42
67
-v /var/run/docker.sock:/var/run/docker.sock \
43
68
gitlab/gitlab-runner:latest
44
69
```
45
70
46
71
-`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`).
47
-
-`--network host` tells Docker to use the host network stack and is needed on bwCloud VMs, which only support IPv6.
48
72
-`-v /srv/gitlab-runner/config:/etc/gitlab-runner` mounts the directory `/srv/gitlab-runner/config` into the container.
49
73
-`-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).
50
74
-`gitlab/gitlab-runner:latest` is the GitLab Runner image used from Docker Hub.
@@ -60,7 +84,6 @@ You can register a runner using the following command. Notice again the `--netwo
0 commit comments