From c908a3eda97b3917bc3909ba53729acbbe2b4c9f Mon Sep 17 00:00:00 2001 From: i504454 Date: Thu, 25 Jan 2024 16:55:22 +0200 Subject: [PATCH 1/4] ads cpu weight config options --- jobs/cloud_controller_ng/spec | 6 ++++++ .../templates/cloud_controller_ng.yml.erb | 2 ++ 2 files changed, 8 insertions(+) diff --git a/jobs/cloud_controller_ng/spec b/jobs/cloud_controller_ng/spec index ac02124d5c..255ba2e2d7 100644 --- a/jobs/cloud_controller_ng/spec +++ b/jobs/cloud_controller_ng/spec @@ -755,6 +755,12 @@ properties: default: false description: "Skip validations of database encryption properties" + cc.cpu_weight_min_memory: + default: 128 + description: "The default minimum application instance memory used for the CPU weight calculation" + cc.cpu_weight_max_memory: + default: 8192 + description: "The default maximum application instance memory used for the CPU weight calculation" cc.default_app_memory: default: 1024 description: "How much memory given to an app if not specified" diff --git a/jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb b/jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb index 0fe1ea6f09..33e0767d32 100644 --- a/jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb +++ b/jobs/cloud_controller_ng/templates/cloud_controller_ng.yml.erb @@ -94,6 +94,8 @@ jobs: priorities: <%= priorities.to_json %> <% end %> +cpu_weight_min_memory: <%= p("cc.cpu_weight_min_memory") %> +cpu_weight_max_memory: <%= p("cc.cpu_weight_max_memory") %> default_app_memory: <%= p("cc.default_app_memory") %> default_app_disk_in_mb: <%= p("cc.default_app_disk_in_mb") %> maximum_app_disk_in_mb: <%= p("cc.maximum_app_disk_in_mb") %> From 2d99bd8611530e66c0744a3c3045d3cb754e5b42 Mon Sep 17 00:00:00 2001 From: i504454 Date: Tue, 30 Jan 2024 12:52:23 +0200 Subject: [PATCH 2/4] add the properties to worker, deployment_updater and clock config files --- jobs/cc_deployment_updater/spec | 6 ++++++ .../templates/cloud_controller_ng.yml.erb | 2 ++ jobs/cloud_controller_clock/spec | 6 ++++++ .../templates/cloud_controller_ng.yml.erb | 2 ++ jobs/cloud_controller_ng/spec | 2 ++ jobs/cloud_controller_worker/spec | 6 ++++++ .../templates/cloud_controller_ng.yml.erb | 2 ++ 7 files changed, 26 insertions(+) diff --git a/jobs/cc_deployment_updater/spec b/jobs/cc_deployment_updater/spec index 023a76203b..7465a10e87 100644 --- a/jobs/cc_deployment_updater/spec +++ b/jobs/cc_deployment_updater/spec @@ -190,6 +190,12 @@ properties: description: "How often to update deployments by rolling instances" default: 5 + cc.cpu_weight_min_memory: + default: 128 + description: "The default minimum application instance memory used for the CPU weight calculation" + cc.cpu_weight_max_memory: + default: 8192 + description: "The default maximum application instance memory used for the CPU weight calculation" cc.default_app_memory: default: 1024 description: "How much memory given to an app if not specified" diff --git a/jobs/cc_deployment_updater/templates/cloud_controller_ng.yml.erb b/jobs/cc_deployment_updater/templates/cloud_controller_ng.yml.erb index ac36596044..3e67563d40 100644 --- a/jobs/cc_deployment_updater/templates/cloud_controller_ng.yml.erb +++ b/jobs/cc_deployment_updater/templates/cloud_controller_ng.yml.erb @@ -129,6 +129,8 @@ diego: receive_timeout: <%= p("cc.diego.bbs.receive_timeout") %> pid_limit: <%= p("cc.diego.pid_limit") %> +cpu_weight_min_memory: <%= p("cc.cpu_weight_min_memory") %> +cpu_weight_max_memory: <%= p("cc.cpu_weight_max_memory") %> default_app_memory: <%= p("cc.default_app_memory") %> default_app_disk_in_mb: <%= p("cc.default_app_disk_in_mb") %> maximum_app_disk_in_mb: <%= p("cc.maximum_app_disk_in_mb") %> diff --git a/jobs/cloud_controller_clock/spec b/jobs/cloud_controller_clock/spec index 22b647c5a9..408d5209eb 100644 --- a/jobs/cloud_controller_clock/spec +++ b/jobs/cloud_controller_clock/spec @@ -402,6 +402,12 @@ properties: default: "" description: "current key label for encrypting values in the CC database" + cc.cpu_weight_min_memory: + default: 128 + description: "The default minimum application instance memory used for the CPU weight calculation" + cc.cpu_weight_max_memory: + default: 8192 + description: "The default maximum application instance memory used for the CPU weight calculation" cc.default_app_memory: default: 1024 description: "How much memory given to an app if not specified" diff --git a/jobs/cloud_controller_clock/templates/cloud_controller_ng.yml.erb b/jobs/cloud_controller_clock/templates/cloud_controller_ng.yml.erb index de212cd730..5438a90a91 100644 --- a/jobs/cloud_controller_clock/templates/cloud_controller_ng.yml.erb +++ b/jobs/cloud_controller_clock/templates/cloud_controller_ng.yml.erb @@ -63,6 +63,8 @@ jobs: priorities: <%= priorities.to_json %> <% end %> +cpu_weight_min_memory: <%= p("cc.cpu_weight_min_memory") %> +cpu_weight_max_memory: <%= p("cc.cpu_weight_max_memory") %> default_app_memory: <%= p("cc.default_app_memory") %> default_app_disk_in_mb: <%= p("cc.default_app_disk_in_mb") %> maximum_app_disk_in_mb: <%= p("cc.maximum_app_disk_in_mb") %> diff --git a/jobs/cloud_controller_ng/spec b/jobs/cloud_controller_ng/spec index 255ba2e2d7..55d2f11f17 100644 --- a/jobs/cloud_controller_ng/spec +++ b/jobs/cloud_controller_ng/spec @@ -131,6 +131,8 @@ provides: - cc.buildpacks.webdav_config.private_endpoint - cc.buildpacks.webdav_config.public_endpoint - cc.buildpacks.webdav_config.username + - cc.cpu_weight_min_memory + - cc.cpu_weight_max_memory - cc.credential_references.interpolate_service_bindings - cc.custom_metric_tag_prefix_list - cc.database_encryption.current_key_label diff --git a/jobs/cloud_controller_worker/spec b/jobs/cloud_controller_worker/spec index 2c87835c3b..664759dd70 100644 --- a/jobs/cloud_controller_worker/spec +++ b/jobs/cloud_controller_worker/spec @@ -344,6 +344,12 @@ properties: default: "" description: "current key label for encrypting values in the CC database" + cc.cpu_weight_min_memory: + default: 128 + description: "The default minimum application instance memory used for the CPU weight calculation" + cc.cpu_weight_max_memory: + default: 8192 + description: "The default maximum application instance memory used for the CPU weight calculation" cc.default_app_memory: default: 1024 description: "How much memory given to an app if not specified" diff --git a/jobs/cloud_controller_worker/templates/cloud_controller_ng.yml.erb b/jobs/cloud_controller_worker/templates/cloud_controller_ng.yml.erb index db2e0b56ad..a550ac50e4 100644 --- a/jobs/cloud_controller_worker/templates/cloud_controller_ng.yml.erb +++ b/jobs/cloud_controller_worker/templates/cloud_controller_ng.yml.erb @@ -54,6 +54,8 @@ jobs: priorities: <%= priorities.to_json %> <% end %> +cpu_weight_min_memory: <%= p("cc.cpu_weight_min_memory") %> +cpu_weight_max_memory: <%= p("cc.cpu_weight_max_memory") %> default_app_memory: <%= p("cc.default_app_memory") %> default_app_disk_in_mb: <%= p("cc.default_app_disk_in_mb") %> maximum_app_disk_in_mb: <%= p("cc.maximum_app_disk_in_mb") %> From 317950d9ff9e3dc4c01f8bcb3ae48e4db83e6cb1 Mon Sep 17 00:00:00 2001 From: i504454 Date: Thu, 1 Feb 2024 10:20:36 +0200 Subject: [PATCH 3/4] access properties by link --- jobs/cc_deployment_updater/spec | 6 ------ .../templates/cloud_controller_ng.yml.erb | 4 ++-- jobs/cloud_controller_clock/spec | 6 ------ .../templates/cloud_controller_ng.yml.erb | 4 ++-- jobs/cloud_controller_worker/spec | 6 ------ .../templates/cloud_controller_ng.yml.erb | 4 ++-- 6 files changed, 6 insertions(+), 24 deletions(-) diff --git a/jobs/cc_deployment_updater/spec b/jobs/cc_deployment_updater/spec index 7465a10e87..023a76203b 100644 --- a/jobs/cc_deployment_updater/spec +++ b/jobs/cc_deployment_updater/spec @@ -190,12 +190,6 @@ properties: description: "How often to update deployments by rolling instances" default: 5 - cc.cpu_weight_min_memory: - default: 128 - description: "The default minimum application instance memory used for the CPU weight calculation" - cc.cpu_weight_max_memory: - default: 8192 - description: "The default maximum application instance memory used for the CPU weight calculation" cc.default_app_memory: default: 1024 description: "How much memory given to an app if not specified" diff --git a/jobs/cc_deployment_updater/templates/cloud_controller_ng.yml.erb b/jobs/cc_deployment_updater/templates/cloud_controller_ng.yml.erb index 3e67563d40..9d1a750190 100644 --- a/jobs/cc_deployment_updater/templates/cloud_controller_ng.yml.erb +++ b/jobs/cc_deployment_updater/templates/cloud_controller_ng.yml.erb @@ -129,8 +129,6 @@ diego: receive_timeout: <%= p("cc.diego.bbs.receive_timeout") %> pid_limit: <%= p("cc.diego.pid_limit") %> -cpu_weight_min_memory: <%= p("cc.cpu_weight_min_memory") %> -cpu_weight_max_memory: <%= p("cc.cpu_weight_max_memory") %> default_app_memory: <%= p("cc.default_app_memory") %> default_app_disk_in_mb: <%= p("cc.default_app_disk_in_mb") %> maximum_app_disk_in_mb: <%= p("cc.maximum_app_disk_in_mb") %> @@ -274,4 +272,6 @@ statsd_port: <%= link("cloud_controller_internal").p("cc.statsd_port") %> max_labels_per_resource: <%= link("cloud_controller_internal").p("cc.max_labels_per_resource") %> max_annotations_per_resource: <%= link("cloud_controller_internal").p("cc.max_annotations_per_resource") %> +cpu_weight_min_memory: <%= link("cloud_controller_internal").p("cc.cpu_weight_min_memory") %> +cpu_weight_max_memory: <%= link("cloud_controller_internal").p("cc.cpu_weight_max_memory") %> custom_metric_tag_prefix_list: <%= link("cloud_controller_internal").p("cc.custom_metric_tag_prefix_list") %> diff --git a/jobs/cloud_controller_clock/spec b/jobs/cloud_controller_clock/spec index 408d5209eb..22b647c5a9 100644 --- a/jobs/cloud_controller_clock/spec +++ b/jobs/cloud_controller_clock/spec @@ -402,12 +402,6 @@ properties: default: "" description: "current key label for encrypting values in the CC database" - cc.cpu_weight_min_memory: - default: 128 - description: "The default minimum application instance memory used for the CPU weight calculation" - cc.cpu_weight_max_memory: - default: 8192 - description: "The default maximum application instance memory used for the CPU weight calculation" cc.default_app_memory: default: 1024 description: "How much memory given to an app if not specified" diff --git a/jobs/cloud_controller_clock/templates/cloud_controller_ng.yml.erb b/jobs/cloud_controller_clock/templates/cloud_controller_ng.yml.erb index 5438a90a91..37ca7b31ac 100644 --- a/jobs/cloud_controller_clock/templates/cloud_controller_ng.yml.erb +++ b/jobs/cloud_controller_clock/templates/cloud_controller_ng.yml.erb @@ -63,8 +63,6 @@ jobs: priorities: <%= priorities.to_json %> <% end %> -cpu_weight_min_memory: <%= p("cc.cpu_weight_min_memory") %> -cpu_weight_max_memory: <%= p("cc.cpu_weight_max_memory") %> default_app_memory: <%= p("cc.default_app_memory") %> default_app_disk_in_mb: <%= p("cc.default_app_disk_in_mb") %> maximum_app_disk_in_mb: <%= p("cc.maximum_app_disk_in_mb") %> @@ -354,4 +352,6 @@ statsd_port: <%= link("cloud_controller_internal").p("cc.statsd_port") %> max_labels_per_resource: <%= link("cloud_controller_internal").p("cc.max_labels_per_resource") %> max_annotations_per_resource: <%= link("cloud_controller_internal").p("cc.max_annotations_per_resource") %> +cpu_weight_min_memory: <%= link("cloud_controller_internal").p("cc.cpu_weight_min_memory") %> +cpu_weight_max_memory: <%= link("cloud_controller_internal").p("cc.cpu_weight_max_memory") %> custom_metric_tag_prefix_list: <%= link("cloud_controller_internal").p("cc.custom_metric_tag_prefix_list") %> diff --git a/jobs/cloud_controller_worker/spec b/jobs/cloud_controller_worker/spec index 664759dd70..2c87835c3b 100644 --- a/jobs/cloud_controller_worker/spec +++ b/jobs/cloud_controller_worker/spec @@ -344,12 +344,6 @@ properties: default: "" description: "current key label for encrypting values in the CC database" - cc.cpu_weight_min_memory: - default: 128 - description: "The default minimum application instance memory used for the CPU weight calculation" - cc.cpu_weight_max_memory: - default: 8192 - description: "The default maximum application instance memory used for the CPU weight calculation" cc.default_app_memory: default: 1024 description: "How much memory given to an app if not specified" diff --git a/jobs/cloud_controller_worker/templates/cloud_controller_ng.yml.erb b/jobs/cloud_controller_worker/templates/cloud_controller_ng.yml.erb index a550ac50e4..f7fee73aa4 100644 --- a/jobs/cloud_controller_worker/templates/cloud_controller_ng.yml.erb +++ b/jobs/cloud_controller_worker/templates/cloud_controller_ng.yml.erb @@ -54,8 +54,6 @@ jobs: priorities: <%= priorities.to_json %> <% end %> -cpu_weight_min_memory: <%= p("cc.cpu_weight_min_memory") %> -cpu_weight_max_memory: <%= p("cc.cpu_weight_max_memory") %> default_app_memory: <%= p("cc.default_app_memory") %> default_app_disk_in_mb: <%= p("cc.default_app_disk_in_mb") %> maximum_app_disk_in_mb: <%= p("cc.maximum_app_disk_in_mb") %> @@ -347,4 +345,6 @@ disable_private_domain_cross_space_context_path_route_sharing: <%= link("cloud_c max_labels_per_resource: <%= link("cloud_controller_internal").p("cc.max_labels_per_resource") %> max_annotations_per_resource: <%= link("cloud_controller_internal").p("cc.max_annotations_per_resource") %> custom_metric_tag_prefix_list: <%= link("cloud_controller_internal").p("cc.custom_metric_tag_prefix_list") %> +cpu_weight_min_memory: <%= link("cloud_controller_internal").p("cc.cpu_weight_min_memory") %> +cpu_weight_max_memory: <%= link("cloud_controller_internal").p("cc.cpu_weight_max_memory") %> max_manifest_service_binding_poll_duration_in_seconds: <%= p("cc.max_manifest_service_binding_poll_duration_in_seconds") %> From 95ba7425e8bc48e346d3ccdb5c89eae3600ceb00 Mon Sep 17 00:00:00 2001 From: i504454 Date: Thu, 1 Feb 2024 12:13:58 +0200 Subject: [PATCH 4/4] adjust cc clock and worker unit tests --- spec/cloud_controller_clock/cloud_controller_clock_spec.rb | 2 ++ spec/cloud_controller_worker/cloud_controller_worker_spec.rb | 2 ++ 2 files changed, 4 insertions(+) diff --git a/spec/cloud_controller_clock/cloud_controller_clock_spec.rb b/spec/cloud_controller_clock/cloud_controller_clock_spec.rb index 110e65a7f1..dd506042dc 100644 --- a/spec/cloud_controller_clock/cloud_controller_clock_spec.rb +++ b/spec/cloud_controller_clock/cloud_controller_clock_spec.rb @@ -76,6 +76,8 @@ module Test 'max_labels_per_resource' => true, 'max_annotations_per_resource' => 'yus', 'disable_private_domain_cross_space_context_path_route_sharing' => false, + 'cpu_weight_min_memory' => 128, + 'cpu_weight_max_memory' => 8192, 'custom_metric_tag_prefix_list' => ['heck.yes.example.com'] } } diff --git a/spec/cloud_controller_worker/cloud_controller_worker_spec.rb b/spec/cloud_controller_worker/cloud_controller_worker_spec.rb index 8f149b971d..cacd6fb104 100644 --- a/spec/cloud_controller_worker/cloud_controller_worker_spec.rb +++ b/spec/cloud_controller_worker/cloud_controller_worker_spec.rb @@ -74,6 +74,8 @@ module Test 'max_labels_per_resource' => true, 'max_annotations_per_resource' => 'yus', 'disable_private_domain_cross_space_context_path_route_sharing' => false, + 'cpu_weight_min_memory' => 128, + 'cpu_weight_max_memory' => 8192, 'custom_metric_tag_prefix_list' => ['heck.yes.example.com'] } }