|
12 | 12 |
|
13 | 13 | Runners [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/runner/) are used to execute jobs in GitLab CI
|
14 | 14 |
|
15 |
| -Supported executors: `shell`, `docker`, `docker-windows`, `docker-ssh`, `ssh`, `parallels`, `virtualbox`, `docker+machine`, `docker-ssh+machine`, `kubernetes` |
| 15 | +Runner can be shared across the instance of GitLab |
16 | 16 |
|
17 |
| -### Shell |
| 17 | +They can be specific to a group or project |
18 | 18 |
|
19 |
| -Jobs are executed in the context of the runner |
| 19 | +Extensive configuration [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/runner/configuration/advanced-configuration.html) |
20 | 20 |
|
21 |
| -### Docker / Kubernetes |
| 21 | +### Tags |
22 | 22 |
|
23 |
| -Jobs are executed in a dedicated container / pod |
| 23 | +Jobs select runners by specifying a tag |
24 | 24 |
|
25 |
| -### Image cleanup |
| 25 | +--- |
26 | 26 |
|
27 |
| -docuum [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://github.com/stepchowfun/docuum) is able to remove least recently used images |
| 27 | +## Heads-up |
| 28 | + |
| 29 | +New runner registration process [](https://docs.gitlab.com/ee/architecture/blueprints/runner_tokens/) |
| 30 | + |
| 31 | +New default in 16.0 (May 2023) |
| 32 | + |
| 33 | +Enforcement in 16.6 (November 2023) |
| 34 | + |
| 35 | +Removal of old runne registration in 17.0 (May 2024) |
| 36 | + |
| 37 | +### Old process |
| 38 | + |
| 39 | +One token per instance, per group and per project |
| 40 | + |
| 41 | +Credential leak causes a lot of work |
| 42 | + |
| 43 | +### New process |
| 44 | + |
| 45 | +Create a runner through the UI or the API |
| 46 | + |
| 47 | +One token per runner |
28 | 48 |
|
29 | 49 | ---
|
30 | 50 |
|
31 | 51 | ## Details
|
32 | 52 |
|
33 | 53 | <i class="fa-duotone fa-person-running fa-4x fa-duotone-colors" style="float: right;"></i>
|
34 | 54 |
|
35 |
| -Runner can be shared across the instance of GitLab |
36 |
| - |
37 |
| -They can be specific to a group of project |
38 |
| - |
39 |
| -Jobs select runners by specifying a tag |
| 55 | +Supported executors: `shell`, `docker`, `docker-windows`, `docker-ssh`, `ssh`, `parallels`, `virtualbox`, `docker+machine`, `docker-ssh+machine`, `kubernetes` |
40 | 56 |
|
41 |
| -Extensive configuration [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://docs.gitlab.com/runner/configuration/advanced-configuration.html) |
| 57 | +### Shell |
42 | 58 |
|
43 |
| -### Heads-up |
| 59 | +Jobs are executed in the context of the runner |
44 | 60 |
|
45 |
| -New runner registration process [](https://docs.gitlab.com/ee/architecture/blueprints/runner_tokens/) |
| 61 | +### Docker / Kubernetes |
46 | 62 |
|
47 |
| -New default in v16.0 (May 2023) |
| 63 | +Jobs are executed in a dedicated container / pod |
48 | 64 |
|
49 |
| -Enforcement in v16.6 (November 2023) |
| 65 | +### Image cleanup |
50 | 66 |
|
51 |
| -Removal of old runne registration in v17.0 (May 2024) |
| 67 | +docuum [<i class="fa-solid fa-arrow-up-right-from-square"></i>](https://github.com/stepchowfun/docuum) is able to remove least recently used images |
52 | 68 |
|
53 | 69 | ---
|
54 | 70 |
|
55 | 71 | ## Hands-On
|
56 | 72 |
|
57 |
| -Add runner to GitLab instance |
58 |
| - |
59 |
| -```bash |
60 |
| -# Switch to directory for this topic |
61 |
| -cd ../160_runners |
62 |
| - |
63 |
| -# Deploy GitLab runner |
64 |
| -export CI_SERVER_URL=http://gitlab.seatN.inmylab.de |
65 |
| -export REGISTRATION_TOKEN=<TOKEN> |
66 |
| -export RUNNER_EXECUTOR=docker |
67 |
| -docker compose --project-name gitlab \ |
68 |
| - --file ../100_reverse_proxy/compose.yml \ |
69 |
| - --file compose.yml \ |
70 |
| - up -d |
71 |
| -``` |
| 73 | +1. Add runner to GitLab instance: Admin Area <i class="fa-regular fa-arrow-right"></i> CI/CD <i class="fa-regular fa-arrow-right"></i> Runners <i class="fa-regular fa-arrow-right"></i> New instance runner |
| 74 | + |
| 75 | +1. Configure runner: Check "Run untagged jobs" |
| 76 | + |
| 77 | +1. Start runner (substitute token below) |
| 78 | + |
| 79 | + ```bash |
| 80 | + # Switch to directory for this topic |
| 81 | + cd ../160_runners |
| 82 | + |
| 83 | + # Deploy GitLab runner |
| 84 | + export CI_SERVER_URL=http://gitlab.seatN.inmylab.de |
| 85 | + export REGISTRATION_TOKEN=<TOKEN> |
| 86 | + export RUNNER_EXECUTOR=docker |
| 87 | + docker compose --project-name gitlab \ |
| 88 | + --file ../100_reverse_proxy/compose.yml \ |
| 89 | + --file compose.yml \ |
| 90 | + up -d |
| 91 | + ``` |
| 92 | + |
| 93 | + <!-- .element: style="width: 35em;" --> |
0 commit comments