@@ -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