Gitlab is a scalable and efficient Git-based fully featured platform for software development and it supports a complete DevOps lifecycle. It is a single application for the entire software development lifecycle from planning projects and source code management to CI/CD, monitoring, and security.
Gitlab Runner is an application that works with GitLab CI/CD to run the job in a pipeline. It is open-source and written in Go Language. It can also be run inside the Docker container or it can be deployed into a Kubernetes cluster.
Steps To Install Gitlab Runner
Download one of the binaries
sudo curl -L --output /usr/local/bin/gitlab-runner "https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-ppc64le"
Give permissions to execute
sudo chmod +x /usr/local/bin/gitlab-runner
Create a GitLab CI user
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
Install and run as a Service
sudo gitlab-runner install --user=gitlab-runner --working directory=/home/gitlab-runner sudo gitlab-runner start
Runners are processes that pick up and execute CI/CD jobs for GitLab.
Registering a runner is the process that binds the runner with one or more GitLab instances. We can register multiple runners on the same host machine, with a different configuration, by repeating the registration commands we use.
Register as many runners as you want. We can register runners as separate users, on separate servers, and on your local machine. Runners are either:
- active – Available to run jobs.
- paused – Not available to run jobs.
- Shared Runner – Shared runners are shared across the GitLab instance. On GitLab shared runners work on autoscaling mode. These are free to use for public open-source projects and limited to 400 CI minutes per month per group for private projects.
- Specific Runners – This ae specific to the project. We can set up a specific one for you can see my use.
Steps to Set up a specific runner for a project
- First, install GitLab Runner and ensure that it is running.
- Enter the GitLab instance URL (for example, https://gitlab.com/)
- After that enter the registration token
- And after that enter a description for the runner
- And after that enter tags for the runner (comma-separated)
Here, I created my own Specific Runner.
Whenever we register a runner, we have to choose an executor. GitLab Runner implements a number of executors that can be used to run your build. It determines the environment each job runs in.
For example, If I want CI/CD job to run PowerShell commands, I might install GitLab Runner on a server and then register a runner that uses the shell executor.
How Do We Select the executor
The executors support different platforms and methodologies for building a project.
For more, you can refer to: https://docs.gitlab.com/runner/
Also, For a more technical blog, you can refer to the knoldus blog: https://blog.knoldus.com/
In conclusion, how we can use Gitlab Runner using two different Runner. If you liked this blog, Please like and share, and if you have any doubts feel free to reach out to me.