From 524c71307b4f44729775da420de3fdfcc6a5e1fa Mon Sep 17 00:00:00 2001 From: "Henry R. Winterbottom" <49202169+HenryWinterbottom-NOAA@users.noreply.github.com> Date: Mon, 26 Jun 2023 10:10:02 -0600 Subject: [PATCH] Add NOAA CSPs to allowable hosts. (#1714) --- workflow/hosts.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/workflow/hosts.py b/workflow/hosts.py index fa1362ef2c..bb0128cb01 100644 --- a/workflow/hosts.py +++ b/workflow/hosts.py @@ -34,6 +34,7 @@ def detect(cls): machine = 'NOTFOUND' container = os.getenv('SINGULARITY_NAME', None) + pw_csp = os.getenv('PW_CSP', None) if os.path.exists('/scratch1/NCEPDEV'): machine = 'HERA' @@ -47,6 +48,11 @@ def detect(cls): machine = 'S4' elif container is not None: machine = 'CONTAINER' + elif pw_csp is not None: + if pw_csp.lower() not in ['azure', 'aws', 'gcp']: + raise ValueError( + f'NOAA cloud service provider "{pw_csp}" is not supported.') + machine = f"{pw_csp.upper()}PW" if machine not in Host.SUPPORTED_HOSTS: raise NotImplementedError(f'This machine is not a supported host.\n' +