Updated April 17, 2023
Introduction to GitLab Runner
Gitlab runner is an application that was used with gitlab to run the job one by one, we can install it on any system which were we have managed. We can also install it on another machine which was separate from the gitlab instance for the reason of performance and security. At the time using different machines, we can use different operating systems and tools like Docker and Kubernetes. Basically, it is an open-source tool and it was written in GO language, we can run it in a single binary, so we cannot need any specific requirements.
Basically, gitlab runner is the instance which was used to run our job in multiple machines after running the job we have sending it to gitlab. Also, we have sent the result across servers, local machines and the users which were separated. We can register it after installing as specific or we can also register as shared. We can serve our jobs by using shared or specific runners.
Below are the types to serve the gitlab runner job as follows:
- Specific Runners
- Shared Runners
Shared runners are useful when jobs of multiple projects and same requirement. We can use a small or only one runner to handle the multiple projects. We can also use multiple runners for many projects, but it is not easy to maintain and update. Specific runners are used to deploying a certain or specific project which was the same requirement. If we have certain requirements for our projects, then specific runners are used in the algorithm name as first in first out (FIFO) to organize the process and data. By using a specific register token we can register the specific runner. After installing the application, we can register it. Runners are nothing but the agent which was used to run the job of CI/CD. After registering the runner, we can set up communication between the machine and the gitlab.
Basically, the gitlab runner, runs a time process job on the same machine where we have installed the gitlab runner. We can run the runner process job in a container or in the cloud. We can also run the runner process job in the Kubernetes cluster. After registering the runner, we need to choose the executor. An executor is used to determine the environment of the job. If we want to run our CI/CD job in PowerShell, then we need to install gitlab runner on a server. Also to run the CI/CD job we need to register the runner which was used to execute the docker. There is simple configuration which was used to install the gitlab runner on a virtual machine, after installing it on the virtual machine we can use it on another virtual machine.
How to Install GitLab Runner?
Below we have mentioned the steps to install it on the Linux system.
1. First we need to download the rpm package from the gitlab runner website. We can download the same by using the curl command.
Code:
# # curl -LJO "rpm package name and download path"
Output:
2. After downloading the package install the same using rpm or yum command.
Code:
# yum install gitlab-runner_amd64.rpm
Output:
3. After installing it register the same.
Code:
# gitlab-runner register
Output:
Install GitLab Runner using PowerShell
Below is the installation process using PowerShell in the Windows environment as follows:
1. Create a folder for gitlab runner installation. We have created a folder in the “C” directory name as “gitlab_runner”.
C:\gitlab_runner
2. After creating the folder download the binary of gitlab runner. We can download the gitlab runner binary as a perversion of the windows system. We have downloaded the 64-bit binary of gitlab runner.
3. After downloading the binary of gitlab runner provide write permission to gitlab directory.
4. Then run a PowerShell_ISE command on the command prompt to connect the PowerShell ISE.
Code:
PowerShell_ISE
Output:
5. After opening the PowerShell window install runner on windows from cmd or PowerShell.
Code:
gitlab-runner-windows-amd64.exe install
Output:
- In the above example, we have installed the runner from cmd. But after opening PowerShell it will show that it is already installed on the machine.
- We can install it by using cmd or by using PowerShell.
- At the time of installing using PowerShell, we need to give the executable command.
6. We have to start the gitlab runner using PowerShell as follows.
Code:
.\gitlab-runner-windows-amd64.exe start
.\gitlab-runner-windows-amd64.exe status
Output:
7. We have to stop it using PowerShell as follows.
Code:
.\gitlab-runner-windows-amd64.exe start
.\gitlab-runner-windows-amd64.exe status
Output:
Features
Given below are the features as follows:
- Using this we can run multiple jobs concurrently.
- We can use multiple tokens to multiple servers using it.
- Using it we can limit the per token concurrent jobs.
- We can run jobs locally by using it.
- We can run the job using the docker container by using it.
- It is written in GO language.
- Using it we can connect to the remote SSH server.
- It will support the windows PowerShell and bash.
- It will support the Linux as well as Windows environment.
- It will allow us to a customized job running environment.
- Using it we can automatically configure the gitlab. We have no need to take a restart after configuring.
- It is easy to use and set up with an SSH running environment and docker.
- We can easily configure and install it on windows and Linux systems.
Conclusion
GitLab Runner is an application that was used with gitlab to run the job one by one. We can also install it on another machine which was separate from the GitLab instance for the reason of performance and security. We can install it on any windows and Linux system.
Recommended Articles
We hope that this EDUCBA information on “GitLab Runner” was beneficial to you. You can view EDUCBA’s recommended articles for more information.