From 3fdc635dd42c756a5668774260228c68689ffe4a Mon Sep 17 00:00:00 2001 From: Pavel Raiskup Date: Sun, 23 May 2021 22:40:48 +0200 Subject: [PATCH] copr-be: simplify VM quota --- inventory/group_vars/copr_dev_aws | 19 ++++++++---------- roles/copr/backend/tasks/main.yml | 6 +----- roles/copr/backend/templates/copr-be.conf.j2 | 7 ++++--- .../backend/templates/resalloc/pools.yaml | 20 +++++++------------ 4 files changed, 20 insertions(+), 32 deletions(-) diff --git a/inventory/group_vars/copr_dev_aws b/inventory/group_vars/copr_dev_aws index 611759b6d3..95ac07ecd9 100644 --- a/inventory/group_vars/copr_dev_aws +++ b/inventory/group_vars/copr_dev_aws @@ -29,26 +29,23 @@ nm_controlled_resolv: True builders: # max|max_spawn|max_prealloc aws: - x86_64: [4,1,1] - armhfp: [2,0,0] - s390x: [2,0,0] - aarch64: [2,1,1] + x86_64: [4, 1, 1] + aarch64: [2, 1, 1] + aws_spot: - x86_64: [5,2,3] - armhfp: [2,0,0] - s390x: [1,0,0] - aarch64: [5,2,2] + x86_64: [5, 2, 3] + aarch64: [5, 2, 2] #x86_hypervisor_01: # x86_64: [2,1,1] x86_hypervisor_02: - x86_64: [2,1,1] + x86_64: [2, 1, 1] x86_hypervisor_03: - x86_64: [2,1,1] + x86_64: [2, 1, 1] x86_hypervisor_04: - x86_64: [2,1,1] + x86_64: [2, 1, 1] rpm_vendor_copr_name: Fedora Copr (devel) diff --git a/roles/copr/backend/tasks/main.yml b/roles/copr/backend/tasks/main.yml index 22bc213483..5915005e9f 100644 --- a/roles/copr/backend/tasks/main.yml +++ b/roles/copr/backend/tasks/main.yml @@ -167,14 +167,12 @@ set_fact: "max_{{ item }}_workers={{ builders | community.general.json_query('*.'+item+'[0]') | sum() }}" with_items: - x86_64 - - armhfp - - s390x - aarch64 tags: - provision_config - name: calculate max number of workers - set_fact: "max_workers={{ max_x86_64_workers|int + max_armhfp_workers|int + max_s390x_workers|int + max_aarch64_workers|int }}" + set_fact: "max_workers={{ max_x86_64_workers|int + max_aarch64_workers|int }}" tags: - provision_config @@ -182,8 +180,6 @@ debug: "var=max_{{ item }}_workers" with_items: - x86_64 - - armhfp - - s390x - aarch64 tags: - provision_config diff --git a/roles/copr/backend/templates/copr-be.conf.j2 b/roles/copr/backend/templates/copr-be.conf.j2 index 06986e33ac..dab60b1baa 100644 --- a/roles/copr/backend/templates/copr-be.conf.j2 +++ b/roles/copr/backend/templates/copr-be.conf.j2 @@ -40,12 +40,13 @@ sleeptime=20 # be taken at the same time. builds_max_workers={{ max_workers }} -# Maximum number of concurrently running tasks per architecture. +# Maximum number of concurrently running tasks per architecture. Since we +# emulate s390x and armhfp on x86_64, we give it ~25% of the x86_64 quota. builds_max_workers_arch= x86_64={{ max_x86_64_workers }}, aarch64={{ max_aarch64_workers }}, - armhfp={{ max_armhfp_workers }}, - s390x={{ max_s390x_workers }} + armhfp={{ (max_x86_64_workers|int / 4)|int }}, + s390x={{ (max_x86_64_workers|int / 4)|int }}, # Maximum number of concurrently running tasks per project owner. {% if env == 'production' %} diff --git a/roles/copr/backend/templates/resalloc/pools.yaml b/roles/copr/backend/templates/resalloc/pools.yaml index f9b1e36ab1..af23fabee5 100644 --- a/roles/copr/backend/templates/resalloc/pools.yaml +++ b/roles/copr/backend/templates/resalloc/pools.yaml @@ -112,24 +112,18 @@ aarch64_{{ id }}_{{ inst }}: - arch_aarch64_native {% endmacro %} -{{ aws_x86_64(builders.aws.x86_64[0] + builders.aws.armhfp[0] + builders.aws.s390x[0], - builders.aws.x86_64[1] + builders.aws.armhfp[1] + builders.aws.s390x[1], - builders.aws.x86_64[2] + builders.aws.armhfp[2] + builders.aws.s390x[2]) +{{ aws_x86_64(builders.aws.x86_64[0], builders.aws.x86_64[1], + builders.aws.x86_64[2]) }} -{{ aws_aarch64(builders.aws.aarch64[0], - builders.aws.aarch64[1], +{{ aws_aarch64(builders.aws.aarch64[0], builders.aws.aarch64[1], builders.aws.aarch64[2]) }} -{{ aws_x86_64(builders.aws_spot.x86_64[0] + builders.aws_spot.armhfp[0] + builders.aws_spot.s390x[0], - builders.aws_spot.x86_64[1] + builders.aws_spot.armhfp[1] + builders.aws_spot.s390x[1], - builders.aws_spot.x86_64[2] + builders.aws_spot.armhfp[2] + builders.aws_spot.s390x[2], - True) +{{ aws_x86_64(builders.aws_spot.x86_64[0], builders.aws_spot.x86_64[1], + builders.aws_spot.x86_64[2], True) }} -{{ aws_aarch64(builders.aws_spot.aarch64[0], - builders.aws_spot.aarch64[1], - builders.aws_spot.aarch64[2], - True) +{{ aws_aarch64(builders.aws_spot.aarch64[0], builders.aws_spot.aarch64[1], + builders.aws_spot.aarch64[2], True) }} {% if env == "production" %}