To perform the actual build, you need to install GitLab Runner. Runners can run anywhere : you can use a virtual machine on ci.inria.fr to host your GitLab runner.
`gitlab-runner` is a program (executable) to be installed on the machine which will execute the jobs.
Then, after installation, a *runner* registration allows the machine to contact the gitlab's instance (*e.g.* gitlab.inria.fr) and trigger jobs coming from one specific or several gitlab's projects, see [runners scope](https://docs.gitlab.com/ee/ci/runners/runners_scope.html) and [enable a project runner for a different project](https://docs.gitlab.com/ee/ci/runners/runners_scope.html#enable-a-project-runner-for-a-different-project).
You can use a virtual machine on [ci.inria.fr](https://ci.inria.fr)(Linux, Windows or MacOS) to host your GitLab runner.
See:
* https://inria-ci.gitlabpages.inria.fr/doc/page/web_portal_tutorial/ to create a slave on Inria's CI platform and access it (you can ignore the jenkins related parts)
* https://docs.gitlab.com/runner/install/ for the official documentation to install the runner on the vm(s) you've created.
*<https://inria-ci.gitlabpages.inria.fr/doc/page/web_portal_tutorial/> to create a slave on Inria's CI platform and access it (you can ignore the jenkins related parts)
*<https://docs.gitlab.com/runner/install/> for the official documentation to install the runner on the vm(s) you've created.
#### Installation example on a GNU/linux slave from ci.inria.fr ("ci" user account)
...
...
@@ -202,47 +206,35 @@ gitlab-runner start
gitlab-runner status # should return "service is running"
```
### Register a runner in your project
On the virtual machine where you installed the gitlab CI runner, run (as root or sudo if the gitlab-runner program has been installed with sudo, remove sudo from the following if not) :
```plaintext
$ sudo gitlab-runner register
```
Use the gitlab URL and the registration token found in the "Pipelines" page when asked.
### Register a runner to trigger project's job
In order to answer when asked
The `gitlab-runner` program allows to contact gitlab to trigger jobs of a particular project.
To initiate the communication between the machine and the gitlab's project one has to register a new runner.
To do so, visit your gitlab's project, go to Settings -> CI/CD -> Runners and click on **New project runners**.
You can add tags to be able to identify the type of machine (*e.g.* 'linux', 'ci.inria.fr', 'debian', ...).
Then, click on **Create runner**.
Copy/paste command line given in the **Step 1** section in a shell terminal on the virtual machine where you installed the `gitlab-runner` program.
Run as root or sudo if the `gitlab-runner` program has been installed with sudo, remove sudo from the following if not:
```plaintext
Please enter the gitlab-ci tags for this runner (comma separated):
it is important to know that "gitlab-ci tags" are NOT git tags. The tags you enter here are useful to specify conditional execution in the configuration file .gitlab-ci.yml.\
See :
* https://docs.gitlab.com/ee/ci/yaml/#tags
* and https://docs.gitlab.com/ee/ci/yaml/#only--except
for more details.
The next question
Several questions must be answered:
```plaintext
Whether to run untagged builds [true/false]:
```
* "Enter the GitLab instance URL" -> enter key (https://gitlab.inria.fr is the right one)
* "Enter a name for the runner" -> let the one by default (the local hostname) or type a different one, enter key
* "Enter an executor" -> make the choice in the given list, it will usually be **shell** (use the current account, system environment and shell to run jobs) or **docker** (to run jobs in a docker image given in gitlab-ci jobs definition, see `.gitlab-ci.yml`).
becomes clear when the "gitlab-ci tag" concept is understood.
At the end of this step, your runner should appear in the *Settings -> CI/CD -> Runners -> Assigned project runners* tab of your project.
When asked
This specific runner can be removed (unregistered) as follows (in a shell terminal of the machine):