Skip to content

Commit e9c9531

Browse files
committed
workbench: fix for Nomad profile renames, were using qa class nodes
1 parent 2fb788f commit e9c9531

File tree

3 files changed

+30
-13
lines changed

3 files changed

+30
-13
lines changed

nix/workbench/backend/nomad-job.nix

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -269,10 +269,11 @@ let
269269
constraint = {
270270
attribute = "\${node.class}";
271271
operator = "=";
272-
# For testing we avoid using "infra" node class as HA jobs runs there
273-
# For benchmarking dedicated static machines in the "perf"
274-
# class are used and this value should be updated accordingly.
275-
value = "qa";
272+
# For cloud benchmarking dedicated static machines in the "perf"
273+
# class are used. We replicate that for local/test runs.
274+
# Class "qa" nodes are also available but must be limited to short
275+
# test and avoid using "infra" node class as HA jobs runs there.
276+
value = "perf";
276277
};
277278

278279
# The network stanza specifies the networking requirements for the task

nix/workbench/backend/nomad.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3116,7 +3116,7 @@ client {
31163116
31173117
# Specifies an arbitrary string used to logically group client nodes by
31183118
# user-defined class. This can be used during job placement as a filter.
3119-
node_class = "qa" # Using the "world.dev.cardano.org" testing class for "perf".
3119+
node_class = "perf" # Using the "world.dev.cardano.org" testing class for "perf".
31203120
31213121
# "artifact" parameters (fail fast!!!)
31223122
######################################

nix/workbench/backend/nomad/cloud.sh

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -226,6 +226,15 @@ backend_nomadcloud() {
226226
# Set the placement info and resources accordingly
227227
local nomad_job_name
228228
nomad_job_name=$(jq -r ". [\"job\"] | keys[0]" "${dir}"/nomad/nomad-job.json)
229+
##########################################################################
230+
# Profile name dependent changes #########################################
231+
##########################################################################
232+
# "cw-perf-*" profiles are profiles that only run on Cardano World's Nomad
233+
# Nodes of class "perf".
234+
# Other cloud profiles are for example "ci-test-cw-qa", "ci-test-cw-perf",
235+
# "ci-test-cw-qa", "ci-test-cw-perf". "qa" means that they run on Nomad
236+
# nodes that belong to the "qa" class, runs on these should be limited to
237+
# short tests and must never use the "infra" class where HA jobs runs.
229238
if test -z "${WB_SHELL_PROFILE:-}"
230239
then
231240
fatal "Envar \"WB_SHELL_PROFILE\" is empty!"
@@ -274,27 +283,33 @@ backend_nomadcloud() {
274283
# Node class: ##########################################################
275284
########################################################################
276285
local group_constraints_array
277-
# "perf" profiles run on the "perf" class
278-
if test "${WB_SHELL_PROFILE:0:7}" = 'cw-perf'
286+
# "perf" class nodes are the default unless the profile name contains
287+
# "cw-qa", we try to limit the usage of Nomad nodes that are not
288+
# dedicated Perf team nodes.
289+
# But also, we have to be careful that "perf" runs do not overlap. We
290+
# are making "perf" class nodes runs can't clash because service names
291+
# and resources definitions currently won't allow that to happen but
292+
# still a new "perf" run may mess up a previously running cluster.
293+
if echo "${WB_SHELL_PROFILE}" | grep --quiet "cw-qa"
279294
then
280-
# Using Performance & Tracing exclusive "perf" class distinct nodes!
295+
# Using "qa" class distinct nodes. Only "short" test allowed here.
281296
group_constraints_array='
282297
[
283298
{
284299
"operator": "="
285300
, "attribute": "${node.class}"
286-
, "value": "perf"
301+
, "value": "qa"
287302
}
288303
]
289304
'
290305
else
291-
# Using "qa" class distinct nodes. Only "short" test allowed here.
306+
# Using Performance & Tracing exclusive "perf" class distinct nodes!
292307
group_constraints_array='
293308
[
294309
{
295310
"operator": "="
296311
, "attribute": "${node.class}"
297-
, "value": "qa"
312+
, "value": "perf"
298313
}
299314
]
300315
'
@@ -310,8 +325,9 @@ backend_nomadcloud() {
310325
# Memory/resources: ####################################################
311326
########################################################################
312327
# Set the resources, only for perf!
313-
# When not "perf", when "cw-qa", only "short" tests are allowed.
314-
if test "${WB_SHELL_PROFILE:0:7}" = 'cw-perf'
328+
# When not "perf", when "cw-qa", only "short" tests are allowed on
329+
# whatever resources we are given.
330+
if echo "${WB_SHELL_PROFILE}" | grep --quiet "cw-perf"
315331
then
316332
# Producer nodes use this specs, make sure they are available!
317333
# AWS:

0 commit comments

Comments
 (0)