Enforce GRES resources as lowercase for specific clusters

This commit is contained in:
Benoît Seignovert 2024-03-07 15:21:37 +01:00
parent a723a2376e
commit ae9ac12918
Signed by: Benoît Seignovert
GPG key ID: F5D8895227D18A0B
2 changed files with 12 additions and 3 deletions

View file

@ -11,6 +11,10 @@ TEMPLATES = Environment(
autoescape=select_autoescape(),
)
GRES_CLUSTERS_LOWERCASE = [
'waves',
]
def options_attrs(username: str) -> dict:
"""Form options attributes."""
@ -62,7 +66,10 @@ def options_from_form(formdata) -> dict:
}
if gpu != 'None':
options['gres'] = f'gpu:{gpu.lower()}'
if cluster in GRES_CLUSTERS_LOWERCASE:
gpu = gpu.lower()
options['gres'] = f'gpu:{gpu}'
if cluster:
options['cluster'] = cluster