diff --git a/.aspect/workflows/README.md b/.aspect/workflows/README.md index 8c522de21..ac2d6d68e 100644 --- a/.aspect/workflows/README.md +++ b/.aspect/workflows/README.md @@ -1,20 +1,15 @@ # Aspect Workflows demonstration deployment -This deployment of [Aspect Workflows](https://www.aspect.build/workflows) is configured to run on GCP + Buildkite. +This deployment of [Aspect Workflows](https://www.aspect.build/workflows) is configured to run on Buildkite. You can see this Aspect Workflows demonstration deployment live at https://buildkite.com/aspect/rules-js. -The three components of the configuration are, +The two components of the configuration for this repository are, -1. Aspect Workflows terraform module 1. Aspect Workflows configuration yaml 1. Buildkite pipeline configuration (in the Buildkite UI) -## Aspect Workflows terraform module - -This is found under the [.aspect/workflows/terraform](./terraform) directory. - ## Aspect Workflows configuration yaml This is the [config.yaml](./config.yaml) file in this directory. @@ -37,9 +32,12 @@ steps: commands: - "rosetta steps | buildkite-agent pipeline upload" agents: - queue: aspect-default + queue: aspect-small ``` +> [!IMPORTANT] +> The Setup Aspect Workflows step above is configured to run on the `aspect-small` queue that is serviced by a runner group made up of lightweight and inexpensive `e2.small` GCP VM instances. + ### Scheduled warming pipeline configuration The scheduled warming pipeline found at https://buildkite.com/aspect/rules-js-warming is diff --git a/.aspect/workflows/config.yaml b/.aspect/workflows/config.yaml index cb5bda763..ed1b04ba7 100644 --- a/.aspect/workflows/config.yaml +++ b/.aspect/workflows/config.yaml @@ -5,10 +5,11 @@ workspaces: label: rules_js tasks: - test: - queue: aspect-default e2e/bzlmod: icon: bazel tasks: + - test: + queue: aspect-default - format: without: true - buildifier: @@ -23,6 +24,8 @@ workspaces: e2e/js_image_oci: icon: linux tasks: + - test: + queue: aspect-default - format: without: true - buildifier: @@ -36,6 +39,8 @@ workspaces: e2e/npm_link_package: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -47,6 +52,8 @@ workspaces: e2e/npm_link_package-esm: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -58,6 +65,8 @@ workspaces: e2e/npm_translate_lock: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -69,6 +78,8 @@ workspaces: e2e/npm_translate_lock_empty: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -80,6 +91,8 @@ workspaces: e2e/npm_translate_lock_multi: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -91,6 +104,8 @@ workspaces: e2e/npm_translate_lock_partial_clone: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -102,6 +117,8 @@ workspaces: e2e/npm_translate_lock_subdir_patch: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -117,6 +134,8 @@ workspaces: e2e/npm_translate_package_lock: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -128,6 +147,8 @@ workspaces: e2e/npm_translate_yarn_lock: icon: yarn tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -139,6 +160,8 @@ workspaces: e2e/package_json_module: icon: npm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -150,6 +173,8 @@ workspaces: e2e/pnpm_workspace: icon: pnpm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -161,6 +186,8 @@ workspaces: e2e/pnpm_workspace_rerooted: icon: pnpm tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -172,6 +199,8 @@ workspaces: e2e/rules_foo: icon: js tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -183,6 +212,8 @@ workspaces: e2e/vendored_node: icon: js tasks: + - test: + queue: aspect-medium - format: without: true - buildifier: @@ -198,16 +229,14 @@ tasks: - branch_freshness: update_strategy: none - test: - queue: aspect-small - format: - queue: aspect-small + queue: aspect-medium - buildifier: - queue: aspect-small + queue: aspect-medium - configure: - queue: aspect-small + queue: aspect-medium - delivery: auto_deliver: true - queue: aspect-default rules: - deliverable: 'attr("tags", "\bdeliverable\b", //...)' condition: diff --git a/.aspect/workflows/terraform/.terraform.lock.hcl b/.aspect/workflows/terraform/.terraform.lock.hcl deleted file mode 100644 index 8ed365b48..000000000 --- a/.aspect/workflows/terraform/.terraform.lock.hcl +++ /dev/null @@ -1,133 +0,0 @@ -# This file is maintained automatically by "terraform init". -# Manual edits may be lost in future updates. - -provider "registry.terraform.io/hashicorp/google" { - version = "4.81.0" - constraints = ">= 3.53.0, >= 4.63.1, < 5.0.0" - hashes = [ - "h1:TKydY88LYRsHJ05icwCU0NNy8ANWinWcs5teuSXVF2k=", - "h1:nD0kJSonVXFC1y5blicnLEsGYSkaC7T1zTVig+gI1Dk=", - "h1:nalbTQAn81Spx5arUAAj0N2tbUB7qXywYYm36WA+LQI=", - "zh:29f5ca33cba63fb8dd96a0074317295bb99708a8d5bc124efe41406f25e967cd", - "zh:3a1fd6da193a62777c2e83d7449df9990f78b3638a9b99ca2410fb678bd2dbba", - "zh:3d251ff3d83b3e877543a7638eb6953fcd4002328e2d32611acc4ca647f3a162", - "zh:4711bc9a2957368de9f333bb458cf85a769fd14313cb34c4bb56c472acaf7cca", - "zh:4f6acd5645b395a7a7f6991b91a2bf8d19a303232dc630fe8e7c7857c980445b", - "zh:54ad3f0745a9ecfb725a1d7627461fc9ec98f4b4f0930011137b828a93fe5c21", - "zh:8134b287fc0b8b88e50b4e082071163f7465077f7433a5ca13b7d2fa68c57f73", - "zh:848d9d30eb8360c993e96e1871b0cfecadfcf6f9669e52c1f3d5d4bc16afbd67", - "zh:851199bde801acbb90e262c01959f721e8c31853e1c8ad6478c70ae326b8544e", - "zh:883102ec2d28193ea036cf3db9f93355b3e2c69dc66eacc40aa958b4a3c30f47", - "zh:c09200ef6722f27e1f12165082c7eb137e622cea60fcf201c21609564d0e91d0", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - -provider "registry.terraform.io/hashicorp/google-beta" { - version = "4.81.0" - constraints = "< 5.0.0" - hashes = [ - "h1:ccLmnfXRD7NgTmoezt29Z+Kj46vFfbvJBwlwI+Bv/fE=", - "h1:i5GmPolFtcYUE7ZN9P95FkU6MHhfn5SQRbkeesytCYU=", - "h1:ib1pat/Ok69ZeonZ7kdTLRtT8FPJP0+UF75ZT6TYf5w=", - "zh:2177e06b4f6e7ea85bf475bc7c7012f94835f85237b8880fced6ede60279559d", - "zh:28c6e6b214218617273f38174b18ac8950af03908991a05fed860ddcefc16c2d", - "zh:417fa45c9edb1dd77a4360aa092cd47154076647f4e86c2b524ee83c59b22b3b", - "zh:42d56cbb13f1eaccfd681bc0fa6a249a926720334544bd352694888425e41a3c", - "zh:66048b36642eef5d019e58dbdc34b04e0c25cd3636e671d270f6be92d316021c", - "zh:6b2e42a53c04dbeb9519887ffd1da888b5049e774614daf47dd5ff169b323ab7", - "zh:8c9b6d6c58e4a2eec03ab16313c08f5d77f86ffdda5dcd19eaf5b3f619bf66f6", - "zh:ac3fe4990fa43beea23c9743b570c4e6da9b23f3ad73d96eb8c6bb81c534c649", - "zh:c2420e48a7a6d323d9ebc2f184c65734f70e73e2e0ade70ba5ce67f56c26dd41", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f6b3a64d62c1f459a814f9eaccec176a95140b707a9bc0cdc5826086075c571f", - "zh:fc58563042edf6a5fe3f7ce3efed21ae9a532b9b860653368028d6921ab17cdf", - ] -} - -provider "registry.terraform.io/hashicorp/helm" { - version = "2.11.0" - constraints = ">= 2.9.0" - hashes = [ - "h1:AOp9vXIM4uT1c/PVwsWTPiLVGlO2SSYrfiirV5rjCMQ=", - "h1:FGGkgKf12zBjPjrD0ANq7EhywWM00PvYYw7OTdT/Kq4=", - "h1:zxfRtgpWrVZwjkIBuI+7jc52+u1QBA/k7LQZiCiq3Z8=", - "zh:013857c88f3e19a4b162344e21dc51891c4ac8b600da8391f7fb2b6d234961e1", - "zh:044fffa233a93cdcf8384afbe9e1ab6c9d0b5b176cbae56ff465eb9611302975", - "zh:208b7cdd4fa3a1b25ae817dc00a9198ef98be0ddc3a577b5b72bc0f006afb997", - "zh:3e8b33f56cfe387277572a92037a1ca1cbe4e3aa6b5c19a8c2431193b07f7865", - "zh:7dd663d5619bd71676899b05b19d36f585189fdabc6b0b03c23579524a8fd9bf", - "zh:ae5329cb3e5bf0b86b02e823aac3ef3bd0d4b1618ff013cd0076dca0be8322e4", - "zh:ba6201695b55d51bedacdb017cb8d03d7a8ada51d0168ac44fef3fa791a85ab4", - "zh:c61285c8b1ba10f50cf94c9dcf98f2f3b720f14906a18be71b9b422279b5d806", - "zh:d522d388246f38b9f329c511ec579b516d212670b954f9dab64efb27e51862af", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - "zh:f92546e26b670da61437ae2cbd038427c9374ce5f7a78df52193397da90bd997", - "zh:f9ad1407e5c0d5e3474094491025bf100828e8c1a01acdf9591d7dd1eb59f961", - ] -} - -provider "registry.terraform.io/hashicorp/kubernetes" { - version = "2.23.0" - constraints = ">= 2.0.1" - hashes = [ - "h1:arTzD0XG/DswGCAx9JEttkSKe9RyyFW9W7UWcXF13dU=", - "h1:cMs2scNCSgQhGamomGT5Ag4i8ms/mql1AR7NJc2hmbA=", - "h1:xyFc77aYkPoU4Xt1i5t0B1IaS8TbTtp9aCSuQKDayII=", - "zh:10488a12525ed674359585f83e3ee5e74818b5c98e033798351678b21b2f7d89", - "zh:1102ba5ca1a595f880e67102bbf999cc8b60203272a078a5b1e896d173f3f34b", - "zh:1347cf958ed3f3f80b3c7b3e23ddda3d6c6573a81847a8ee92b7df231c238bf6", - "zh:2cb18e9f5156bc1b1ee6bc580a709f7c2737d142722948f4a6c3c8efe757fa8d", - "zh:5506aa6f28dcca2a265ccf8e34478b5ec2cb43b867fe6d93b0158f01590fdadd", - "zh:6217a20686b631b1dcb448ee4bc795747ebc61b56fbe97a1ad51f375ebb0d996", - "zh:8accf916c00579c22806cb771e8909b349ffb7eb29d9c5468d0a3f3166c7a84a", - "zh:9379b0b54a0fa030b19c7b9356708ec8489e194c3b5e978df2d31368563308e5", - "zh:aa99c580890691036c2931841e88e7ee80d59ae52289c8c2c28ea0ac23e31520", - "zh:c57376d169875990ac68664d227fb69cd0037b92d0eba6921d757c3fd1879080", - "zh:e6068e3f94f6943b5586557b73f109debe19d1a75ca9273a681d22d1ce066579", - "zh:f569b65999264a9416862bca5cd2a6177d94ccb0424f3a4ef424428912b9cb3c", - ] -} - -provider "registry.terraform.io/hashicorp/random" { - version = "3.4.3" - constraints = "~> 3.4.3" - hashes = [ - "h1:saZR+mhthL0OZl4SyHXZraxyaBNVMxiZzks78nWcZ2o=", - "h1:tL3katm68lX+4lAncjQA9AXL4GR/VM+RPwqYf4D2X8Q=", - "h1:xZGZf18JjMS06pFa4NErzANI98qi59SEcBsOcS2P2yQ=", - "zh:41c53ba47085d8261590990f8633c8906696fa0a3c4b384ff6a7ecbf84339752", - "zh:59d98081c4475f2ad77d881c4412c5129c56214892f490adf11c7e7a5a47de9b", - "zh:686ad1ee40b812b9e016317e7f34c0d63ef837e084dea4a1f578f64a6314ad53", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:84103eae7251384c0d995f5a257c72b0096605048f757b749b7b62107a5dccb3", - "zh:8ee974b110adb78c7cd18aae82b2729e5124d8f115d484215fd5199451053de5", - "zh:9dd4561e3c847e45de603f17fa0c01ae14cae8c4b7b4e6423c9ef3904b308dda", - "zh:bb07bb3c2c0296beba0beec629ebc6474c70732387477a65966483b5efabdbc6", - "zh:e891339e96c9e5a888727b45b2e1bb3fcbdfe0fd7c5b4396e4695459b38c8cb1", - "zh:ea4739860c24dfeaac6c100b2a2e357106a89d18751f7693f3c31ecf6a996f8d", - "zh:f0c76ac303fd0ab59146c39bc121c5d7d86f878e9a69294e29444d4c653786f8", - "zh:f143a9a5af42b38fed328a161279906759ff39ac428ebcfe55606e05e1518b93", - ] -} - -provider "registry.terraform.io/hashicorp/time" { - version = "0.9.1" - hashes = [ - "h1:NUv/YtEytDQncBQ2mTxnUZEy/rmDlPYmE9h2iokR0vk=", - "h1:UHcDnIYFZ00uoou0TwPGMwOrE8gTkoRephIvdwDAK70=", - "h1:VxyoYYOCaJGDmLz4TruZQTSfQhvwEcMxvcKclWdnpbs=", - "zh:00a1476ecf18c735cc08e27bfa835c33f8ac8fa6fa746b01cd3bcbad8ca84f7f", - "zh:3007f8fc4a4f8614c43e8ef1d4b0c773a5de1dcac50e701d8abc9fdc8fcb6bf5", - "zh:5f79d0730fdec8cb148b277de3f00485eff3e9cf1ff47fb715b1c969e5bbd9d4", - "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", - "zh:8c8094689a2bed4bb597d24a418bbbf846e15507f08be447d0a5acea67c2265a", - "zh:a6d9206e95d5681229429b406bc7a9ba4b2d9b67470bda7df88fa161508ace57", - "zh:aa299ec058f23ebe68976c7581017de50da6204883950de228ed9246f309e7f1", - "zh:b129f00f45fba1991db0aa954a6ba48d90f64a738629119bfb8e9a844b66e80b", - "zh:ef6cecf5f50cda971c1b215847938ced4cb4a30a18095509c068643b14030b00", - "zh:f1f46a4f6c65886d2dd27b66d92632232adc64f92145bf8403fe64d5ffa5caea", - "zh:f79d6155cda7d559c60d74883a24879a01c4d5f6fd7e8d1e3250f3cd215fb904", - "zh:fd59fa73074805c3575f08cd627eef7acda14ab6dac2c135a66e7a38d262201c", - ] -} diff --git a/.aspect/workflows/terraform/README.md b/.aspect/workflows/terraform/README.md deleted file mode 100644 index 46913a245..000000000 --- a/.aspect/workflows/terraform/README.md +++ /dev/null @@ -1,7 +0,0 @@ -# Aspect Workflows demonstration deployment terraform - -The terraform configuration found here is for a clean GCP project with only Aspect Workflows deployed. - -- `main.tf` : terraform backend configuration -- `vpc.tf` : VPC configuration -- `workflows.tf` : Aspect Workflows terraform module & VM image configuration diff --git a/.aspect/workflows/terraform/main.tf b/.aspect/workflows/terraform/main.tf deleted file mode 100644 index a29e2ef83..000000000 --- a/.aspect/workflows/terraform/main.tf +++ /dev/null @@ -1,15 +0,0 @@ -terraform { - required_version = ">= 1.5.0" - - backend "gcs" { - bucket = "aw-deployment-terraform-state-rules-js" - prefix = "terraform/state" - } -} - -locals { - # Project & region of the Workflows deployment. Alternately, you may configure a global `provider - # "google"` with the desired project & region and the Workflows module will default to that. - project = "aw-deployment-rules-js" - region = "us-west2" -} diff --git a/.aspect/workflows/terraform/vpc.tf b/.aspect/workflows/terraform/vpc.tf deleted file mode 100644 index 12fb45862..000000000 --- a/.aspect/workflows/terraform/vpc.tf +++ /dev/null @@ -1,57 +0,0 @@ -resource "google_compute_network" "workflows_network" { - name = "workflows-network" - project = local.project - auto_create_subnetworks = false - routing_mode = "REGIONAL" -} - -resource "google_compute_subnetwork" "workflows_subnet" { - name = "workflows-subnet" - project = local.project - region = local.region - ip_cidr_range = "10.2.0.0/16" - network = google_compute_network.workflows_network.id -} - -resource "google_compute_firewall" "ssh" { - name = "allow-ssh" - project = local.project - description = "Enable SSHing into VM instances" - allow { - ports = ["22"] - protocol = "tcp" - } - direction = "INGRESS" - network = google_compute_network.workflows_network.id - priority = 1000 - source_ranges = ["0.0.0.0/0"] -} - -resource "google_compute_router" "router" { - name = "router" - project = local.project - region = local.region - network = google_compute_network.workflows_network.id - - bgp { - asn = 64514 - } -} - -resource "google_compute_router_nat" "nat" { - name = "router-nat" - project = local.project - region = local.region - router = google_compute_router.router.name - nat_ip_allocate_option = "AUTO_ONLY" - source_subnetwork_ip_ranges_to_nat = "ALL_SUBNETWORKS_ALL_IP_RANGES" - - # Allow the ports assigned to each VM scale up and down as needed - # https://cloud.google.com/nat/docs/ports-and-addresses#dynamic-port - enable_dynamic_port_allocation = true - # Must be disabled when dynamic port allocation is enabled (default is true) - enable_endpoint_independent_mapping = false - # The min number of ports can be tuned by monitoring port usage: - # https://cloud.google.com/nat/docs/tune-nat-configuration#choose-minimum - min_ports_per_vm = 32 -} diff --git a/.aspect/workflows/terraform/workflows.tf b/.aspect/workflows/terraform/workflows.tf deleted file mode 100644 index 8bf364dc6..000000000 --- a/.aspect/workflows/terraform/workflows.tf +++ /dev/null @@ -1,127 +0,0 @@ -data "google_compute_image" "runner_image" { - # Aspect's GCP aspect-workflows-images project provides public Aspect Workflows GCP images for - # getting started during the trial period. We recommend that all Workflows users build their own - # GCP images and keep up-to date with patches. See - # https://docs.aspect.build/workflows/install/packer for more info and/or - # https://github.com/aspect-build/workflows-images for example packer scripts and BUILD targets - # for building GCP images for Workflows. - project = "aspect-workflows-images" - name = "aspect-workflows-ubuntu-2304-kitchen-sink-amd64-1-6-0" -} - -module "aspect_workflows" { - # Project & region configuration. This is optional. Alternately, you may configure a global - # provider project & region and the Workflows module will default to that. - project = local.project - region = local.region - - # Aspect Workflows terraform module - source = "https://s3.us-east-2.amazonaws.com/static.aspect.build/aspect/5.9.22/terraform-gcp-aspect-workflows.zip" - - # Network properties - network = google_compute_network.workflows_network.id - subnetwork = google_compute_subnetwork.workflows_subnet.id - - # Number of nodes & machine type in the kubernetes cluster where the remote cache & observability - # services run. - k8s_cluster = { - # Kubernetes cluster on this deploymemt is tuned for cost. A high-performance deployment should - # use a minimum of e2-highmem-4 and multiple nodes so that the cache can be sharded. - node_count = 1 - machine_type = "e2-medium" - } - - # Delivery properties - delivery_enabled = true - - # Remote cache configuration - remote = { - # Kubernetes cluster on this deploymemt is tuned for cost. A high-performance deployment should - # use a use multiple cache shards. - cache_shards = 1 - cache_size_gb = 384 - load_balancer_replicas = 1 - replicate_cache = false - } - - # CI properties - hosts = ["bk"] - - # Warming set definitions - warming_sets = { - default = {} - } - - # Resource types for use by runner groups. Aspect recommends machines types that have SSD drives - # for large Bazel workflows. See - # https://cloud.google.com/compute/docs/machine-resource#machine_type_comparison for list of - # machine types availble on GCP. - resource_types = { - default = { - machine_type = "n1-standard-4" - image_id = data.google_compute_image.runner_image.id - } - small = { - machine_type = "e2-medium" - num_ssds = 0 - image_id = data.google_compute_image.runner_image.id - } - micro = { - machine_type = "e2-small" - num_ssds = 0 - image_id = data.google_compute_image.runner_image.id - } - } - - # Buildkite runner group definitions - bk_runner_groups = { - # The default runner group is use for the main build & test workflows. - default = { - agent_idle_timeout_min = 1 - git_clone_depth = 64 - max_runners = 10 - min_runners = 0 - queue = "aspect-default" - reaper_sleep_minutes = 5 - resource_type = "default" - scaling_polling_frequency = 3 # check for queued jobs every 20s - warming = true - } - small = { - agent_idle_timeout_min = 1 - git_clone_depth = 64 - max_runners = 20 - min_runners = 0 - queue = "aspect-small" - reaper_sleep_minutes = 10 - resource_type = "small" - scaling_polling_frequency = 3 # check for queued jobs every 20s - warming = false # don't warm for faster bootstrap; these runners won't be running large builds - } - micro = { - agent_idle_timeout_min = 60 * 12 - git_clone_depth = 64 - max_runners = 10 - min_runners = 0 - queue = "aspect-micro" - reaper_sleep_minutes = 10 - resource_type = "micro" - scaling_polling_frequency = 3 # check for queued jobs every 20s - warming = false # don't warm for faster bootstrap; these runners won't be running large builds - } - # The warming runner group is used for the periodic warming job that creates - # warming archives for use by other runner groups. - warming = { - agent_idle_timeout_min = 1 - git_clone_depth = 1 - max_runners = 1 - min_runners = 0 - queue = "aspect-warming" - reaper_sleep_minutes = 10 - resource_type = "default" - } - } - - # This varies by each customer. This one is dedicated to rules_js. - pagerduty_integration_key = "6c16035a05834405d0920f74b4b326c5" -}