From 2bd106a013805ba4e16dbdc456d6731f8f36ec85 Mon Sep 17 00:00:00 2001 From: David Huber <69919478+DavidHuber-NOAA@users.noreply.github.com> Date: Wed, 3 Jul 2024 11:32:40 -0400 Subject: [PATCH] Hotfix for undefined CLUSTERS (#2748) Defines `CLUSTERS` as an empty string for all hosts except Gaea and uses the native `dict` `get` method to prevent grabbing an unset entry. --- workflow/hosts/awspw.yaml | 1 + workflow/hosts/container.yaml | 1 + workflow/hosts/hera.yaml | 1 + workflow/hosts/hercules.yaml | 1 + workflow/hosts/jet.yaml | 1 + workflow/hosts/orion.yaml | 1 + workflow/hosts/s4.yaml | 1 + workflow/hosts/wcoss2.yaml | 1 + workflow/rocoto/tasks.py | 2 +- 9 files changed, 9 insertions(+), 1 deletion(-) diff --git a/workflow/hosts/awspw.yaml b/workflow/hosts/awspw.yaml index d2223e799e..b7021a6e3f 100644 --- a/workflow/hosts/awspw.yaml +++ b/workflow/hosts/awspw.yaml @@ -14,6 +14,7 @@ QUEUE_SERVICE: batch PARTITION_BATCH: compute PARTITION_SERVICE: compute RESERVATION: '' +CLUSTERS: '' CHGRP_RSTPROD: 'YES' CHGRP_CMD: 'chgrp rstprod' # TODO: This is not yet supported. HPSSARCH: 'YES' diff --git a/workflow/hosts/container.yaml b/workflow/hosts/container.yaml index 5f4a66ac1f..907f69754e 100644 --- a/workflow/hosts/container.yaml +++ b/workflow/hosts/container.yaml @@ -14,6 +14,7 @@ QUEUE_SERVICE: '' PARTITION_BATCH: '' PARTITION_SERVICE: '' RESERVATION: '' +CLUSTERS: '' CHGRP_RSTPROD: 'YES' CHGRP_CMD: 'chgrp rstprod' HPSSARCH: 'NO' diff --git a/workflow/hosts/hera.yaml b/workflow/hosts/hera.yaml index 8cf7363605..76a7158f43 100644 --- a/workflow/hosts/hera.yaml +++ b/workflow/hosts/hera.yaml @@ -16,6 +16,7 @@ PARTITION_BATCH: hera PARTITION_SERVICE: service RESERVATION: '' CHGRP_RSTPROD: 'YES' +CLUSTERS: '' CHGRP_CMD: 'chgrp rstprod' HPSSARCH: 'YES' HPSS_PROJECT: emc-global diff --git a/workflow/hosts/hercules.yaml b/workflow/hosts/hercules.yaml index adebdfe23d..975558160f 100644 --- a/workflow/hosts/hercules.yaml +++ b/workflow/hosts/hercules.yaml @@ -16,6 +16,7 @@ PARTITION_BATCH: hercules PARTITION_SERVICE: service RESERVATION: '' CHGRP_RSTPROD: 'YES' +CLUSTERS: '' CHGRP_CMD: 'chgrp rstprod' HPSSARCH: 'NO' HPSS_PROJECT: emc-global diff --git a/workflow/hosts/jet.yaml b/workflow/hosts/jet.yaml index fd556fadc7..b526e073c3 100644 --- a/workflow/hosts/jet.yaml +++ b/workflow/hosts/jet.yaml @@ -16,6 +16,7 @@ PARTITION_BATCH: kjet PARTITION_SERVICE: service RESERVATION: '' CHGRP_RSTPROD: 'YES' +CLUSTERS: '' CHGRP_CMD: 'chgrp rstprod' HPSSARCH: 'YES' HPSS_PROJECT: emc-global diff --git a/workflow/hosts/orion.yaml b/workflow/hosts/orion.yaml index ba289df1e3..fe36c8e7ce 100644 --- a/workflow/hosts/orion.yaml +++ b/workflow/hosts/orion.yaml @@ -16,6 +16,7 @@ PARTITION_BATCH: orion PARTITION_SERVICE: service RESERVATION: '' CHGRP_RSTPROD: 'YES' +CLUSTERS: '' CHGRP_CMD: 'chgrp rstprod' HPSSARCH: 'NO' HPSS_PROJECT: emc-global diff --git a/workflow/hosts/s4.yaml b/workflow/hosts/s4.yaml index 543912cf23..37479fa13c 100644 --- a/workflow/hosts/s4.yaml +++ b/workflow/hosts/s4.yaml @@ -16,6 +16,7 @@ PARTITION_BATCH: s4 PARTITION_SERVICE: serial RESERVATION: '' CHGRP_RSTPROD: 'NO' +CLUSTERS: '' CHGRP_CMD: 'ls' HPSSARCH: 'NO' HPSS_PROJECT: emc-global diff --git a/workflow/hosts/wcoss2.yaml b/workflow/hosts/wcoss2.yaml index 4943495289..e3650e4710 100644 --- a/workflow/hosts/wcoss2.yaml +++ b/workflow/hosts/wcoss2.yaml @@ -16,6 +16,7 @@ PARTITION_BATCH: '' PARTITION_SERVICE: '' RESERVATION: '' CHGRP_RSTPROD: 'YES' +CLUSTERS: '' CHGRP_CMD: 'chgrp rstprod' HPSSARCH: 'NO' HPSS_PROJECT: emc-global diff --git a/workflow/rocoto/tasks.py b/workflow/rocoto/tasks.py index 4f97ef1faa..097d1adef5 100644 --- a/workflow/rocoto/tasks.py +++ b/workflow/rocoto/tasks.py @@ -226,7 +226,7 @@ def get_resource(self, task_name): native = '--export=NONE' if task_config['RESERVATION'] != "": native += '' if task_name in Tasks.SERVICE_TASKS else ' --reservation=' + task_config['RESERVATION'] - if task_config['CLUSTERS'] not in ["", '@CLUSTERS@']: + if task_config.get('CLUSTERS', "") not in ["", '@CLUSTERS@']: native += ' --clusters=' + task_config['CLUSTERS'] queue = task_config['QUEUE_SERVICE'] if task_name in Tasks.SERVICE_TASKS else task_config['QUEUE']