diff --git a/doc/compliance b/doc/compliance index f0b9386..b65fa25 160000 --- a/doc/compliance +++ b/doc/compliance @@ -1 +1 @@ -Subproject commit f0b9386d387c8b3c65d40e385ed3d2eef618dbd9 +Subproject commit b65fa25c227a0a6d426e6c3b5c6f6e51f8b0e624 diff --git a/main.tf b/main.tf index 2e6d905..8229d0f 100644 --- a/main.tf +++ b/main.tf @@ -86,7 +86,7 @@ resource "cloudfoundry_app" "gitlab-runner-manager" { path = data.archive_file.src.output_path source_code_hash = data.archive_file.src.output_base64sha256 buildpacks = ["https://github.com/cloudfoundry/apt-buildpack", "binary_buildpack"] - instances = 1 + instances = var.manager_instances command = "gitlab-runner run" memory = var.manager_memory health_check_type = "process" @@ -118,6 +118,7 @@ resource "cloudfoundry_app" "gitlab-runner-manager" { # https://docs.gitlab.com/runner/faq/#enable-debug-logging-mode # and ensuring job logs are removed to avoid leaking secrets. RUNNER_DEBUG = "false" + RUNNER_CONCURRENCY = var.runner_concurrency OBJECT_STORE_INSTANCE = var.object_store_instance PROXY_CREDENTIAL_INSTANCE = cloudfoundry_service_instance.egress-proxy-credentials.name PROXY_APP_NAME = var.egress_app_name diff --git a/runner-manager/.profile b/runner-manager/.profile index 05396a0..f7d8fdd 100644 --- a/runner-manager/.profile +++ b/runner-manager/.profile @@ -81,6 +81,7 @@ if pgrep 'gitlab-runner' > /dev/null ; then else echo "Registering GitLab Runner with name $RUNNER_NAME" if gitlab-runner register; then + sed -e "s/concurrent = 1$/concurrent = $RUNNER_CONCURRENCY/" -i.bak .gitlab-runner/config.toml echo "GitLab Runner successfully registered" else exit_with_failure "GitLab Runner not registered" diff --git a/sandbox-deploy/main.tf b/sandbox-deploy/main.tf index d5ebb90..c3085ef 100644 --- a/sandbox-deploy/main.tf +++ b/sandbox-deploy/main.tf @@ -30,6 +30,7 @@ module "sandbox-runner" { ci_server_token = var.ci_server_token docker_hub_user = var.docker_hub_user docker_hub_token = var.docker_hub_token + manager_instances = 1 developer_emails = var.developer_emails worker_disk_size = var.worker_disk_size worker_egress_allowlist = var.worker_egress_allowlist diff --git a/variables.tf b/variables.tf index 77f5266..7da590c 100644 --- a/variables.tf +++ b/variables.tf @@ -47,6 +47,18 @@ variable "runner_executor" { description = "Runner Executer" } +variable "manager_instances" { + type = number + default = 2 + description = "Number of manager instances to run" +} + +variable "runner_concurrency" { + type = number + default = 10 + description = "The number of parallel jobs a single manager instance will support" +} + variable "manager_memory" { type = number default = 512