From a326e85f76cfd6f720810ade146e5e76f5d8fd5e Mon Sep 17 00:00:00 2001 From: marcelorobj Date: Mon, 15 Sep 2025 10:21:53 -0300 Subject: [PATCH 1/8] feat: added integration tests to the CI for HTC --- build/int.cloudbuild.htc.yaml | 199 ++++++++++++++++++++++++++++++++++ 1 file changed, 199 insertions(+) create mode 100644 build/int.cloudbuild.htc.yaml diff --git a/build/int.cloudbuild.htc.yaml b/build/int.cloudbuild.htc.yaml new file mode 100644 index 000000000..3af6fbd1d --- /dev/null +++ b/build/int.cloudbuild.htc.yaml @@ -0,0 +1,199 @@ +# Copyright 2024 Google LLC +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# https://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +timeout: 14400s +steps: + - id: prepare + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + [ + "/bin/bash", + "-c", + "source /usr/local/bin/task_helper_functions.sh && prepare_environment", + ] + env: + - "TF_VAR_org_id=$_ORG_ID" + - "TF_VAR_folder_id=$_FOLDER_ID" + - "TF_VAR_billing_account=$_BILLING_ACCOUNT" + - "TF_VAR_create_cloud_nat=true" # config-sync running on cluster VPC needs to access gitlab + + - id: private-workerpool-init + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestPrivateWorkerPool --stage init --verbose"] + + - id: private-workerpool-apply + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestPrivateWorkerPool --stage apply --verbose"] + + - id: logging-bucket-init + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestLoggingBucket --stage init --verbose"] + + - id: logging-bucket-apply + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestLoggingBucket --stage apply --verbose"] + + - id: gitlab-init + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestGitLab --stage init --verbose"] + + - id: gitlab-apply + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestGitLab --stage apply --verbose"] + + - id: harness-init + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestSingleProjectHarness --stage init --verbose"] + + - id: harness-apply + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestSingleProjectHarness --stage apply --verbose"] + + - id: wait-startup-script + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestValidateStartupScript --stage verify --verbose"] + + - id: bootstrap-gitlab-vm + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + entrypoint: "bash" + args: + - "-c" + - |- + gcloud storage cp gs://$(terraform -chdir=/workspace/test/setup/harness/gitlab output -raw gitlab_ssl_bucket_name)/gitlab.crt /usr/local/share/ca-certificates + update-ca-certificates + if (ls /etc/ssl/certs | grep gitlab.pem); then + cft test run TestBootstrapGitlabVM --stage verify --verbose || exit 1 + else + echo ERROR: Was not able to download certificate and update system bundle. && exit 1 + fi + + - id: vpc-sc + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + [ + "/bin/bash", + "-c", + "cft test run TestVPCSC --stage init --verbose && cft test run TestVPCSC --stage apply --verbose", + ] + env: + - "TF_VAR_org_id=$_ORG_ID" + + - id: single-project-init + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + [ + "/bin/bash", + "-c", + "cft test run TestStandaloneHTCExample --stage init --verbose", + ] + + - id: single-project-apply + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + [ + "/bin/bash", + "-c", + "cft test run TestStandaloneHTCExample --stage apply --verbose", + ] + + - id: single-project-verify + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + [ + "/bin/bash", + "-c", + "cft test run TestStandaloneHTCExample --stage verify --verbose || (cft test run TestStandaloneHTCExample --stage apply --verbose && cft test run TestStandaloneHTCExample --stage verify --verbose)", + ] + + - id: single-project-app-deployment + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + entrypoint: "bash" + args: + - "-c" + - |- + gcloud storage cp gs://$(terraform -chdir=/workspace/test/setup/harness/gitlab output -raw gitlab_ssl_bucket_name)/gitlab.crt /usr/local/share/ca-certificates + update-ca-certificates + if (ls /etc/ssl/certs | grep gitlab.pem); then + cft test run TestSingleProjectSourceCymbalBank --stage verify --verbose || exit 1 + else + echo ERROR: Was not able to download certificate and update system bundle. && exit 1 + fi + + - id: single-project-teardown + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + [ + "/bin/bash", + "-c", + "cft test run TestStandaloneHTCExample --stage teardown --verbose", + ] + + - id: vpcsc-teardown + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + [ + "/bin/bash", + "-c", + "cft test run TestVPCSC --stage teardown --verbose", + ] + + - id: harness-teardown + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + [ + "/bin/bash", + "-c", + "cft test run TestSingleProjectHarness --stage teardown --verbose", + ] + + - id: gitlab-teardown + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestGitLab --stage teardown --verbose"] + + - id: private-workerpool-teardown + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestPrivateWorkerPool --stage teardown --verbose"] + + - id: logging-bucket-teardown + name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" + args: + ["/bin/bash", "-c", "cft test run TestLoggingBucket --stage teardown --verbose"] + +tags: + - "ci" + - "integration" +substitutions: + _DOCKER_IMAGE_DEVELOPER_TOOLS: "cft/developer-tools" + _DOCKER_TAG_VERSION_DEVELOPER_TOOLS: "1.25" +options: + machineType: E2_HIGHCPU_8 + env: + - 'TF_PLUGIN_CACHE_DIR=""' + - 'TF_VAR_branch_name=$BRANCH_NAME' + - "TF_VAR_service_perimeter_mode=ENFORCE" + - "TF_VAR_deletion_protection=false" + - "TF_VAR_cloud_build_sa=$SERVICE_ACCOUNT_EMAIL" + - "TF_VAR_single_project=true" + - "TF_VAR_hpc=false" From 94c84799aab0fbcff5fb6187f6de87a4cb9c9036 Mon Sep 17 00:00:00 2001 From: marcelorobj Date: Mon, 15 Sep 2025 10:25:39 -0300 Subject: [PATCH 2/8] fix: updating ids on yaml file --- build/int.cloudbuild.htc.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/build/int.cloudbuild.htc.yaml b/build/int.cloudbuild.htc.yaml index 3af6fbd1d..c597981dd 100644 --- a/build/int.cloudbuild.htc.yaml +++ b/build/int.cloudbuild.htc.yaml @@ -98,7 +98,7 @@ steps: env: - "TF_VAR_org_id=$_ORG_ID" - - id: single-project-init + - id: single-project-htc-init name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" args: [ @@ -107,7 +107,7 @@ steps: "cft test run TestStandaloneHTCExample --stage init --verbose", ] - - id: single-project-apply + - id: single-project-htc-apply name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" args: [ @@ -116,7 +116,7 @@ steps: "cft test run TestStandaloneHTCExample --stage apply --verbose", ] - - id: single-project-verify + - id: single-project-htc-verify name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" args: [ @@ -125,7 +125,7 @@ steps: "cft test run TestStandaloneHTCExample --stage verify --verbose || (cft test run TestStandaloneHTCExample --stage apply --verbose && cft test run TestStandaloneHTCExample --stage verify --verbose)", ] - - id: single-project-app-deployment + - id: single-project-htc-app-deployment name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" entrypoint: "bash" args: @@ -139,7 +139,7 @@ steps: echo ERROR: Was not able to download certificate and update system bundle. && exit 1 fi - - id: single-project-teardown + - id: single-project-htc-teardown name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" args: [ From b600998c1ac0b11456b46651b6bea760eddc4a7d Mon Sep 17 00:00:00 2001 From: marcelorobj Date: Mon, 22 Sep 2025 10:07:41 -0300 Subject: [PATCH 3/8] fix: updated go mod/sum files to latest, downgraded gke cluster configuration to minimum required and removed all but one load test --- build/int.cloudbuild.htc.yaml | 2 +- .../5-appinfra.tf | 19 +----- .../modules/config_apply/k8s/hpa.yaml.templ | 14 ++--- .../agent/src/go.mod | 32 +++++----- .../agent/src/go.sum | 2 +- .../modules/gke-standard/main.tf | 59 ++++--------------- .../modules/gke-standard/variables.tf | 14 ++--- .../modules/infrastructure/variables.tf | 14 ++--- .../src/go.mod | 28 ++++----- .../src/go.sum | 26 ++++---- .../variables.tf | 12 ++-- 11 files changed, 87 insertions(+), 135 deletions(-) diff --git a/build/int.cloudbuild.htc.yaml b/build/int.cloudbuild.htc.yaml index c597981dd..c38eb0926 100644 --- a/build/int.cloudbuild.htc.yaml +++ b/build/int.cloudbuild.htc.yaml @@ -122,7 +122,7 @@ steps: [ "/bin/bash", "-c", - "cft test run TestStandaloneHTCExample --stage verify --verbose || (cft test run TestStandaloneHTCExample --stage apply --verbose && cft test run TestStandaloneHTCExample --stage verify --verbose)", + "cft test run TestStandaloneHTCExample --stage verify --verbose", ] - id: single-project-htc-app-deployment diff --git a/examples/high-throughput-compute-standalone/5-appinfra.tf b/examples/high-throughput-compute-standalone/5-appinfra.tf index 7db79710e..77e6b48b5 100644 --- a/examples/high-throughput-compute-standalone/5-appinfra.tf +++ b/examples/high-throughput-compute-standalone/5-appinfra.tf @@ -16,26 +16,11 @@ locals { workload_args = ["serve", "--logJSON"] workload_grpc_endpoint = "http://localhost:2002/main.LoadTestService/RunLibrary" workload_init_args = [ - ["writedata", "--logJSON", "--showProgress=false", "--size", "104857600", "--parallel", "2", "--count", "10", "/data/read_dir/large"], - ["writedata", "--logJSON", "--showProgress=false", "--size", "10485760", "--parallel", "20", "--count", "100", "/data/read_dir/medium"], - ["writedata", "--logJSON", "--showProgress=false", "--size", "1048576", "--parallel", "20", "--count", "1000", "/data/read_dir/small"], ["writedata", "--logJSON", "--showProgress=false", "--size", "1048576", "--parallel", "20", "--count", "5", "/data/read_dir/small-low"], - ["gentasks", "--logJSON", "--count=10000", "--initMinMicros=1000000", "--minMicros=1000000", "--initReadDir=/data/read_dir/small", "/data/tasks/10k_1s_1s_read_small.jsonl.gz"], ["gentasks", "--logJSON", "--count=1000", "--initMinMicros=1000000", "--minMicros=1000000", "--initReadDir=/data/read_dir/small", "/data/tasks/1k_1s_1s_read_small.jsonl.gz"], - ["gentasks", "--logJSON", "--count=5000000", "--initMinMicros=30000000", "--minMicros=240000000", "--minMicros=360000000", "--initReadDir=/data/read_dir/small-low", "/data/tasks/5m_30s_360s_read_5_small.jsonl.gz"], ] test_configs = [ { name = "hpa_1k_1s_s_read_small", testfile = "/data/tasks/1k_1s_1s_read_small.jsonl.gz", parallel = 0, description = "Autoscaling workers, 1 second compute and small folder read on initialization, 1,000 tasks for 1 second task compute." }, - { name = "10_1k_1s_s_read_small", testfile = "/data/tasks/1k_1s_1s_read_small.jsonl.gz", parallel = 10, description = "10 workers, 1 second compute and small folder read on initialization, 1,000 tasks for 1 second compute." }, - { name = "50_1k_1s_s_read_small", testfile = "/data/tasks/1k_1s_1s_read_small.jsonl.gz", parallel = 50, description = "50 workers, 1 second compute and small folder read on initialization, 1,000 tasks for 1 second compute." }, - { name = "100_1k_1s_s_read_small", testfile = "/data/tasks/1k_1s_1s_read_small.jsonl.gz", parallel = 100, description = "100 workers, 1 second compute and small folder read on initialization, 1,000 tasks for 1 second compute." }, - { name = "500_1k_1s_s_read_small", testfile = "/data/tasks/1k_1s_1s_read_small.jsonl.gz", parallel = 500, description = "500 workers, 1 second compute and small folder read on initialization, 1,000 tasks for 1 second compute." }, - { name = "hpa_10k_1s_s_read_small", testfile = "/data/tasks/10k_1s_1s_read_small.jsonl.gz", parallel = 0, description = "Autoscaling workers, 1 second compute and small folder read on initialization, 10,000 tasks for 1 second compute." }, - { name = "10_10k_1s_s_read_small", testfile = "/data/tasks/10k_1s_1s_read_small.jsonl.gz", parallel = 10, description = "10 workers, 1 second compute and small folder read on initialization, 10,000 tasks for 1 second compute." }, - { name = "100_10k_1s_s_read_small", testfile = "/data/tasks/10k_1s_1s_read_small.jsonl.gz", parallel = 100, description = "100 workers, 1 second compute and small folder read on initialization, 10,000 tasks for 1 second compute." }, - { name = "500_10k_1s_s_read_small", testfile = "/data/tasks/10k_1s_1s_read_small.jsonl.gz", parallel = 500, description = "500 workers, 1 second compute and small folder read on initialization, 10,000 tasks for 1 second compute." }, - { name = "30000_5m_10s_s_read_small", testfile = "/data/tasks/5m_1s_3s_read_5_small.jsonl.gz", parallel = 30000, description = "30000 workers, 10 second compute and small folder read on initialization, 5 million tasks for 20-35 seconds of compute." }, - { name = "hpa_5m_360s_s_read_small", testfile = "/data/tasks/5m_30s_360s_read_5_small.jsonl.gz", parallel = 0, description = "Autoscaling workers, 10 second compute and small folder read on initialization, 5 million tasks for 20-35 second compute." }, ] test_configs_dict = { for config in local.test_configs : @@ -212,14 +197,14 @@ resource "google_logging_project_bucket_config" "analytics-enabled-bucket" { project = var.project_id location = module.default_region.default_region enable_analytics = true - bucket_id = "applogs" + bucket_id = "appLogsTest" lifecycle { ignore_changes = [project] } } resource "google_logging_linked_dataset" "logging_linked_dataset" { - link_id = "applogs" + link_id = "appLogsTest" bucket = google_logging_project_bucket_config.analytics-enabled-bucket.id description = "Linked dataset test" depends_on = [ diff --git a/examples/high-throughput-compute-standalone/agent/modules/config_apply/k8s/hpa.yaml.templ b/examples/high-throughput-compute-standalone/agent/modules/config_apply/k8s/hpa.yaml.templ index 1d78b32df..d53a84121 100644 --- a/examples/high-throughput-compute-standalone/agent/modules/config_apply/k8s/hpa.yaml.templ +++ b/examples/high-throughput-compute-standalone/agent/modules/config_apply/k8s/hpa.yaml.templ @@ -18,8 +18,8 @@ metadata: name: ${name} spec: minReplicas: 1 - maxReplicas: 50000 - maxReplicas: 50000 + maxReplicas: 2 + maxReplicas: 2 metrics: - external: metric: @@ -87,13 +87,13 @@ spec: - name: agent resources: requests: - memory: "3Gi" + memory: "1Gi" cpu: "900m" limits: - cpu: "3900m" - memory: "7Gi" - cpu: "3900m" - memory: "7Gi" + cpu: "1000m" + memory: "3Gi" + cpu: "1000m" + memory: "3Gi" image: ${agent_image} args: ["serve", "pubsub-pull", # subscription to pull requests (tasks) from, topic to publish responses diff --git a/examples/high-throughput-compute-standalone/agent/src/go.mod b/examples/high-throughput-compute-standalone/agent/src/go.mod index 57209d132..a41d8fb44 100644 --- a/examples/high-throughput-compute-standalone/agent/src/go.mod +++ b/examples/high-throughput-compute-standalone/agent/src/go.mod @@ -1,26 +1,26 @@ module github.com/GoogleCloudPlatform/finance-research-risk-examples/examples/risk/agent go 1.24 -toolchain go1.24.5 +toolchain go1.24.1 require ( - cloud.google.com/go/compute/metadata v0.7.0 - cloud.google.com/go/pubsub v1.49.0 - cloud.google.com/go/storage v1.55.0 - github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.53.0 + cloud.google.com/go/compute/metadata v0.5.2 + cloud.google.com/go/pubsub v1.44.0 + cloud.google.com/go/storage v1.44.0 + github.com/GoogleCloudPlatform/opentelemetry-operations-go/exporter/metric v0.48.2 github.com/bufbuild/protocompile v0.14.1 github.com/jhump/protoreflect v1.17.0 - github.com/spf13/cobra v1.9.1 + github.com/spf13/cobra v1.8.1 go.opencensus.io v0.24.0 - go.opentelemetry.io/contrib/detectors/gcp v1.37.0 - go.opentelemetry.io/otel v1.37.0 - go.opentelemetry.io/otel/bridge/opencensus v1.37.0 - go.opentelemetry.io/otel/sdk v1.37.0 - go.opentelemetry.io/otel/sdk/metric v1.37.0 - golang.org/x/oauth2 v0.30.0 - google.golang.org/api v0.241.0 - google.golang.org/grpc v1.73.0 - google.golang.org/protobuf v1.36.6 + go.opentelemetry.io/contrib/detectors/gcp v1.30.0 + go.opentelemetry.io/otel v1.31.0 + go.opentelemetry.io/otel/bridge/opencensus v1.31.0 + go.opentelemetry.io/otel/sdk v1.31.0 + go.opentelemetry.io/otel/sdk/metric v1.31.0 + golang.org/x/oauth2 v0.23.0 + google.golang.org/api v0.203.0 + google.golang.org/grpc v1.67.1 + google.golang.org/protobuf v1.35.1 ) require ( @@ -64,4 +64,4 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/grpc/stats/opentelemetry v0.0.0-20241010100425-b850ea533f74 // indirect -) +) \ No newline at end of file diff --git a/examples/high-throughput-compute-standalone/agent/src/go.sum b/examples/high-throughput-compute-standalone/agent/src/go.sum index e0db06f0c..e835f19a5 100644 --- a/examples/high-throughput-compute-standalone/agent/src/go.sum +++ b/examples/high-throughput-compute-standalone/agent/src/go.sum @@ -223,4 +223,4 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= \ No newline at end of file diff --git a/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf b/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf index f4d8631ff..17bf2a825 100644 --- a/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf +++ b/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf @@ -46,12 +46,12 @@ resource "google_container_cluster" "risk-research" { project = var.project_id location = var.region datapath_provider = var.datapath_provider - node_locations = [random_shuffle.zone.result[0], random_shuffle.zone.result[1], random_shuffle.zone.result[2]] + node_locations = [random_shuffle.zone.result[0]] depends_on = [google_kms_crypto_key_iam_member.gke_crypto_key] min_master_version = data.google_container_engine_versions.central1b.latest_master_version # We do this to ensure we have large control plane nodes created initially - initial_node_count = var.scaled_control_plane ? 700 : 1 + initial_node_count = var.scaled_control_plane ? 2 : 1 remove_default_node_pool = true control_plane_endpoints_config { @@ -188,57 +188,23 @@ resource "google_container_cluster" "risk-research" { cluster_autoscaling { enabled = true - autoscaling_profile = "OPTIMIZE_UTILIZATION" + autoscaling_profile = "BALANCED" resource_limits { resource_type = "cpu" - minimum = 4 - maximum = var.cluster_max_cpus + minimum = 0 + maximum = 100 } resource_limits { resource_type = "memory" - minimum = 16 - maximum = var.cluster_max_memory - } - - resource_limits { - resource_type = "nvidia-a100-80gb" - maximum = 30 - } - - resource_limits { - resource_type = "nvidia-l4" - maximum = 30 + minimum = 0 + maximum = 1024 } resource_limits { resource_type = "nvidia-tesla-t4" - maximum = 300 - } - - resource_limits { - resource_type = "nvidia-tesla-a100" - maximum = 50 - } - - resource_limits { - resource_type = "nvidia-tesla-k80" - maximum = 30 - } - - resource_limits { - resource_type = "nvidia-tesla-p4" - maximum = 30 - } - - resource_limits { - resource_type = "nvidia-tesla-p100" - maximum = 30 - } - - resource_limits { - resource_type = "nvidia-tesla-v100" - maximum = 30 + minimum = 0 + maximum = 4 } auto_provisioning_defaults { @@ -272,7 +238,7 @@ resource "google_container_cluster" "risk-research" { } pod_autoscaling { - hpa_profile = "PERFORMANCE" + hpa_profile = "NONE" } lifecycle { @@ -354,7 +320,7 @@ resource "google_container_node_pool" "primary_spot_nodes" { location = var.region cluster = google_container_cluster.risk-research.name node_locations = [random_shuffle.zone.result[0], random_shuffle.zone.result[1], random_shuffle.zone.result[2]] - initial_node_count = 5 + initial_node_count = 0 autoscaling { @@ -380,7 +346,8 @@ resource "google_container_node_pool" "primary_spot_nodes" { enable_integrity_monitoring = var.enable_shielded_nodes enable_secure_boot = var.enable_secure_boot } - + disk_type = "pd-standard" + disk_size_gb = "100" preemptible = true machine_type = var.node_machine_type_spot diff --git a/examples/high-throughput-compute-standalone/modules/gke-standard/variables.tf b/examples/high-throughput-compute-standalone/modules/gke-standard/variables.tf index e0835c7b6..3d2adeecb 100644 --- a/examples/high-throughput-compute-standalone/modules/gke-standard/variables.tf +++ b/examples/high-throughput-compute-standalone/modules/gke-standard/variables.tf @@ -86,13 +86,13 @@ variable "cluster_service_account" { variable "cluster_max_cpus" { type = number - default = 10000 + default = 8 description = "Max CPU in cluster autoscaling resource limits" } variable "cluster_max_memory" { type = number - default = 80000 + default = 16 description = "Max memory in cluster autoscaling resource limits" } @@ -127,13 +127,13 @@ variable "enable_csi_gcs_fuse" { variable "node_machine_type_ondemand" { type = string description = "Machine type for on-demand node pools in GKE clusters" - default = "n2-standard-16" + default = "e2-standard-2" } variable "node_machine_type_spot" { type = string description = "Machine type for spot node pools in GKE clusters" - default = "n2-standard-64" + default = "e2-standard-2" } variable "min_nodes_ondemand" { @@ -145,19 +145,19 @@ variable "min_nodes_ondemand" { variable "max_nodes_ondemand" { type = number description = "Maximum number of on-demand nodes in the node pool" - default = 32 + default = 1 } variable "min_nodes_spot" { type = number description = "Minimum number of spot nodes in the node pool" - default = 1 + default = 0 } variable "max_nodes_spot" { type = number description = "Maximum number of spot nodes in the node pool" - default = 3000 + default = 1 } variable "release_channel" { diff --git a/examples/high-throughput-compute-standalone/modules/infrastructure/variables.tf b/examples/high-throughput-compute-standalone/modules/infrastructure/variables.tf index cbdc6e6ce..72a9f7f15 100644 --- a/examples/high-throughput-compute-standalone/modules/infrastructure/variables.tf +++ b/examples/high-throughput-compute-standalone/modules/infrastructure/variables.tf @@ -104,13 +104,13 @@ variable "scaled_control_plane" { variable "cluster_max_cpus" { type = number - default = 10000 + default = 8 description = "Maximum CPU cores in cluster autoscaling resource limits" } variable "cluster_max_memory" { type = number - default = 80000 + default = 16 description = "Maximum memory (in GB) in cluster autoscaling resource limits" } @@ -129,13 +129,13 @@ variable "create_spot_nodepool" { variable "node_machine_type_ondemand" { type = string description = "Machine type for on-demand node pools in GKE clusters" - default = "n2-standard-16" + default = "e2-standard-2" } variable "node_machine_type_spot" { type = string description = "Machine type for spot node pools in GKE clusters" - default = "n2-standard-64" + default = "e2-standard-2" } variable "min_nodes_ondemand" { @@ -147,19 +147,19 @@ variable "min_nodes_ondemand" { variable "max_nodes_ondemand" { type = number description = "Maximum number of on-demand nodes in the node pool" - default = 32 + default = 1 } variable "min_nodes_spot" { type = number description = "Minimum number of spot nodes in the node pool" - default = 1 + default = 0 } variable "max_nodes_spot" { type = number description = "Maximum number of spot nodes in the node pool" - default = 3000 + default = 1 } variable "release_channel" { diff --git a/examples/high-throughput-compute-standalone/src/go.mod b/examples/high-throughput-compute-standalone/src/go.mod index 8009d55c8..09278006a 100644 --- a/examples/high-throughput-compute-standalone/src/go.mod +++ b/examples/high-throughput-compute-standalone/src/go.mod @@ -3,13 +3,13 @@ module github.com/GoogleCloudPlatform/finance-research-risk-examples/examples/ri go 1.24 require ( - cloud.google.com/go/compute/metadata v0.7.0 - cloud.google.com/go/storage v1.55.0 - github.com/schollz/progressbar/v3 v3.18.0 - github.com/spf13/cobra v1.9.1 - google.golang.org/api v0.241.0 - google.golang.org/grpc v1.73.0 - google.golang.org/protobuf v1.36.6 + cloud.google.com/go/compute/metadata v0.6.0 + cloud.google.com/go/storage v1.50.0 + github.com/schollz/progressbar/v3 v3.16.1 + github.com/spf13/cobra v1.8.1 + google.golang.org/api v0.215.0 + google.golang.org/grpc v1.68.1 + google.golang.org/protobuf v1.36.4 ) require ( @@ -49,16 +49,16 @@ require ( go.opentelemetry.io/otel/sdk v1.34.0 // indirect go.opentelemetry.io/otel/sdk/metric v1.32.0 // indirect go.opentelemetry.io/otel/trace v1.34.0 // indirect - golang.org/x/crypto v0.40.0 // indirect - golang.org/x/net v0.42.0 // indirect + golang.org/x/crypto v0.32.0 // indirect + golang.org/x/net v0.34.0 // indirect golang.org/x/oauth2 v0.25.0 // indirect - golang.org/x/sync v0.16.0 // indirect - golang.org/x/sys v0.34.0 // indirect - golang.org/x/term v0.33.0 // indirect - golang.org/x/text v0.27.0 // indirect + golang.org/x/sync v0.10.0 // indirect + golang.org/x/sys v0.29.0 // indirect + golang.org/x/term v0.28.0 // indirect + golang.org/x/text v0.21.0 // indirect golang.org/x/time v0.9.0 // indirect google.golang.org/genproto v0.0.0-20241118233622-e639e219e697 // indirect google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 // indirect google.golang.org/grpc/stats/opentelemetry v0.0.0-20241028142157-ada6787961b3 // indirect -) +) \ No newline at end of file diff --git a/examples/high-throughput-compute-standalone/src/go.sum b/examples/high-throughput-compute-standalone/src/go.sum index 88983b83d..77fbf068a 100644 --- a/examples/high-throughput-compute-standalone/src/go.sum +++ b/examples/high-throughput-compute-standalone/src/go.sum @@ -149,8 +149,8 @@ go.opentelemetry.io/otel/trace v1.34.0 h1:+ouXS2V8Rd4hp4580a8q23bg0azF2nI8cqLYnC go.opentelemetry.io/otel/trace v1.34.0/go.mod h1:Svm7lSjQD7kG7KJ/MUHPVXSDGz2OX4h0M2jHBhmSfRE= golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w= golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto= -golang.org/x/crypto v0.40.0 h1:r4x+VvoG5Fm+eJcxMaY8CQM7Lb0l1lsmjGBQ6s8BfKM= -golang.org/x/crypto v0.40.0/go.mod h1:Qr1vMER5WyS2dfPHAlsOj01wgLbsyWtFn/aY+5+ZdxY= +golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc= +golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc= golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA= golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE= golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU= @@ -161,28 +161,28 @@ golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73r golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20190404232315-eb5bcb51f2a3/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg= golang.org/x/net v0.0.0-20201110031124-69a78807bb2b/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU= -golang.org/x/net v0.42.0 h1:jzkYrhi3YQWD6MLBJcsklgQsoAcw89EcZbJw8Z614hs= -golang.org/x/net v0.42.0/go.mod h1:FF1RA5d3u7nAYA4z2TkclSCKh68eSXtiFwcWQpPXdt8= +golang.org/x/net v0.34.0 h1:Mb7Mrk043xzHgnRM88suvJFwzVrRfHEHJEl5/71CKw0= +golang.org/x/net v0.34.0/go.mod h1:di0qlW3YNM5oh6GqDGQr92MyTozJPmybPK4Ev/Gm31k= golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U= golang.org/x/oauth2 v0.25.0 h1:CY4y7XT9v0cRI9oupztF8AgiIu99L/ksR/Xp/6jrZ70= golang.org/x/oauth2 v0.25.0/go.mod h1:XYTD2NtWslqkgxebSiOHnXEap4TF09sJSc7H1sXbhtI= golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM= -golang.org/x/sync v0.16.0 h1:ycBJEhp9p4vXvUZNszeOq0kGTPghopOL8q0fq3vstxw= -golang.org/x/sync v0.16.0/go.mod h1:1dzgHSNfp02xaA81J2MS99Qcpr2w7fw1gpm99rleRqA= +golang.org/x/sync v0.10.0 h1:3NQrjDixjgGwUOCaF8w2+VYHv0Ve/vGYSbdkTa98gmQ= +golang.org/x/sync v0.10.0/go.mod h1:Czt+wKu1gCyEFDUtn0jG5QVvpJ6rzVqr5aXyt9drQfk= golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY= golang.org/x/sys v0.0.0-20190412213103-97732733099d/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs= -golang.org/x/sys v0.34.0 h1:H5Y5sJ2L2JRdyv7ROF1he/lPdvFsd0mJHFw2ThKHxLA= -golang.org/x/sys v0.34.0/go.mod h1:BJP2sWEmIv4KK5OTEluFJCKSidICx8ciO85XgH3Ak8k= -golang.org/x/term v0.33.0 h1:NuFncQrRcaRvVmgRkvM3j/F00gWIAlcmlB8ACEKmGIg= -golang.org/x/term v0.33.0/go.mod h1:s18+ql9tYWp1IfpV9DmCtQDDSRBUjKaw9M1eAv5UeF0= +golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU= +golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA= +golang.org/x/term v0.28.0 h1:/Ts8HFuMR2E6IP/jlo7QVLZHggjKQbhu/7H0LJFr3Gg= +golang.org/x/term v0.28.0/go.mod h1:Sw/lC2IAUZ92udQNf3WodGtn4k/XoLyZoh8v/8uiwek= golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ= golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ= -golang.org/x/text v0.27.0 h1:4fGWRpyh641NLlecmyl4LOe6yDdfaYNrGb2zdfo4JV4= -golang.org/x/text v0.27.0/go.mod h1:1D28KMCvyooCX9hBiosv5Tz/+YLxj0j7XhWjpSUF7CU= +golang.org/x/text v0.21.0 h1:zyQAAkrwaneQ066sspRyJaG9VNi/YJ1NfzcGB3hZ/qo= +golang.org/x/text v0.21.0/go.mod h1:4IBbMaMmOPCJ8SecivzSH54+73PCFmPWxNTLm+vZkEQ= golang.org/x/time v0.9.0 h1:EsRrnYcQiGH+5FfbgvV4AP7qEZstoyrHB0DzarOQ4ZY= golang.org/x/time v0.9.0/go.mod h1:3BpzKBy/shNhVucY/MWOyx10tF3SFh9QdLuxbVysPQM= golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ= @@ -229,4 +229,4 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= \ No newline at end of file diff --git a/examples/high-throughput-compute-standalone/variables.tf b/examples/high-throughput-compute-standalone/variables.tf index 5e2823bf1..f1205e9d4 100644 --- a/examples/high-throughput-compute-standalone/variables.tf +++ b/examples/high-throughput-compute-standalone/variables.tf @@ -149,13 +149,13 @@ variable "gke_standard_cluster_name" { variable "node_machine_type_ondemand" { description = "Machine type for on-demand node pools" type = string - default = "n2-standard-16" + default = "e2-standard-2" } variable "node_machine_type_spot" { description = "Machine type for spot node pools" type = string - default = "n2-standard-64" + default = "e2-standard-2" } variable "min_nodes_ondemand" { @@ -167,19 +167,19 @@ variable "min_nodes_ondemand" { variable "max_nodes_ondemand" { description = "Maximum number of on-demand nodes" type = number - default = 32 + default = 1 } variable "min_nodes_spot" { description = "Minimum number of spot nodes" type = number - default = 1 + default = 0 } variable "max_nodes_spot" { description = "Maximum number of spot nodes" type = number - default = 3000 + default = 1 } # variable "scaled_control_plane" { @@ -346,7 +346,7 @@ variable "service_perimeter_name" { variable "service_perimeter_mode" { description = "(VPC-SC) Service perimeter mode: ENFORCE, DRY_RUN." type = string - default = "ENFORCE" + default = "DRY_RUN" validation { condition = contains(["ENFORCE", "DRY_RUN"], var.service_perimeter_mode) From 616b12a7ab32a3d7906ddb3814cef3ecd9e09feb Mon Sep 17 00:00:00 2001 From: marcelorobj Date: Mon, 22 Sep 2025 10:09:12 -0300 Subject: [PATCH 4/8] fix: fixing typo on bucket name --- examples/high-throughput-compute-standalone/5-appinfra.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/examples/high-throughput-compute-standalone/5-appinfra.tf b/examples/high-throughput-compute-standalone/5-appinfra.tf index 77e6b48b5..02b2996e6 100644 --- a/examples/high-throughput-compute-standalone/5-appinfra.tf +++ b/examples/high-throughput-compute-standalone/5-appinfra.tf @@ -197,14 +197,14 @@ resource "google_logging_project_bucket_config" "analytics-enabled-bucket" { project = var.project_id location = module.default_region.default_region enable_analytics = true - bucket_id = "appLogsTest" + bucket_id = "applogs" lifecycle { ignore_changes = [project] } } resource "google_logging_linked_dataset" "logging_linked_dataset" { - link_id = "appLogsTest" + link_id = "applogs" bucket = google_logging_project_bucket_config.analytics-enabled-bucket.id description = "Linked dataset test" depends_on = [ From 1b9c36914200448730d396586014cbe76c87f62a Mon Sep 17 00:00:00 2001 From: marcelorobj Date: Mon, 22 Sep 2025 10:16:24 -0300 Subject: [PATCH 5/8] fix: fixing linter issues --- .../modules/gke-standard/main.tf | 1 + 1 file changed, 1 insertion(+) diff --git a/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf b/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf index 17bf2a825..7fcd31e9f 100644 --- a/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf +++ b/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf @@ -346,6 +346,7 @@ resource "google_container_node_pool" "primary_spot_nodes" { enable_integrity_monitoring = var.enable_shielded_nodes enable_secure_boot = var.enable_secure_boot } + disk_type = "pd-standard" disk_size_gb = "100" preemptible = true From b3cd7597250e49d11de81f15c530dfba9606bf8e Mon Sep 17 00:00:00 2001 From: marcelorobj Date: Mon, 22 Sep 2025 10:23:15 -0300 Subject: [PATCH 6/8] fix: fixing formating on tf files and updating docs --- .../high-throughput-compute-standalone/README.md | 12 ++++++------ .../modules/gke-standard/README.md | 14 +++++++------- .../modules/gke-standard/main.tf | 2 +- .../modules/infrastructure/README.md | 14 +++++++------- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/examples/high-throughput-compute-standalone/README.md b/examples/high-throughput-compute-standalone/README.md index cd45115fc..550da66d3 100644 --- a/examples/high-throughput-compute-standalone/README.md +++ b/examples/high-throughput-compute-standalone/README.md @@ -126,18 +126,18 @@ links into the Console. | hsn\_bucket | Enable hierarchical namespace GCS buckets | `bool` | `false` | no | | lustre\_filesystem | The name of the Lustre filesystem | `string` | `"lustre-fs"` | no | | lustre\_gke\_support\_enabled | Enable GKE support for Lustre instance | `bool` | `true` | no | -| max\_nodes\_ondemand | Maximum number of on-demand nodes | `number` | `32` | no | -| max\_nodes\_spot | Maximum number of spot nodes | `number` | `3000` | no | +| max\_nodes\_ondemand | Maximum number of on-demand nodes | `number` | `1` | no | +| max\_nodes\_spot | Maximum number of spot nodes | `number` | `1` | no | | min\_nodes\_ondemand | Minimum number of on-demand nodes | `number` | `0` | no | -| min\_nodes\_spot | Minimum number of spot nodes | `number` | `1` | no | -| node\_machine\_type\_ondemand | Machine type for on-demand node pools | `string` | `"n2-standard-16"` | no | -| node\_machine\_type\_spot | Machine type for spot node pools | `string` | `"n2-standard-64"` | no | +| min\_nodes\_spot | Minimum number of spot nodes | `number` | `0` | no | +| node\_machine\_type\_ondemand | Machine type for on-demand node pools | `string` | `"e2-standard-2"` | no | +| node\_machine\_type\_spot | Machine type for spot node pools | `string` | `"e2-standard-2"` | no | | project\_id | The GCP project ID where resources will be created. | `string` | `"YOUR_PROJECT_ID"` | no | | pubsub\_exactly\_once | Enable Pub/Sub exactly once subscriptions | `bool` | `true` | no | | quota\_contact\_email | Contact email for quota requests | `string` | `""` | no | | regions | List of regions where GKE clusters should be created. Used for multi-region deployments. | `list(string)` |
[
"us-central1"
]
| no | | scripts\_output | Output directory for testing scripts | `string` | `"./generated"` | no | -| service\_perimeter\_mode | (VPC-SC) Service perimeter mode: ENFORCE, DRY\_RUN. | `string` | `"ENFORCE"` | no | +| service\_perimeter\_mode | (VPC-SC) Service perimeter mode: ENFORCE, DRY\_RUN. | `string` | `"DRY_RUN"` | no | | service\_perimeter\_name | (VPC-SC) Service perimeter name. The created projects in this step will be assigned to this perimeter. | `string` | `null` | no | | storage\_capacity\_gib | Capacity in GiB for the selected storage system (Parallelstore or Lustre) | `number` | `null` | no | | storage\_ip\_range | IP range for Storage peering, in CIDR notation | `string` | `"172.16.0.0/16"` | no | diff --git a/examples/high-throughput-compute-standalone/modules/gke-standard/README.md b/examples/high-throughput-compute-standalone/modules/gke-standard/README.md index bab3aa55d..2bc4869cc 100644 --- a/examples/high-throughput-compute-standalone/modules/gke-standard/README.md +++ b/examples/high-throughput-compute-standalone/modules/gke-standard/README.md @@ -129,8 +129,8 @@ limitations under the License. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | cluster\_index | Index of this cluster within its region (0-3) | `number` | n/a | yes | -| cluster\_max\_cpus | Max CPU in cluster autoscaling resource limits | `number` | `10000` | no | -| cluster\_max\_memory | Max memory in cluster autoscaling resource limits | `number` | `80000` | no | +| cluster\_max\_cpus | Max CPU in cluster autoscaling resource limits | `number` | `8` | no | +| cluster\_max\_memory | Max memory in cluster autoscaling resource limits | `number` | `16` | no | | cluster\_name | Name of GKE cluster | `string` | `"gke-risk-research"` | no | | cluster\_service\_account | The service account for the GKE cluster |
object({
email = string
id = string
})
| n/a | yes | | create\_ondemand\_nodepool | Whether to create the on-demand node pool | `bool` | `true` | no | @@ -153,14 +153,14 @@ limitations under the License. | maintenance\_end\_time | The end time for the maintenance window in RFC3339 format (e.g., '2024-09-18T04:00:00Z') | `string` | `"2024-09-18T04:00:00Z"` | no | | maintenance\_recurrence | The recurrence of the maintenance window in RRULE format (e.g., 'FREQ=WEEKLY;BYDAY=SA,SU') | `string` | `"FREQ=WEEKLY;BYDAY=SA,SU"` | no | | maintenance\_start\_time | The start time for the maintenance window in RFC3339 format (e.g., '2024-09-17T04:00:00Z') | `string` | `"2024-09-17T04:00:00Z"` | no | -| max\_nodes\_ondemand | Maximum number of on-demand nodes in the node pool | `number` | `32` | no | -| max\_nodes\_spot | Maximum number of spot nodes in the node pool | `number` | `3000` | no | +| max\_nodes\_ondemand | Maximum number of on-demand nodes in the node pool | `number` | `1` | no | +| max\_nodes\_spot | Maximum number of spot nodes in the node pool | `number` | `1` | no | | min\_master\_version | The minimum version of the master. GKE will auto-update the master to new versions, so this does not guarantee the current master version. | `string` | `"1.32.3"` | no | | min\_nodes\_ondemand | Minimum number of on-demand nodes in the node pool | `number` | `0` | no | -| min\_nodes\_spot | Minimum number of spot nodes in the node pool | `number` | `1` | no | +| min\_nodes\_spot | Minimum number of spot nodes in the node pool | `number` | `0` | no | | network | The vpc the cluster should be deployed to | `string` | `"default"` | no | -| node\_machine\_type\_ondemand | Machine type for on-demand node pools in GKE clusters | `string` | `"n2-standard-16"` | no | -| node\_machine\_type\_spot | Machine type for spot node pools in GKE clusters | `string` | `"n2-standard-64"` | no | +| node\_machine\_type\_ondemand | Machine type for on-demand node pools in GKE clusters | `string` | `"e2-standard-2"` | no | +| node\_machine\_type\_spot | Machine type for spot node pools in GKE clusters | `string` | `"e2-standard-2"` | no | | project\_id | The GCP project where the resources will be created | `string` | n/a | yes | | region | The region to host the cluster in | `string` | `"us-central1"` | no | | release\_channel | GKE release channel for clusters (RAPID, REGULAR, STABLE) | `string` | `"RAPID"` | no | diff --git a/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf b/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf index 7fcd31e9f..d29df686a 100644 --- a/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf +++ b/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf @@ -347,7 +347,7 @@ resource "google_container_node_pool" "primary_spot_nodes" { enable_secure_boot = var.enable_secure_boot } - disk_type = "pd-standard" + disk_type = "pd-standard" disk_size_gb = "100" preemptible = true machine_type = var.node_machine_type_spot diff --git a/examples/high-throughput-compute-standalone/modules/infrastructure/README.md b/examples/high-throughput-compute-standalone/modules/infrastructure/README.md index 7d2a202a8..f0801e040 100644 --- a/examples/high-throughput-compute-standalone/modules/infrastructure/README.md +++ b/examples/high-throughput-compute-standalone/modules/infrastructure/README.md @@ -89,8 +89,8 @@ See the `variables.tf` file for all available configuration options. | additional\_service\_account\_roles | Additional IAM roles to assign to the cluster service account | `list(string)` | `[]` | no | | artifact\_registry\_cleanup\_policy\_keep\_count | Number of most recent container image versions to keep in Artifact Registry | `number` | `10` | no | | artifact\_registry\_name | Name of the Artifact Registry repository to create | `string` | `"research-images"` | no | -| cluster\_max\_cpus | Maximum CPU cores in cluster autoscaling resource limits | `number` | `10000` | no | -| cluster\_max\_memory | Maximum memory (in GB) in cluster autoscaling resource limits | `number` | `80000` | no | +| cluster\_max\_cpus | Maximum CPU cores in cluster autoscaling resource limits | `number` | `8` | no | +| cluster\_max\_memory | Maximum memory (in GB) in cluster autoscaling resource limits | `number` | `16` | no | | cluster\_service\_account | Service Account ID to use for GKE clusters | `string` | `"gke-risk-research-cluster-sa"` | no | | clusters\_per\_region | Map of regions to number of clusters to create in each (maximum 4 per region) | `map(number)` |
{
"us-central1": 1
}
| no | | create\_ondemand\_nodepool | Whether to create the on-demand node pool | `bool` | `true` | no | @@ -111,12 +111,12 @@ See the `variables.tf` file for all available configuration options. | maintenance\_end\_time | The end time for the maintenance window in RFC3339 format (e.g., '2024-09-18T04:00:00Z') | `string` | `"2024-09-18T04:00:00Z"` | no | | maintenance\_recurrence | The recurrence of the maintenance window in RRULE format (e.g., 'FREQ=WEEKLY;BYDAY=SA,SU') | `string` | `"FREQ=WEEKLY;BYDAY=SA,SU"` | no | | maintenance\_start\_time | The start time for the maintenance window in RFC3339 format (e.g., '2024-09-17T04:00:00Z') | `string` | `"2024-09-17T04:00:00Z"` | no | -| max\_nodes\_ondemand | Maximum number of on-demand nodes in the node pool | `number` | `32` | no | -| max\_nodes\_spot | Maximum number of spot nodes in the node pool | `number` | `3000` | no | +| max\_nodes\_ondemand | Maximum number of on-demand nodes in the node pool | `number` | `1` | no | +| max\_nodes\_spot | Maximum number of spot nodes in the node pool | `number` | `1` | no | | min\_nodes\_ondemand | Minimum number of on-demand nodes in the node pool | `number` | `0` | no | -| min\_nodes\_spot | Minimum number of spot nodes in the node pool | `number` | `1` | no | -| node\_machine\_type\_ondemand | Machine type for on-demand node pools in GKE clusters | `string` | `"n2-standard-16"` | no | -| node\_machine\_type\_spot | Machine type for spot node pools in GKE clusters | `string` | `"n2-standard-64"` | no | +| min\_nodes\_spot | Minimum number of spot nodes in the node pool | `number` | `0` | no | +| node\_machine\_type\_ondemand | Machine type for on-demand node pools in GKE clusters | `string` | `"e2-standard-2"` | no | +| node\_machine\_type\_spot | Machine type for spot node pools in GKE clusters | `string` | `"e2-standard-2"` | no | | parallelstore\_deployment\_type | Parallelstore Instance deployment type (SCRATCH or PERSISTENT) | `string` | `"SCRATCH"` | no | | project\_id | The GCP project ID where resources will be created. | `string` | `"YOUR_PROJECT_ID"` | no | | regions | List of regions where GKE clusters should be created. Used for multi-region deployments. | `list(string)` |
[
"us-central1"
]
| no | From 51b5a8b110f9aa50214933b5aa42a4aed4879ba1 Mon Sep 17 00:00:00 2001 From: marcelorobj Date: Mon, 22 Sep 2025 10:48:42 -0300 Subject: [PATCH 7/8] fix: readding variables for gke cluster scaling configuration --- examples/high-throughput-compute-standalone/agent/src/go.mod | 2 +- examples/high-throughput-compute-standalone/agent/src/go.sum | 2 +- .../modules/gke-standard/README.md | 4 ++-- .../modules/gke-standard/main.tf | 4 ++-- .../modules/gke-standard/variables.tf | 4 ++-- .../modules/infrastructure/README.md | 4 ++-- .../modules/infrastructure/variables.tf | 4 ++-- examples/high-throughput-compute-standalone/src/go.mod | 2 +- examples/high-throughput-compute-standalone/src/go.sum | 2 +- 9 files changed, 14 insertions(+), 14 deletions(-) diff --git a/examples/high-throughput-compute-standalone/agent/src/go.mod b/examples/high-throughput-compute-standalone/agent/src/go.mod index a41d8fb44..3b329820b 100644 --- a/examples/high-throughput-compute-standalone/agent/src/go.mod +++ b/examples/high-throughput-compute-standalone/agent/src/go.mod @@ -64,4 +64,4 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20241007155032-5fefd90f89a9 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20241015192408-796eee8c2d53 // indirect google.golang.org/grpc/stats/opentelemetry v0.0.0-20241010100425-b850ea533f74 // indirect -) \ No newline at end of file +) diff --git a/examples/high-throughput-compute-standalone/agent/src/go.sum b/examples/high-throughput-compute-standalone/agent/src/go.sum index e835f19a5..e0db06f0c 100644 --- a/examples/high-throughput-compute-standalone/agent/src/go.sum +++ b/examples/high-throughput-compute-standalone/agent/src/go.sum @@ -223,4 +223,4 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= \ No newline at end of file +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= diff --git a/examples/high-throughput-compute-standalone/modules/gke-standard/README.md b/examples/high-throughput-compute-standalone/modules/gke-standard/README.md index 2bc4869cc..5c9d3da2f 100644 --- a/examples/high-throughput-compute-standalone/modules/gke-standard/README.md +++ b/examples/high-throughput-compute-standalone/modules/gke-standard/README.md @@ -129,8 +129,8 @@ limitations under the License. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | cluster\_index | Index of this cluster within its region (0-3) | `number` | n/a | yes | -| cluster\_max\_cpus | Max CPU in cluster autoscaling resource limits | `number` | `8` | no | -| cluster\_max\_memory | Max memory in cluster autoscaling resource limits | `number` | `16` | no | +| cluster\_max\_cpus | Max CPU in cluster autoscaling resource limits | `number` | `100` | no | +| cluster\_max\_memory | Max memory in cluster autoscaling resource limits | `number` | `1024` | no | | cluster\_name | Name of GKE cluster | `string` | `"gke-risk-research"` | no | | cluster\_service\_account | The service account for the GKE cluster |
object({
email = string
id = string
})
| n/a | yes | | create\_ondemand\_nodepool | Whether to create the on-demand node pool | `bool` | `true` | no | diff --git a/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf b/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf index d29df686a..fe6454c51 100644 --- a/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf +++ b/examples/high-throughput-compute-standalone/modules/gke-standard/main.tf @@ -193,12 +193,12 @@ resource "google_container_cluster" "risk-research" { resource_limits { resource_type = "cpu" minimum = 0 - maximum = 100 + maximum = var.cluster_max_cpus } resource_limits { resource_type = "memory" minimum = 0 - maximum = 1024 + maximum = var.cluster_max_memory } resource_limits { diff --git a/examples/high-throughput-compute-standalone/modules/gke-standard/variables.tf b/examples/high-throughput-compute-standalone/modules/gke-standard/variables.tf index 3d2adeecb..ae875545f 100644 --- a/examples/high-throughput-compute-standalone/modules/gke-standard/variables.tf +++ b/examples/high-throughput-compute-standalone/modules/gke-standard/variables.tf @@ -86,13 +86,13 @@ variable "cluster_service_account" { variable "cluster_max_cpus" { type = number - default = 8 + default = 100 description = "Max CPU in cluster autoscaling resource limits" } variable "cluster_max_memory" { type = number - default = 16 + default = 1024 description = "Max memory in cluster autoscaling resource limits" } diff --git a/examples/high-throughput-compute-standalone/modules/infrastructure/README.md b/examples/high-throughput-compute-standalone/modules/infrastructure/README.md index f0801e040..ec301cb57 100644 --- a/examples/high-throughput-compute-standalone/modules/infrastructure/README.md +++ b/examples/high-throughput-compute-standalone/modules/infrastructure/README.md @@ -89,8 +89,8 @@ See the `variables.tf` file for all available configuration options. | additional\_service\_account\_roles | Additional IAM roles to assign to the cluster service account | `list(string)` | `[]` | no | | artifact\_registry\_cleanup\_policy\_keep\_count | Number of most recent container image versions to keep in Artifact Registry | `number` | `10` | no | | artifact\_registry\_name | Name of the Artifact Registry repository to create | `string` | `"research-images"` | no | -| cluster\_max\_cpus | Maximum CPU cores in cluster autoscaling resource limits | `number` | `8` | no | -| cluster\_max\_memory | Maximum memory (in GB) in cluster autoscaling resource limits | `number` | `16` | no | +| cluster\_max\_cpus | Maximum CPU cores in cluster autoscaling resource limits | `number` | `100` | no | +| cluster\_max\_memory | Maximum memory (in GB) in cluster autoscaling resource limits | `number` | `1024` | no | | cluster\_service\_account | Service Account ID to use for GKE clusters | `string` | `"gke-risk-research-cluster-sa"` | no | | clusters\_per\_region | Map of regions to number of clusters to create in each (maximum 4 per region) | `map(number)` |
{
"us-central1": 1
}
| no | | create\_ondemand\_nodepool | Whether to create the on-demand node pool | `bool` | `true` | no | diff --git a/examples/high-throughput-compute-standalone/modules/infrastructure/variables.tf b/examples/high-throughput-compute-standalone/modules/infrastructure/variables.tf index 72a9f7f15..de6fd3b3e 100644 --- a/examples/high-throughput-compute-standalone/modules/infrastructure/variables.tf +++ b/examples/high-throughput-compute-standalone/modules/infrastructure/variables.tf @@ -104,13 +104,13 @@ variable "scaled_control_plane" { variable "cluster_max_cpus" { type = number - default = 8 + default = 100 description = "Maximum CPU cores in cluster autoscaling resource limits" } variable "cluster_max_memory" { type = number - default = 16 + default = 1024 description = "Maximum memory (in GB) in cluster autoscaling resource limits" } diff --git a/examples/high-throughput-compute-standalone/src/go.mod b/examples/high-throughput-compute-standalone/src/go.mod index 09278006a..9c33ab42a 100644 --- a/examples/high-throughput-compute-standalone/src/go.mod +++ b/examples/high-throughput-compute-standalone/src/go.mod @@ -61,4 +61,4 @@ require ( google.golang.org/genproto/googleapis/api v0.0.0-20241209162323-e6fa225c2576 // indirect google.golang.org/genproto/googleapis/rpc v0.0.0-20250127172529-29210b9bc287 // indirect google.golang.org/grpc/stats/opentelemetry v0.0.0-20241028142157-ada6787961b3 // indirect -) \ No newline at end of file +) diff --git a/examples/high-throughput-compute-standalone/src/go.sum b/examples/high-throughput-compute-standalone/src/go.sum index 77fbf068a..15a780e1c 100644 --- a/examples/high-throughput-compute-standalone/src/go.sum +++ b/examples/high-throughput-compute-standalone/src/go.sum @@ -229,4 +229,4 @@ gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= -honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= \ No newline at end of file +honnef.co/go/tools v0.0.0-20190523083050-ea95bdfd59fc/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4= From 227831d1ac9fadff424556b43e64bdf09e7df100 Mon Sep 17 00:00:00 2001 From: marcelorobj Date: Tue, 23 Sep 2025 15:34:08 -0300 Subject: [PATCH 8/8] fix: removes unnecessary step on integration test --- build/int.cloudbuild.htc.yaml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/build/int.cloudbuild.htc.yaml b/build/int.cloudbuild.htc.yaml index c38eb0926..44e8c0d6b 100644 --- a/build/int.cloudbuild.htc.yaml +++ b/build/int.cloudbuild.htc.yaml @@ -125,20 +125,6 @@ steps: "cft test run TestStandaloneHTCExample --stage verify --verbose", ] - - id: single-project-htc-app-deployment - name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" - entrypoint: "bash" - args: - - "-c" - - |- - gcloud storage cp gs://$(terraform -chdir=/workspace/test/setup/harness/gitlab output -raw gitlab_ssl_bucket_name)/gitlab.crt /usr/local/share/ca-certificates - update-ca-certificates - if (ls /etc/ssl/certs | grep gitlab.pem); then - cft test run TestSingleProjectSourceCymbalBank --stage verify --verbose || exit 1 - else - echo ERROR: Was not able to download certificate and update system bundle. && exit 1 - fi - - id: single-project-htc-teardown name: "gcr.io/cloud-foundation-cicd/$_DOCKER_IMAGE_DEVELOPER_TOOLS:$_DOCKER_TAG_VERSION_DEVELOPER_TOOLS" args: