GitLab Runner: Brie Carranza
module-name: "GitLab Runner"
area: "Product Knowledge"
gitlab-group: "Verify:Runner"
maintainers:
- TBD
Overview
Goal: Set a clear path for GitLab Runner training
Stage 0: Create and commit to the module
-
Create an issue using this template by making the Issue Title: GitLab Runner - -
Add yourself and your trainer as the assignees. -
Ping your manager to let them know you've started. -
Commit to this by updating your knowledge_areas by updating the Support Team yaml file with this training module's topic. // MR -
Commit to this by notifying the current experts that they can start routing non-technical GitLab Runner questions to you -
Optional: Set a milestone, if applicable, and a due date to help motivate yourself!
Stage 1: Become familiar with what GitLab Runners are
-
Done with Stage 1
-
Start with reading about GitLab Runners (No need to follow any links on the page) -
Install a GitLab Runner on preferred OS -
Create an example project on your own GitLab instance.
Stage 2: Basic GitLab Runner
-
Done with Stage 2
-
Learn about possible variables in the .gitlab-ci.yml docs -
Read up on Executors -
Register your runner as a Shared Runner on your instance. -
Register your runner as a Specific Runner on your project, and test that it now runs the builds for your project. -
Read about Pipelines and Jobs. -
Learn about Using tags
Stage 3: Intermediate GitLab Runner
-
Done with Stage 3
-
Install a GitLab Runner through Docker image -
Read What is a Service -
Configure a Service to be used in a pipeline -
Read the troubleshoot section for GitLab Runner
📓 Stage 3 Notes
Run
docker run -d --name gitlab-runner --restart always \ -v /var/run/docker.sock:/var/run/docker.sock \ -v gitlab-runner-config:/etc/gitlab-runner \ gitlab/gitlab-runner:latest --env TZ=America/New_York
Register using the one-liner registration
docker run -v /var/run/docker.sock:/var/run/docker.sock -v gitlab-runner-config:/etc/gitlab-runner --env TZ=America/New_York gitlab/gitlab-runner register \ --non-interactive \ --executor "docker" \ --docker-image alpine:latest \ --url "https://omg.brie.dev/" \ --registration-token "" \ --description "dev-brie-ninja" \ --tag-list "dev,ninja,frantech" \ --run-untagged="false" \ --locked="false" \ --access-level="not_protected"
I make use of services regulary for Docker-in-Docker. An example:
- See the
.gitlab-ci.ymlfor gitlab-gold/briecarranza/shipyard/container-maker
For learning purposes, I decided to use something other than Docker-in-Docker for this module.
WIP: This could be something as simple as spinning up an nginx server as a service, writing some code that makes HTTP requests and issuing those requests against the nginx container instance.
That will live in this project: https://gitlab.com/gitlab-gold/briecarranza/learning/runner-ci-pipeline-with-service
Stage 4: Advanced GitLab Runner
-
Done with Stage 4
-
Read Install and register GitLab Runner for autoscaling with Docker Machine -
Read how to install GitLab Runner on Windows -
Configure a self-signed certificate for a runner. -
Install GitLab Runner Kubernetes clusters
📓 Stage 4 Notes
The installation and registration process on Windows is fairly straightforward. I completed the process rather than simply reading through it.
Self-Signed Certificates
Useful Tools
-
xca - an excellent cross-platform application intended for creating and managing X.509 certificates, certificate requests, RSA, DSA and EC private keys, Smartcards and CRLs. Everything that is needed for a CA is implemented.
-
httpie - My favorite new HTTP client. (
cURL) -
June 29, 2021 - Bumping into gitlab-org/gitlab#216950
-
July 26, 2021 - Attempting to trust the certificate
Optional: Pipeline section
-
Done with the Optional Pipeline section
-
Multi-project pipelines -- check out trigger a pipeline when an upstream project is rebuilt. -
Parent-Child pipelines -- see notes on this issue about variable interpolation in parent/child pipelines. -
Pipelines API -- see pipeline-cleaner and this snippet I put together for this module; it returns a pipeline ID when given a job ID WIP. -
Speed up a pipeline using caching. See pipeline-with-caching project from the Runner module. I used pip cache.
Stage 5: 🎫 🎫 Tickets
-
Done with Stage 5
-
Find 10 Solved tickets to get a sense of what gets asked and how others have done troubleshooting in this area. -
🎫 All runners failing due to 500 error -
🎫 Shared Runner disk is filled up with tons of cache objects -
🎫 GitLab Kubernetes Runner Resource Overwrite Variables Need To Be Set In Job -
🎫 Re: upgrade path for gitlab server and gitlab-runner -
🎫 Where can I find gitlab-runner on the Gitlab server? -
🎫 MaxGrowthRate ignored by docker+machine runner, long machine startup times -
🎫 register a runner -
🎫 Re: Runner TCP Error -
🎫 Re: Peer's Certificate issuer is not recognized -
🎫 Some wired IPv6 behavior in my CI/CD
-
-
Answer 5 tickets on this module's topic and paste the links here. Do this even if a ticket seems too advanced for you to answer. Find the answers from an expert and relay them to the customers.
Penultimate stage: Review
Any updates or improvements needed? If there are any dead links, out of date or inaccurate content, missing content whether in this module or in other documentation, list it below as tasks for yourself!
Module
-
Talk about the unregistersubcommand -
Remove dangling item in optional Pipeline section. -
The first item in stage 3 should mention that installation and registration of the Runner should occur. -
Update note about Windows Runner (use Windows 10 eval VM, actually install and register a Windows Runner. Keep it simple by keeping Docker out of the mix, if you'd like.) -
Fix "What is a Service" link. Maybe it should point to https://docs.gitlab.com/ee/ci/services/ instead.
Docs
-
Very tiny docs improvement to this FAQ answer. - gitlab-org/gitlab-runner!2994 -
Why no docs or usage for the health-checkcommand? -gitlab-org/gitlab-runner#25382
gitlab-org/gitlab-runner!2994 (merged)
Final Stage
-
Manager: Have a GitLab Runner expert in Support review 3-5 of the tickets from Stage 5 and report back to you on whether sufficient GitLab Runner knowledge has been demonstrated. -
Manager: schedule a call (or integrate into 1:1) to review how the module went once you have reviewed this issue. -
Submit a MR to update the Support Team yaml file with this training module's topic under your list of completed modules. - See gitlab-com/support/team!314. -
Submit a MR to declare yourself a Runner Expert on the team page. - See gitlab-com/www-gitlab-com!87543 (merged).