Skip to content

Commit

Permalink
adding concurrent option
Browse files Browse the repository at this point in the history
  • Loading branch information
ebarault committed Mar 8, 2018
1 parent f7f3fad commit 783bfb3
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 6 deletions.
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,9 @@ the runner settings page in your Gitlab server.
gitlab_runner_gitlab_url: https://gitlab.com/
gitlab_runner_registration_token: WuT4fioAfrK3PG_hVefy
gitlab_runner_default_image: docker:18
gitlab_runner_limit: 5
gitlab_runner_request_concurrency: 2
gitlab_runner_concurrent: 10 # global to all runners in a same host
gitlab_runner_limit: 0 # per token, 0 means unlimited
gitlab_runner_request_concurrency: 10 # per runner
gitlab_runner_tags: docker
gitlab_runner_run_untagged: false

Expand All @@ -46,6 +47,7 @@ the runner settings page in your Gitlab server.
gitlab_url: "{{gitlab_runner_gitlab_url}}"
registration_token: "{{gitlab_runner_registration_token}}"
default_image: "{{gitlab_runner_default_image}}"
concurrent: "{{ gitlab_runner_concurrent }}"
limit: "{{gitlab_runner_limit}}"
request_concurrency: "{{gitlab_runner_request_concurrency}}"
runner_tags: "{{gitlab_runner_tags}}"
Expand All @@ -59,5 +61,5 @@ the runner settings page in your Gitlab server.
# Install gitlab-runner role from github
- name: gitlab-runner
src: https://github.com/ebarault/ansible-role-gitlab-runner-docker
version: "1.1.0"
version: "1.2.0"
```
9 changes: 6 additions & 3 deletions defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,14 @@ registration_token:
# the tag of the GitLab runner docker image to be run, see https://hub.docker.com/r/gitlab/gitlab-runner/tags/
image_tag: alpine-v10.3.1

# maximum number of builds processed by this runner
# limits how many jobs globally can be run concurrently. The most upper limit of jobs using all defined runners. 0 does not mean unlimited
concurrent: 10

# limit how many jobs can be handled concurrently by this token. 0 simply means don't limit
limit: 0

# maximum concurrency for job requests
request_concurrency: 0
# limit number of concurrent requests for new jobs from GitLab
request_concurrency: 10

# comma seperated list of tags used by gitlab-ci jobs to select an appropriate runnner
runner_tags: docker
Expand Down
2 changes: 2 additions & 0 deletions gitlab-runner-register.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
See also: https://docs.gitlab.com/runner/configuration/advanced-configuration.html

NAME:
gitlab-runner register - register a new runner

Expand Down
6 changes: 6 additions & 0 deletions tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,9 @@
--docker-disable-cache=false
--docker-volumes=/var/cache:/cache:rw
--docker-volumes=/var/run/docker.sock:/var/run/docker.sock
- name: set concurrency parameter in gitlab-runner's config.toml
lineinfile:
path: "{{data_volume}}/config.toml"
regexp: "^concurrent ="
line: "concurrent = {{ concurrent }}"

0 comments on commit 783bfb3

Please sign in to comment.