Skip to content

Commit 8781149

Browse files
authored
Port the GitLab-Runner instructions from bw-cloud (Gen2) to bwCloud-OS (Gen3) (#273)
1 parent 115ef1b commit 8781149

3 files changed

Lines changed: 15 additions & 16 deletions

File tree

05_testing_and_ci/automation_exercise.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,5 +33,5 @@ Once the workflow runs successfully, add a [GitHub workflow status badge](https:
3333
Realize the same workflows in GitLab CI/CD :)
3434

3535
- Create a new project under your namespace and push your existing automation repository to this remote.
36-
- Create a VM on [bwCloud](https://www.bw-cloud.org/) and create a GitLab Runner with a Docker executor there. Register the runner in your repository.
36+
- Create a VM on [bwCloud-OS](https://bwcloud-os.de/) and create a GitLab Runner with a Docker executor there. Register the runner in your repository.
3737
- Add a link to this repository in the submission issue above and, if necessary, explain what you did. Be sure that your repository is visible to us (either public or add `gchourdakis`).

05_testing_and_ci/gitlab_ci_demo.md

Lines changed: 13 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,20 +16,22 @@ Test code in [automation lecture repository](https://gitlab-sim.informatik.uni-s
1616
- URL and Token; we will need this in a minute
1717
- Select `Run untagged jobs`
1818

19-
## Inspect bwCloud
19+
## Inspect bwCloud-OS
2020

21-
- bwCloud: many services academia in BW can use; e.g. VMs
22-
- Go to dashboard: https://portal.bw-cloud.org/ and login with Uni Stuttgart account
21+
- bwCloud-OS: many services academia in BW can use; e.g. VMs
22+
- Our university provides the service to all students and employees, under specific quotas. Students get one VM instance. See the [TIK page](https://www.tik.uni-stuttgart.de/dienste-a-z/bwCloud/).
23+
- Not to be confused with the previous phase of the project (Gen2), under the `bw-cloud.org` domain name. The current service is the continuation of that (Gen3).
24+
- Go to dashboard: https://bwcloud-os.de/ and login with Uni Stuttgart account
2325
- I have already set up a VM. What I did:
24-
- Add public SSH key
26+
- Added a [public SSH key](https://docs.gitlab.com/user/ssh/#generate-an-ssh-key-pair)
2527
- Instances -> Launch instance
26-
- Ubuntu 24.04
27-
- Flavor: m1.small
28-
- VM is up and running, connect to it: `ssh ubuntu@<IPv6>`
28+
- Source: Ubuntu 26.04
29+
- Flavor: p1.nano (1 vCPU, 1GB RAM, according to the student quota)
30+
- VM is up and running, connect to it: `ssh ubuntu@<IPv6>` (you need to be in the university network - see [TIK VPN](https://www.tik.uni-stuttgart.de/en/services-a-z/VPN/))
2931
- Apply updates: `sudo apt update && sudo apt -y upgrade`
3032
- Install Docker: `sudo apt install -y docker.io`
3133

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.
34+
You can get the IP from the Instances view (`project/instances/`). Note that there are two addresses here: an IPv4 (decimal) and an IPv6 (hexadecimal) address. VMs on bwCloud-OS only support IPv6 networks, so you need the second address.
3335

3436
## Setup GitLab Runner
3537

@@ -57,7 +59,7 @@ You can get the IP from the [Instances view](https://portal.bw-cloud.org/project
5759

5860
## Register Runner
5961

60-
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:
62+
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-OS only supports IPv6 networks:
6163

6264
```bash
6365
sudo docker run --rm -it \
@@ -72,10 +74,8 @@ sudo docker run --rm -it \
7274
- URL: (press Enter to confirm)
7375
- Token: see above
7476
- Name/Description: `SSE Automation Demo Runner`
75-
- No tags, no maintenance note
7677
- Executor: `docker`
7778
- Default Docker image: `alpine:latest` (used for pipelines that do not specify any Docker image themselves, can be overwritten in configuration of pipeline)
78-
- `sudo vi /srv/gitlab-runner/config/config.toml`
7979
- Verify that there is now a runner in the repo settings
8080
- Verify that pipeline now ran
8181

@@ -85,16 +85,15 @@ sudo docker run --rm -it \
8585

8686
## Workarounds for IPv6
8787

88-
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.
88+
VMs on bwCloud-OS 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.
8989

9090
First, we need to start Docker with `-e GODEBUG="netdns=go+ipv6"`. This is related to Go prioritizing IPv4 connections.
9191

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) (tag depends on the GitLab version, e.g., [x86_64-v18.8.0](https://hub.docker.com/layers/gitlab/gitlab-runner-helper/x86_64-v18.8.0/images/sha256-9b95c50a9b4b49dd5be9ea9e2191164b649f33f94cc81886a517e846ae4096ee)), 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`:
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) (tag depends on the GitLab version, e.g., [x86_64-v18.8.0](https://hub.docker.com/layers/gitlab/gitlab-runner-helper/x86_64-v18.8.0/images/sha256-9b95c50a9b4b49dd5be9ea9e2191164b649f33f94cc81886a517e846ae4096ee)), 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`:
9393

9494
```toml
9595
helper_image = "gitlab/gitlab-runner-helper:x86_64-v18.8.0"
9696
network_mode = "host"
9797
```
9898

9999
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.
100-

05_testing_and_ci/gitlab_ci_slides.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ deploy job:
182182
183183
## Demo: GitLab Runner
184184
185-
- Installation of a GitLab Runner on a [bwCloud](https://portal.bw-cloud.org/) VM (via Docker)
185+
- Installation of a GitLab Runner on a [bwCloud-OS](https://bwcloud-os.de/) VM (via Docker)
186186
- Registration of the runner to a repository (Docker as executor)
187187
188188
---

0 commit comments

Comments
 (0)