@@ -71,8 +71,56 @@ data "coder_parameter" "dry_run" {
71
71
ephemeral = true
72
72
}
73
73
74
+ data "coder_parameter" "create_concurrency" {
75
+ order = 10
76
+ type = " number"
77
+ name = " Create concurrency"
78
+ default = 10
79
+ description = " The number of workspaces to create concurrently."
80
+ mutable = true
81
+
82
+ # Setting zero = unlimited, but perhaps not a good idea,
83
+ # we can raise this limit instead.
84
+ validation {
85
+ min = 1
86
+ max = 100
87
+ }
88
+ }
89
+
90
+ data "coder_parameter" "job_concurrency" {
91
+ order = 11
92
+ type = " number"
93
+ name = " Scaletest job concurrency"
94
+ default = 10
95
+ description = " The number of concurrent jobs (e.g. when producing workspace traffic)."
96
+ mutable = true
97
+
98
+ # Setting zero = unlimited, but perhaps not a good idea,
99
+ # we can raise this limit instead.
100
+ validation {
101
+ min = 1
102
+ max = 100
103
+ }
104
+ }
105
+
106
+ data "coder_parameter" "cleanup_concurrency" {
107
+ order = 12
108
+ type = " number"
109
+ name = " Cleanup concurrency"
110
+ default = 10
111
+ description = " The number of concurrent cleanup jobs."
112
+ mutable = true
113
+
114
+ # Setting zero = unlimited, but perhaps not a good idea,
115
+ # we can raise this limit instead.
116
+ validation {
117
+ min = 1
118
+ max = 100
119
+ }
120
+ }
121
+
74
122
data "coder_parameter" "workspace_template" {
75
- order = 3
123
+ order = 20
76
124
name = " workspace_template"
77
125
display_name = " Workspace Template"
78
126
description = " The template used for workspace creation."
@@ -106,7 +154,7 @@ data "coder_parameter" "workspace_template" {
106
154
}
107
155
108
156
data "coder_parameter" "num_workspaces" {
109
- order = 10
157
+ order = 21
110
158
type = " number"
111
159
name = " Number of workspaces to create"
112
160
default = 100
@@ -142,16 +190,20 @@ resource "coder_agent" "main" {
142
190
CODER_CONFIG_DIR : " /home/coder/.config/coderv2" ,
143
191
CODER_USER_TOKEN : data.coder_workspace.me.owner_session_token,
144
192
CODER_URL : data.coder_workspace.me.access_url,
193
+
194
+ # Global scaletest envs that may affect each `coder exp scaletest` invocation.
145
195
CODER_SCALETEST_PROMETHEUS_ADDRESS : " 0.0.0.0:21112" ,
146
196
CODER_SCALETEST_PROMETHEUS_WAIT : " 60s" ,
197
+ CODER_SCALETEST_CONCURRENCY : " ${ data . coder_parameter . job_concurrency . value } " ,
198
+ CODER_SCALETEST_CLEANUP_CONCURRENCY : " ${ data . coder_parameter . cleanup_concurrency . value } " ,
147
199
200
+ # Local envs passed as arguments to `coder exp scaletest` invocations.
148
201
SCALETEST_RUN_ID : local.scaletest_run_id,
149
202
SCALETEST_RUN_DIR : local.scaletest_run_dir,
150
203
SCALETEST_TEMPLATE : data.coder_parameter.workspace_template.value,
151
204
SCALETEST_SKIP_CLEANUP : " 1" ,
152
205
SCALETEST_NUM_WORKSPACES : data.coder_parameter.num_workspaces.value,
153
- SCALETEST_CREATE_CONCURRENCY : " 10" ,
154
- SCALETEST_CLEANUP_CONCURRENCY : " 10" ,
206
+ SCALETEST_CREATE_CONCURRENCY : " ${ data . coder_parameter . create_concurrency . value } " ,
155
207
156
208
SCRIPTS_ZIP : filebase64 (data. archive_file . scripts_zip . output_path ),
157
209
SCRIPTS_DIR : " /tmp/scripts" ,
0 commit comments