Slide 1
Most trusted JOB oriented professional program
DevOps Certified Professional (DCP)

Take your first step into the world of DevOps with this course, which will help you to learn about the methodologies and tools used to develop, deploy, and operate high-quality software.

Slide 2
DevOps to DevSecOps – Learn the evolution
DevSecOps Certified Professional (DSOCP)

Learn to automate security into a fast-paced DevOps environment using various open-source tools and scripts.

Slide 2
Get certified in the new tech skill to rule the industry
Site Reliability Engineering (SRE) Certified Professional

A method of measuring and achieving reliability through engineering and operations work – developed by Google to manage services.

Slide 2
Master the art of DevOps
Master in DevOps Engineering (MDE)

Get enrolled for the most advanced and only course in the WORLD which can make you an expert and proficient Architect in DevOps, DevSecOps and Site Reliability Engineering (SRE) principles together.

Slide 2
Gain expertise and certified yourself
Azure DevOps Solutions Expert

Learn about the DevOps services available on Azure and how you can use them to make your workflow more efficient.

Slide 3
Learn and get certified
AWS Certified DevOps Professional

Learn about the DevOps services offered by AWS and how you can use them to make your workflow more efficient.

previous arrow
next arrow

GitLab Tutorials: Understanding runner config.toml & Example of config.toml

The config.toml file is what configures a runner. You wouldn’t have one unless you’re running your own gitlab-runners, in which case it would be in /etc/gitlab/config.toml on the host running the runner.

You can change the behavior of GitLab Runner and of individual registered runners.

To do this, you modify a file called config.toml, which uses the TOML format.

GitLab Runner does not require a restart when you change most options. This includes parameters in the [[runners]] section and most parameters in the global section, except for listen_address. If a runner was already registered, you don’t need to register it again.

GitLab Runner checks for configuration modifications every 3 seconds and reloads if necessary. GitLab Runner also reloads the configuration in response to the SIGHUP signal.

You can find the config.toml file in:

  • /etc/gitlab-runner/ on *nix systems when GitLab Runner is executed as root (this is also the path for service configuration)
  • ~/.gitlab-runner/ on *nix systems when GitLab Runner is executed as non-root
  • ./ on other systems

The executors

The following executors are available.

ExecutorRequired configurationWhere jobs run
shell Local shell. The default executor.
docker[runners.docker] and Docker EngineA Docker container.
docker-windows[runners.docker] and Docker EngineA Windows Docker container.
docker-ssh[runners.docker][runners.ssh], and Docker EngineA Docker container, but connect with SSH. The Docker container runs on the local machine. This setting changes how the commands are run inside that container. If you want to run Docker commands on an external machine, change the host parameter in the runners.docker section.
ssh[runners.ssh]SSH, remotely.
parallels[runners.parallels] and [runners.ssh]Parallels VM, but connect with SSH.
virtualbox[runners.virtualbox] and [runners.ssh]VirtualBox VM, but connect with SSH.
docker+machine[runners.docker] and [runners.machine]Like docker, but use auto-scaled Docker machines.
docker-ssh+machine[runners.docker] and [runners.machine]Like docker-ssh, but use auto-scaled Docker machines.
kubernetes[runners.kubernetes]Kubernetes pods.

The shells

The available shells can run on different platforms.

ShellDescription
bashGenerate Bash (Bourne-shell) script. All commands executed in Bash context. Default for all Unix systems.
shGenerate Sh (Bourne-shell) script. All commands executed in Sh context. The fallback for bash for all Unix systems.
powershellGenerate PowerShell script. All commands are executed in PowerShell Desktop context. In GitLab Runner 12.0-13.12, this is the default for Windows.
pwshGenerate PowerShell script. All commands are executed in PowerShell Core context. In GitLab Runner 14.0 and later, this is the default for Windows.

Example


$ more /etc/gitlab-runner/config.toml
concurrent = 1
check_interval = 0

[session_server]
  session_timeout = 1800


[[runners]]
  name = "rajeshkumar"
  url = "http://43.205.228.212/"
  id = 3
  token = "AKrp1HueGK1DxaHxjNmD"
  token_obtained_at = 2022-09-06T06:40:14Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

[[runners]]
  name = "raju123"
  url = "http://43.205.228.212/"
  id = 16
  token = "aZ9zvKntG8-PKsm8s1HN"
  token_obtained_at = 2022-09-06T07:13:53Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

[[runners]]
  name = "gitlab-test"
  url = "https://gitlab.com/"
  id = 17373720
  token = "sJp-fyfCvj-K1M-yysfj"
  token_obtained_at = 2022-09-06T09:09:09Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

[[runners]]
  name = "docker"
  url = "https://gitlab.com/"
  id = 17388862
  token = "RDoZpsR8XzyuipDHzYsz"
  token_obtained_at = 2022-09-07T04:31:53Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "alpine"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

[[runners]]
  name = "group"
  url = "https://gitlab.com/"
  id = 17389806
  token = "ES9VZQ4eZx_yfEyxVeqm"
  token_obtained_at = 2022-09-07T05:09:40Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

[[runners]]
  name = "linux-runner"
  url = "https://gitlab.com/"
  id = 17390444
  token = "UHdwAw3MXnyf-C1NgwMR"
  token_obtained_at = 2022-09-07T05:49:15Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "shell"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]

[[runners]]
  name = "docker-runner"
  url = "https://gitlab.com/"
  id = 17390576
  token = "_nHBeXQVrwj8V-xxq899"
  token_obtained_at = 2022-09-07T05:57:22Z
  token_expires_at = 0001-01-01T00:00:00Z
  executor = "docker"
  [runners.custom_build_dir]
  [runners.cache]
    [runners.cache.s3]
    [runners.cache.gcs]
    [runners.cache.azure]
  [runners.docker]
    tls_verify = false
    image = "alpine"
    privileged = false
    disable_entrypoint_overwrite = false
    oom_kill_disable = false
    disable_cache = false
    volumes = ["/cache"]
    shm_size = 0

Reference

  • https://docs.gitlab.com/runner/configuration/advanced-configuration.html
Rajesh Kumar
Follow me
0 0 votes
Article Rating
Subscribe
Notify of
guest
0 Comments
Inline Feedbacks
View all comments
0
Would love your thoughts, please comment.x
()
x