Skip to content

Commit 734d6ab

Browse files
authored
Update gitlab_ci_demo.md
1 parent d58a42f commit 734d6ab

File tree

1 file changed

+18
-3
lines changed

1 file changed

+18
-3
lines changed

05_testing_and_ci/gitlab_ci_demo.md

Lines changed: 18 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
1414
- Edit in pipeline editor -> Visualize
1515
- Settings -> CI/CD -> Runners -> Specific runners
1616
- URL and Token; we will need this in a minute
17+
- Select `Run untagged jobs` (optional, but can make things simpler for now)
1718

1819
## Inspect bwCloud
1920

@@ -22,24 +23,28 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
2223
- I have already set up a VM. What I did:
2324
- Add public SSH key
2425
- Instances -> Launch instance
25-
- Ubuntu 22.04
26+
- Ubuntu 24.04
2627
- Flavor: m1.small
2728
- `sudo apt update && sudo apt -y upgrade`
2829
- `sudo apt install -y docker.io`
2930
- VM is up and running, connect to it: `ssh ubuntu@<IP>`
3031

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+
3134
## Setup GitLab Runner
3235

3336
- Install GitLab Runner via Docker:
3437

3538
```bash
3639
sudo docker run -d --name gitlab-runner --restart always \
40+
--network host \
3741
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
3842
-v /var/run/docker.sock:/var/run/docker.sock \
3943
gitlab/gitlab-runner:latest
4044
```
4145

4246
- `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.
4348
- `-v /srv/gitlab-runner/config:/etc/gitlab-runner` mounts the directory `/srv/gitlab-runner/config` into the container.
4449
- `-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).
4550
- `gitlab/gitlab-runner:latest` is the GitLab Runner image used from Docker Hub.
@@ -51,8 +56,18 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
5156

5257
## Register Runner
5358

54-
- `sudo docker run --rm -it -v /srv/gitlab-runner/config:/etc/gitlab-runner gitlab/gitlab-runner register`
55-
- URL: `https://gitlab-sim.informatik.uni-stuttgart.de/`
59+
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:
60+
61+
```bash
62+
sudo docker run --rm -it \
63+
--network host \
64+
-v /srv/gitlab-runner/config:/etc/gitlab-runner \
65+
gitlab/gitlab-runner register \
66+
--url https://gitlab-sim.informatik.uni-stuttgart.de/
67+
```
68+
69+
- Enter the following details:
70+
- URL: (press Enter to confirm)
5671
- Token: see above
5772
- Description: `SSE Automation Demo Runner`
5873
- No tags, no maintenance note

0 commit comments

Comments
 (0)