-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathworkflows.tf
More file actions
executable file
·212 lines (203 loc) · 9.12 KB
/
workflows.tf
File metadata and controls
executable file
·212 lines (203 loc) · 9.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
locals {
customer_id = "writechoice"
pagerduty_key = "PAGERDUTY_KEY" # replace with Aspect provided PagerDuty integration key
}
module "aspect_workflows" {
customer_id = local.customer_id
source = "https://static.aspect.build/aspect/5.14.12/terraform-gcp-aspect-workflows.zip"
network = google_compute_network.workflows_network.id
subnetwork = google_compute_subnetwork.workflows_subnet.id
zones = local.zones
k8s_cluster = {
# WORKFLOWS_TEMPLATE: Large builds that with heavy remote cache usage may need a larger node pool
# for scaling the remote cache frontend.
# Ask Aspect about right sizing remote cache size & throughput for your build.
standard_nodes = {
min_count = 1
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 = 1
machine_type = "c3-standard-4-lssd"
}
# WORKFLOWS_TEMPLATE: Uncomment the `remote_exec_nodes` block to enable remote execution.
# Ask Aspect about right sizing the remote execution cluster to your workloads.
# remote_exec_nodes = {
# default = {
# min_count = 0
# max_count = 10
# machine_type = "c2d-standard-4"
# num_ssds = 1
# }
# }
}
remote = {
frontend = {
min_scaling = 1
max_scaling = 20
}
cache = {
# WORKFLOWS_TEMPLATE: `shards` should match `k8s_cluster.remote_cache_nodes.count` above.
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.
# remote_execution = {
# executors = {
# default = {
# platform = "Linux"
# image = "ghcr.io/catthehacker/ubuntu:act-22.04@sha256:5f9c35c25db1d51a8ddaae5c0ba8d3c163c5e9a4a6cc97acd409ac7eae239448"
# node_type = "default"
# min_scaling = 0
# max_scaling = 10
# concurrency = 4
# }
# }
# }
}
delivery_enabled = true
warming_sets = {
default = {}
}
# WORKFLOWS_TEMPLATE: You can add tags to the resources created by aspect workflows
# for the purposes of tracking / cost analysis.
# Note that workflows adds the following tag to all resources by default
# "created-by": "aspect-workflows"
# tags = {
# "some-tag-key": "some-tag-value"
# }
resource_types = {
# WORKFLOWS_TEMPLATE: `small` runner type is recommended for the Setup Aspect Workflows steps on Buildkite
# and GitHub Actions. You can remove this runner type if not using Buildkite or GitHub Actions for your CI.
small = {
machine_type = "e2-small"
image_id = data.google_compute_image.runner_image.id
# WORKFLOWS_TEMPLATE: You can add tags to the resources from a specific resource type.
# Note that workflows adds the following tag to all resources by default
# "created-by": "aspect-workflows"
# tags = {
# "some-resource-tag-key": "some-resource-tag-value"
# }
}
default = {
machine_type = "c2d-standard-4"
image_id = data.google_compute_image.runner_image.id
num_ssds = 1
}
}
# WORKFLOWS_TEMPLATE:
hosts = ["gha", "cci", "bk"] # supported CI systems: "gha" (GitHub Actions), "cci" (CircleCI), "bk" (Buildkite)
# Github Actions runner groups
# WORKFLOWS_TEMPLATE: Once the Aspect Workflows GitHub actions land in your repository, run the following command
# using the GitHub CLI to determine the workflow ID for the `gha_workflow_ids` fields below:
# gh api -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" /repos/<org>/<repo>/actions/workflows
# See https://docs.github.com/en/rest/actions/workflows?apiVersion=2022-11-28#list-repository-workflows for more info.
gha_runner_groups = {
# The `default` runner group is used for general bazel tasks such as build & test.
default = {
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
min_runners = 0
queue = "aspect-default"
resource_type = "default"
scaling_polling_frequency = 2 # check for new jobs every 30s
warming = true
}
# The `small` runner group is used for the Setup Aspect Workflows pipeline step.
# These are intentionally small, inexpensive, long-lived instances that are not
# meant for running bazel tasks.
small = {
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
min_runners = 0
queue = "aspect-small"
resource_type = "small"
scaling_polling_frequency = 2 # check for new jobs every 30s
warming = false # no need to warm this runner since it doesn't run bazel
}
# The `warming` running group is used for the warming job to create warming
# archives used by other runner groups to pre-warm external repositories
# during bootstrap in order to speed up their first jobs.
warming = {
agent_idle_timeout_min = 1
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 warming GitHub Action
max_runners = 1
min_runners = 0
queue = "aspect-warming"
resource_type = "default"
warming = false # do not warm runners used to generate warming archives
}
}
# CircleCI runner groups
cci_runner_groups = {
# The `default` runner group is used for general bazel tasks such as build & test.
default = {
agent_idle_timeout_min = 30
max_runners = 5
min_runners = 0
resource_type = "default"
scaling_polling_frequency = 2 # check for new jobs every 30s
warming = true
}
# The `warming` running group is used for the warming job to create warming
# archives used by other runner groups to pre-warm external repositories
# during bootstrap in order to speed up their first jobs.
warming = {
agent_idle_timeout_min = 1
max_runners = 1
min_runners = 0
resource_type = "default"
warming = false # do not warm runners used to generate warming archives
}
}
bk_runner_groups = {
# The `default` runner group is used for general bazel tasks such as build & test.
default = {
agent_idle_timeout_min = 30
max_runners = 5
min_runners = 0
queue = "aspect-default"
resource_type = "default"
scaling_polling_frequency = 2 # check for new jobs every 30s
warming = true
# WORKFLOWS_TEMPLATE: You can add tags to the resources from a specific runner group.
# Note that workflows adds the following tag to all resources by default
# "created-by": "aspect-workflows"
# tags = {
# "some-runner-tag-key": "some-runner-tag-value"
# }
}
# The `small` runner group is used for the Setup Aspect Workflows pipeline step.
# These are intentionally small, inexpensive, long-lived instances that are not
# meant for running bazel tasks.
small = {
agent_idle_timeout_min = 30
max_runners = 4
min_runners = 0
queue = "aspect-small"
resource_type = "small"
scaling_polling_frequency = 2 # check for new jobs every 30s
warming = false # no need to warm this runner since it doesn't run bazel
}
# The `warming` running group is used for the warming job to create warming
# archives used by other runner groups to pre-warm external repositories
# during bootstrap in order to speed up their first jobs.
warming = {
agent_idle_timeout_min = 1
max_runners = 1
min_runners = 0
queue = "aspect-warming"
resource_type = "default"
warming = false # do not warm runners used to generate warming archives
}
}
}