From 9b8396643bc9ace08cbeecdb94efef5da570e5ea Mon Sep 17 00:00:00 2001 From: Halfwalker Date: Fri, 26 Jan 2024 19:25:42 -0500 Subject: [PATCH] act runner : increase # concurrent jobs, force cache to /stuff/gitea/act_cache --- README.md | 8 ++++++++ defaults/main.yml | 2 ++ tasks/act_setup.yml | 8 ++++++-- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index ab1d474..9cddbda 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,14 @@ Available variables are listed below along with default values (see `defaults/ma **TODO:** Move to a container for the act_runner like gitea, drone and drone-runner. +* `gitea_act_version: 0.2.6` + + Which version of the Gitea ACT runner to install + +* `gitea_act_capacity: 10` + + How many concurrent jobs this ACT runner instance can handle + * `gitea_container_port: 3000` `gitea_drone_port: 3001` `gitea_dronerunner_port: 3002` diff --git a/defaults/main.yml b/defaults/main.yml index 834523b..0dbbcc2 100644 --- a/defaults/main.yml +++ b/defaults/main.yml @@ -13,6 +13,8 @@ enable_drone: true enable_act: true # What version to install gitea_act_version: 0.2.6 +# act runner container capacity - how many concurrent jobs +gitea_act_capacity: 10 # Docker network name for gitea/drone/drone-runner to live in gitea_network_name: ci-cd diff --git a/tasks/act_setup.yml b/tasks/act_setup.yml index 49191e2..e05079b 100644 --- a/tasks/act_setup.yml +++ b/tasks/act_setup.yml @@ -53,8 +53,12 @@ - name: act - Set container default to allow privileged replace: dest: '{% for dataset in gitea_datasets %}{% if dataset.name == "gitea" %}{{ dataset.mountpoint }}{% endif %}{% endfor %}/act_runner-{{ gitea_act_version }}_config.yml' - regexp: 'privileged: false' - replace: 'privileged: true' + regexp: "{{ item.regexp }}" + replace: "{{ item.replace }}" + loop: + - { regexp: 'privileged: false', replace: 'privileged: true' } + - { regexp: 'dir: ""', replace: 'dir: "{% for dataset in gitea_datasets %}{% if dataset.name == "gitea" %}{{ dataset.mountpoint }}{% endif %}{% endfor %}/act_cache"' } + - { regexp: 'capacity: .*', replace: 'capacity: {{ gitea_act_capacity }}' } - name: act - check for existence of .runner config stat: