From 031bf6d16111f5f0f5c590e213f00cfc8f6c1fde Mon Sep 17 00:00:00 2001 From: Matt Cramer Date: Wed, 8 Oct 2025 14:55:55 -0600 Subject: [PATCH 1/5] cci config - one build, one test --- .circleci/config.yml | 135 +++++++++++++++++++++++++++++++++++++------ 1 file changed, 118 insertions(+), 17 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 93085aa..f3b630c 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,20 +1,121 @@ -# .circleci/config.yaml -# Using orbs for reusable CircleCI configuration - version: 2.1 - -orbs: - workflows: aspect-build/workflows@5.8.18 - workflows: - bazel_ci_workflow: + aspect-workflows: jobs: - - workflows/aspect-workflows: - - resource-class: writechoiceorg/aspect-default - filters: - branches: - only: - - main - tags: - ignore: /.*/ \ No newline at end of file + - aw-build: + workspace: . + context: [] + - aw-test: + workspace: . + context: [] +jobs: + aw-build: + machine: true + resource_class: aspect-build/awd-cci-test-dev-gcp-default + working_directory: /mnt/ephemeral/workdir + steps: + - run: + name: Workflows environment + command: /etc/aspect/workflows/bin/configure_workflows_env + - checkout + - run: + name: Prepare archive directories + command: rm -rf /workflows/artifacts /workflows/testlogs + - run: + name: Agent health check + command: /etc/aspect/workflows/bin/agent_health_check + no_output_timeout: 180m + - run: + name: Build + command: rosetta run build --workspace << parameters.workspace >> + no_output_timeout: 180m + - when: + condition: + and: + - <> + - or: + - matches: + pattern: ^main$ + value: << pipeline.git.branch >> + steps: + - run: + name: Delivery manifest + command: rosetta run delivery_manifest --workspace << parameters.workspace >> + --data TARGETS_SOURCE=build + no_output_timeout: 180m + - store_artifacts: + path: /workflows/testlogs + - store_artifacts: + path: /workflows/artifacts + - run: + name: Finalization + command: rosetta run finalization + no_output_timeout: 10m + when: always + parameters: &a1 + workspace: + type: string + delivery_manifest: + type: boolean + default: true + environment: + ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> + ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> + ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows + ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml + ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> + XDG_CACHE_HOME: /mnt/ephemeral/caches + aw-test: + machine: true + resource_class: aspect-build/awd-cci-test-dev-gcp-default + working_directory: /mnt/ephemeral/workdir + steps: + - run: + name: Workflows environment + command: /etc/aspect/workflows/bin/configure_workflows_env + - checkout + - run: + name: Prepare archive directories + command: rm -rf /workflows/artifacts /workflows/testlogs + - run: + name: Agent health check + command: /etc/aspect/workflows/bin/agent_health_check + no_output_timeout: 180m + - run: + name: Test + command: rosetta run test --workspace << parameters.workspace >> + no_output_timeout: 180m + - store_test_results: + path: /workflows/testlogs + - when: + condition: + and: + - <> + - or: + - matches: + pattern: ^main$ + value: << pipeline.git.branch >> + steps: + - run: + name: Delivery manifest + command: rosetta run delivery_manifest --workspace << parameters.workspace >> + --data TARGETS_SOURCE=test + no_output_timeout: 180m + - store_artifacts: + path: /workflows/testlogs + - store_artifacts: + path: /workflows/artifacts + - run: + name: Finalization + command: rosetta run finalization + no_output_timeout: 10m + when: always + parameters: *a1 + environment: + ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> + ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> + ASPECT_WORKFLOWS_CIRCLE_WORKFLOW_BASE_NAME: aspect-workflows + ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml + ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> + XDG_CACHE_HOME: /mnt/ephemeral/caches +orbs: {} \ No newline at end of file From 36b5be33fe8e8f75c88dfd50c3693ae54de3118b Mon Sep 17 00:00:00 2001 From: Matt Cramer Date: Wed, 8 Oct 2025 14:58:47 -0600 Subject: [PATCH 2/5] correct resource class --- .circleci/config.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index f3b630c..34a830d 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -11,7 +11,7 @@ workflows: jobs: aw-build: machine: true - resource_class: aspect-build/awd-cci-test-dev-gcp-default + resource_class: writechoiceorg/aspect-default working_directory: /mnt/ephemeral/workdir steps: - run: @@ -67,7 +67,7 @@ jobs: XDG_CACHE_HOME: /mnt/ephemeral/caches aw-test: machine: true - resource_class: aspect-build/awd-cci-test-dev-gcp-default + resource_class: writechoiceorg/aspect-default working_directory: /mnt/ephemeral/workdir steps: - run: From 5b573633537d6d80bd4dae9aa7048205558df97f Mon Sep 17 00:00:00 2001 From: Matt Cramer Date: Wed, 8 Oct 2025 15:06:06 -0600 Subject: [PATCH 3/5] pin orbs to aspect workflows --- .circleci/config.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 34a830d..cfab98b 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -118,4 +118,5 @@ jobs: ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> XDG_CACHE_HOME: /mnt/ephemeral/caches -orbs: {} \ No newline at end of file +orbs: + workflows: aspect-build/workflows@5.8.18 \ No newline at end of file From 0ecb2ab3c5cd743ddf847deae307d5ed3c8bf1d8 Mon Sep 17 00:00:00 2001 From: Matt Cramer Date: Thu, 9 Oct 2025 13:00:30 -0600 Subject: [PATCH 4/5] remove delivery step --- .circleci/config.yml | 36 +++++------------------------------- 1 file changed, 5 insertions(+), 31 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index cfab98b..bb73ccc 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -29,20 +29,6 @@ jobs: name: Build command: rosetta run build --workspace << parameters.workspace >> no_output_timeout: 180m - - when: - condition: - and: - - <> - - or: - - matches: - pattern: ^main$ - value: << pipeline.git.branch >> - steps: - - run: - name: Delivery manifest - command: rosetta run delivery_manifest --workspace << parameters.workspace >> - --data TARGETS_SOURCE=build - no_output_timeout: 180m - store_artifacts: path: /workflows/testlogs - store_artifacts: @@ -55,9 +41,6 @@ jobs: parameters: &a1 workspace: type: string - delivery_manifest: - type: boolean - default: true environment: ASPECT_WORKFLOWS_CIRCLE_PIPELINE_NUMBER: << pipeline.number >> ASPECT_WORKFLOWS_CIRCLE_PIPELINE_PROJECT_TYPE: << pipeline.project.type >> @@ -87,20 +70,6 @@ jobs: no_output_timeout: 180m - store_test_results: path: /workflows/testlogs - - when: - condition: - and: - - <> - - or: - - matches: - pattern: ^main$ - value: << pipeline.git.branch >> - steps: - - run: - name: Delivery manifest - command: rosetta run delivery_manifest --workspace << parameters.workspace >> - --data TARGETS_SOURCE=test - no_output_timeout: 180m - store_artifacts: path: /workflows/testlogs - store_artifacts: @@ -118,5 +87,10 @@ jobs: ASPECT_WORKFLOWS_CONFIG: .aspect/workflows/config.yaml ASPECT_WORKFLOWS_WORKSPACE: << parameters.workspace >> XDG_CACHE_HOME: /mnt/ephemeral/caches +parameters: + workspace: + default: . + description: The workspace that the `delivery_targets` live within. + type: string orbs: workflows: aspect-build/workflows@5.8.18 \ No newline at end of file From 0ac2ac23cd0e1c9b60ee261ab785c3d30d0e5f0d Mon Sep 17 00:00:00 2001 From: Matt Cramer Date: Thu, 9 Oct 2025 13:21:29 -0600 Subject: [PATCH 5/5] chore: reduce the cluster footprint and shorten idle timeout to save cost --- workflows.tf | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/workflows.tf b/workflows.tf index 44c0500..550e8d5 100755 --- a/workflows.tf +++ b/workflows.tf @@ -18,14 +18,14 @@ source = "https://static.aspect.build/aspect/5.14.12/terraform-gcp-aspect-workfl # Ask Aspect about right sizing remote cache size & throughput for your build. standard_nodes = { min_count = 1 - max_count = 20 + max_count = 5 machine_type = "e2-standard-4" } # WORKFLOWS_TEMPLATE: Customize your remote cache size. # Ask Aspect about right sizing the remote cache size & throughput for your build. remote_cache_nodes = { # 3 shards with 375GiB SSDs each = 1.125TiB cache size - count = 3 + count = 1 machine_type = "c3-standard-4-lssd" } # WORKFLOWS_TEMPLATE: Uncomment the `remote_exec_nodes` block to enable remote execution. @@ -46,7 +46,7 @@ remote = { } cache = { # WORKFLOWS_TEMPLATE: `shards` should match `k8s_cluster.remote_cache_nodes.count` above. - shards = 3 + shards = 1 } # WORKFLOWS_TEMPLATE: Uncomment the `remote_execution` block to enable remote execution. # Ask Aspect about right sizing the remote execution cluster to your workloads. @@ -108,7 +108,7 @@ machine_type = "c2d-standard-4" gha_runner_groups = { # The `default` runner group is used for general bazel tasks such as build & test. default = { - agent_idle_timeout_min = 120 + agent_idle_timeout_min = 30 gh_repo = "writechoiceorg/node-app-js-gcp" # `org/repo` of the GitHub repository under test gha_workflow_ids = [194627850, 192221730] # WORKFLOWS_TEMPLATE: to reduce GitHub API call frequency and prevent rate limiting, add the workflow ID of the Aspect Workflows main GitHub Action max_runners = 50 @@ -122,7 +122,7 @@ machine_type = "c2d-standard-4" # These are intentionally small, inexpensive, long-lived instances that are not # meant for running bazel tasks. small = { - agent_idle_timeout_min = 720 + agent_idle_timeout_min = 30 gh_repo = "writechoiceorg/node-app-js-gcp" # `org/repo` of the GitHub repository under test gha_workflow_ids = [194627850, 192221730] # WORKFLOWS_TEMPLATE: to reduce GitHub API call frequency and prevent rate limiting, add the workflow ID of the Aspect Workflows main GitHub Action max_runners = 4 @@ -150,8 +150,8 @@ machine_type = "c2d-standard-4" cci_runner_groups = { # The `default` runner group is used for general bazel tasks such as build & test. default = { - agent_idle_timeout_min = 120 - max_runners = 50 + agent_idle_timeout_min = 30 + max_runners = 5 min_runners = 0 resource_type = "default" scaling_polling_frequency = 2 # check for new jobs every 30s @@ -171,8 +171,8 @@ machine_type = "c2d-standard-4" bk_runner_groups = { # The `default` runner group is used for general bazel tasks such as build & test. default = { - agent_idle_timeout_min = 120 - max_runners = 50 + agent_idle_timeout_min = 30 + max_runners = 5 min_runners = 0 queue = "aspect-default" resource_type = "default" @@ -189,7 +189,7 @@ machine_type = "c2d-standard-4" # These are intentionally small, inexpensive, long-lived instances that are not # meant for running bazel tasks. small = { - agent_idle_timeout_min = 720 + agent_idle_timeout_min = 30 max_runners = 4 min_runners = 0 queue = "aspect-small"