Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Parallel job execution #75

Merged
merged 5 commits into from
Jan 15, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion doc/compliance
3 changes: 2 additions & 1 deletion main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions runner-manager/.profile
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
1 change: 1 addition & 0 deletions sandbox-deploy/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
12 changes: 12 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading