diff --git a/config-example.yaml b/config-example.yaml index 2ecb31d..aff326a 100644 --- a/config-example.yaml +++ b/config-example.yaml @@ -7,11 +7,11 @@ worker_type: kube_connfig: ~/.kube/config kube_connfig_context: xx autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 60 - sla_seconds: 300 + slo_seconds: 300 # cover 100% of pending capacity_ratio: 1.0 min_replicas: 1 diff --git a/configs/relengworker-nonprod/config.yml b/configs/relengworker-nonprod/config.yml index 94ae3a4..07530e9 100644 --- a/configs/relengworker-nonprod/config.yml +++ b/configs/relengworker-nonprod/config.yml @@ -5,11 +5,11 @@ worker_types: deployment_namespace: dev-beetmover deployment_name: beetmover-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 120 - sla_seconds: 240 + slo_seconds: 240 capacity_ratio: 1.0 min_replicas: 0 @@ -19,11 +19,11 @@ worker_types: deployment_namespace: dev-balrog deployment_name: balrog-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -33,11 +33,11 @@ worker_types: deployment_namespace: dev-signing deployment_name: signing-dev-relengworker-firefoxci-gecko-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -47,11 +47,11 @@ worker_types: deployment_namespace: dev-addon deployment_name: addon-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -61,11 +61,11 @@ worker_types: deployment_namespace: dev-bouncer deployment_name: bouncer-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -75,11 +75,11 @@ worker_types: deployment_namespace: dev-pushapk deployment_name: pushapk-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -89,11 +89,11 @@ worker_types: deployment_namespace: dev-pushflatpak deployment_name: pushflatpak-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -103,11 +103,11 @@ worker_types: deployment_namespace: dev-pushsnap deployment_name: pushsnap-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -117,11 +117,11 @@ worker_types: deployment_namespace: dev-shipit deployment_name: shipit-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -131,11 +131,11 @@ worker_types: deployment_namespace: dev-shipit deployment_name: shipit-dev-relengworker-firefoxci-mobile-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -145,11 +145,11 @@ worker_types: deployment_namespace: dev-tree deployment_name: tree-dev-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -159,11 +159,11 @@ worker_types: deployment_namespace: dev-signing deployment_name: signing-dev-relengworker-firefoxci-xpi-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -173,11 +173,11 @@ worker_types: deployment_namespace: dev-shipit deployment_name: shipit-dev-relengworker-firefoxci-xpi-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -187,11 +187,11 @@ worker_types: deployment_namespace: dev-signing deployment_name: signing-dev-relengworker-firefoxci-mpd001-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -201,10 +201,10 @@ worker_types: deployment_namespace: dev-signing deployment_name: signing-dev-relengworker-firefoxci-adhoc-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 diff --git a/configs/relengworker-prod/config.yml b/configs/relengworker-prod/config.yml index 137ed13..02b9e65 100644 --- a/configs/relengworker-prod/config.yml +++ b/configs/relengworker-prod/config.yml @@ -6,11 +6,11 @@ worker_types: deployment_namespace: prod-beetmover deployment_name: beetmover-prod-relengworker-firefoxci-applicationservices-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 120 - sla_seconds: 240 + slo_seconds: 240 capacity_ratio: 1.0 min_replicas: 0 @@ -20,11 +20,11 @@ worker_types: deployment_namespace: prod-beetmover deployment_name: beetmover-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 80 avg_task_duration: 120 - sla_seconds: 240 + slo_seconds: 240 capacity_ratio: 1.0 min_replicas: 0 @@ -35,11 +35,11 @@ worker_types: deployment_namespace: prod-beetmover deployment_name: beetmover-prod-relengworker-firefoxci-mobile-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 120 - sla_seconds: 240 + slo_seconds: 240 capacity_ratio: 1.0 min_replicas: 0 @@ -49,11 +49,11 @@ worker_types: deployment_namespace: prod-beetmover deployment_name: beetmover-prod-relengworker-firefoxci-comm-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 5 avg_task_duration: 120 - sla_seconds: 240 + slo_seconds: 240 capacity_ratio: 1.0 min_replicas: 0 @@ -63,11 +63,11 @@ worker_types: deployment_namespace: prod-beetmover deployment_name: beetmover-prod-relengworker-firefoxci-comm-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 120 - sla_seconds: 240 + slo_seconds: 240 capacity_ratio: 1.0 min_replicas: 0 @@ -77,11 +77,11 @@ worker_types: deployment_namespace: prod-beetmover deployment_name: beetmover-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 120 - sla_seconds: 240 + slo_seconds: 240 capacity_ratio: 1.0 min_replicas: 0 @@ -91,11 +91,11 @@ worker_types: deployment_namespace: prod-balrog deployment_name: balrog-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 15 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -105,11 +105,11 @@ worker_types: deployment_namespace: prod-balrog deployment_name: balrog-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -119,11 +119,11 @@ worker_types: deployment_namespace: prod-balrog deployment_name: balrog-prod-relengworker-firefoxci-comm-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -133,11 +133,11 @@ worker_types: deployment_namespace: prod-balrog deployment_name: balrog-prod-relengworker-firefoxci-comm-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -147,11 +147,11 @@ worker_types: deployment_namespace: prod-addon deployment_name: addon-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 240 - sla_seconds: 480 + slo_seconds: 480 capacity_ratio: 1.0 min_replicas: 0 @@ -161,11 +161,11 @@ worker_types: deployment_namespace: prod-addon deployment_name: addon-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 240 - sla_seconds: 480 + slo_seconds: 480 capacity_ratio: 1.0 min_replicas: 0 @@ -175,11 +175,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-gecko-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -189,11 +189,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 100 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -203,11 +203,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-mobile-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -217,11 +217,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-comm-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 20 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -231,11 +231,11 @@ worker_types: deployment_namespace: prod-beetmover deployment_name: beetmover-prod-relengworker-firefoxci-applicationservices-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -245,11 +245,11 @@ worker_types: deployment_namespace: prod-beetmover deployment_name: beetmover-prod-relengworker-firefoxci-mobile-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -259,11 +259,11 @@ worker_types: deployment_namespace: prod-bouncer deployment_name: bouncer-prod-relengworker-firefoxci-comm-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -273,11 +273,11 @@ worker_types: deployment_namespace: prod-bouncer deployment_name: bouncer-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -287,11 +287,11 @@ worker_types: deployment_namespace: prod-bouncer deployment_name: bouncer-prod-relengworker-firefoxci-comm-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -301,11 +301,11 @@ worker_types: deployment_namespace: prod-bouncer deployment_name: bouncer-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -315,11 +315,11 @@ worker_types: deployment_namespace: prod-pushapk deployment_name: pushapk-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -329,11 +329,11 @@ worker_types: deployment_namespace: prod-pushapk deployment_name: pushapk-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -343,11 +343,11 @@ worker_types: deployment_namespace: prod-pushapk deployment_name: pushapk-prod-relengworker-firefoxci-mobile-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -357,11 +357,11 @@ worker_types: deployment_namespace: prod-pushapk deployment_name: pushapk-prod-relengworker-firefoxci-mobile-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -371,11 +371,11 @@ worker_types: deployment_namespace: prod-pushflatpak deployment_name: pushflatpak-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -385,11 +385,11 @@ worker_types: deployment_namespace: prod-pushflatpak deployment_name: pushflatpak-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -399,11 +399,11 @@ worker_types: deployment_namespace: prod-pushsnap deployment_name: pushsnap-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -413,11 +413,11 @@ worker_types: deployment_namespace: prod-pushsnap deployment_name: pushsnap-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -427,11 +427,11 @@ worker_types: deployment_namespace: prod-shipit deployment_name: shipit-prod-relengworker-firefoxci-comm-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -441,11 +441,11 @@ worker_types: deployment_namespace: prod-shipit deployment_name: shipit-prod-relengworker-firefoxci-comm-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -455,11 +455,11 @@ worker_types: deployment_namespace: prod-shipit deployment_name: shipit-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -469,11 +469,11 @@ worker_types: deployment_namespace: prod-shipit deployment_name: shipit-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -483,11 +483,11 @@ worker_types: deployment_namespace: prod-shipit deployment_name: shipit-prod-relengworker-firefoxci-mobile-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -497,11 +497,11 @@ worker_types: deployment_namespace: prod-shipit deployment_name: shipit-prod-relengworker-firefoxci-mobile-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -511,11 +511,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-applicationservices-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -525,11 +525,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-applicationservices-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -539,11 +539,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-comm-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -553,11 +553,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-mobile-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -567,11 +567,11 @@ worker_types: deployment_namespace: prod-tree deployment_name: tree-prod-relengworker-firefoxci-comm-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -581,11 +581,11 @@ worker_types: deployment_namespace: prod-tree deployment_name: tree-prod-relengworker-firefoxci-comm-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -595,11 +595,11 @@ worker_types: deployment_namespace: prod-tree deployment_name: tree-prod-relengworker-firefoxci-gecko-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -609,11 +609,11 @@ worker_types: deployment_namespace: prod-tree deployment_name: tree-prod-relengworker-firefoxci-gecko-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 3 avg_task_duration: 300 - sla_seconds: 600 + slo_seconds: 600 capacity_ratio: 1.0 min_replicas: 0 @@ -623,11 +623,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-xpi-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -637,11 +637,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-xpi-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -651,11 +651,11 @@ worker_types: deployment_namespace: prod-shipit deployment_name: shipit-prod-relengworker-firefoxci-xpi-1-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -665,11 +665,11 @@ worker_types: deployment_namespace: prod-shipit deployment_name: shipit-prod-relengworker-firefoxci-xpi-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 1 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -679,11 +679,11 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-mpd001-t-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 @@ -693,10 +693,10 @@ worker_types: deployment_namespace: prod-signing deployment_name: signing-prod-relengworker-firefoxci-mpd001-3-1 autoscale: - algorithm: sla + algorithm: slo args: max_replicas: 10 avg_task_duration: 60 - sla_seconds: 120 + slo_seconds: 120 capacity_ratio: 1.0 min_replicas: 0 diff --git a/configs/schema.yml b/configs/schema.yml index 0fe4b8a..cf89624 100644 --- a/configs/schema.yml +++ b/configs/schema.yml @@ -50,7 +50,7 @@ definitions: algorithm: type: string enum: - - sla + - slo args: schema: $ref: "#/definitions/args" @@ -63,7 +63,7 @@ definitions: - capacity_ratio - max_replicas - min_replicas - - sla_seconds + - slo_seconds properties: avs_task_duration: type: integer @@ -73,5 +73,5 @@ definitions: type: integer min_replicas: type: integer - sla_seconds: + slo_seconds: type: integer diff --git a/src/k8s_autoscale/main.py b/src/k8s_autoscale/main.py index 066278c..4ea4ba6 100644 --- a/src/k8s_autoscale/main.py +++ b/src/k8s_autoscale/main.py @@ -7,7 +7,7 @@ from taskcluster import Queue from taskcluster.exceptions import TaskclusterRestFailure -from k8s_autoscale.sla import get_new_worker_count +from k8s_autoscale.slo import get_new_worker_count logger = logging.getLogger(__name__) diff --git a/src/k8s_autoscale/sla.py b/src/k8s_autoscale/slo.py similarity index 82% rename from src/k8s_autoscale/sla.py rename to src/k8s_autoscale/slo.py index b3c6899..13e0abc 100644 --- a/src/k8s_autoscale/sla.py +++ b/src/k8s_autoscale/slo.py @@ -3,17 +3,17 @@ def get_new_worker_count(pending, running, args): # TODO: verify all the args - assert args["sla_seconds"] > args["avg_task_duration"] + assert args["slo_seconds"] > args["avg_task_duration"] # In case we don't want to cover all the pending tasks pending = int(math.ceil(pending * args["capacity_ratio"])) # Scale down only when we have no pending tasks if pending == 0: return -running # How many tasks a replica can process within our tolerance period - new_tasks_per_replica = math.floor(args["sla_seconds"] / args["avg_task_duration"]) + new_tasks_per_replica = math.floor(args["slo_seconds"] / args["avg_task_duration"]) # how many tasks can be covered by the running replicas, assuming they are # busy and can only take new tasks after they are done with the current one - running_tasks_per_replica = math.floor(args["sla_seconds"] / args["avg_task_duration"]) - 1 + running_tasks_per_replica = math.floor(args["slo_seconds"] / args["avg_task_duration"]) - 1 running_can_cover = running * running_tasks_per_replica still_pending = pending - running_can_cover if still_pending > 0: diff --git a/tests/test_sla.py b/tests/test_sla.py index f22a389..926871f 100644 --- a/tests/test_sla.py +++ b/tests/test_sla.py @@ -1,8 +1,8 @@ import pytest -from k8s_autoscale.sla import get_new_worker_count +from k8s_autoscale.slo import get_new_worker_count -args = {"max_replicas": 10, "avg_task_duration": 60, "sla_seconds": 300, "capacity_ratio": 1.0} +args = {"max_replicas": 10, "avg_task_duration": 60, "slo_seconds": 300, "capacity_ratio": 1.0} args_capacity = args.copy() args_capacity["capacity_ratio"] = 0.5 @@ -29,7 +29,7 @@ def test_process(pending, running, args, expected): @pytest.mark.parametrize( "pending, running, args, exception_type", - [(0, 0, {"sla_seconds": 10, "avg_task_duration": 20}, AssertionError)], + [(0, 0, {"slo_seconds": 10, "avg_task_duration": 20}, AssertionError)], ) def test_process_raises(pending, running, args, exception_type): with pytest.raises(exception_type):