Basic architecture

The main network communication is from the GitLab Runner to the GitLab CI, never the other way around. This is shown in the following diagram:

The behavior is best depicted by a sequence diagram like the following one:

When the GitLab Runner starts, it tries to find its coordinator by contacting the GitLab URL. When it registers itself with the registration token, it gets a special token to connect to GitLab. After a restart, it connects and waits for a job from GitLab CI. It polls GitLab in intervals, and when there is nothing to do, it will check GitLab less often to prohibit too much network traffic.

When a job is queued in GitLab CI, it will try to find an available runner. After receiving the command, it will clone the project-specific commit that triggered the job and will execute the steps defined in the .gitlab-ci.yml file. After execution, the results are sent back to GitLab.

GitLab CI has two types of runners:

  • Specific Runners: As a developer, you can create your own runners and register them to a project in GitLab. Only then is the project visible to the runner.
  • Shared Runners: A GitLab administrator can also designate a runner to be shared. It can then pick up jobs from several projects. Because this is potentially classed as a security breach, be careful when you're promoting runners to be shared.

In the following screenshot, you can see the CI/CD configuration of a project in GitLab, where you can set which runner to use:

The GitLab Runner clones the repository and performs steps that are defined in the .gitlab-ci.yml file. It is possible to inject special variables that can be protected on the GitLab project level:

We've explained the basic architecture of the runner platform, so now we'll install the software on different operating systems.

The GitLab Runner software is available for the following operating systems:

  • Linux
  • FreeBSD
  • macOS
  • Windows

The installation procedure is largely identical on all systems, with subtle differences. In the next section, we will show you how to install the basic Runner on several types of operating systems.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.135.183.89