Skip to content

Commit

Permalink
Merge pull request #123 from nerc-project/openshift-gpu-quotas
Browse files Browse the repository at this point in the history
add OpenShift GPU quota support
  • Loading branch information
jtriley authored Nov 27, 2023
2 parents 6a266f1 + 84e4ef7 commit 3ac55af
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/coldfront_plugin_cloud/attributes.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@
QUOTA_LIMITS_MEMORY = 'OpenShift Limit on RAM Quota (MB)'
QUOTA_LIMITS_EPHEMERAL_STORAGE_GB = 'OpenShift Limit on Ephemeral Storage Quota (GB)'
QUOTA_REQUESTS_STORAGE = 'OpenShift Request on Storage Quota (GB)'
QUOTA_REQUESTS_GPU = 'OpenShift Request on GPU Quota'
QUOTA_PVC = 'OpenShift Persistent Volume Claims Quota'


Expand All @@ -63,4 +64,5 @@
QUOTA_LIMITS_MEMORY,
QUOTA_LIMITS_EPHEMERAL_STORAGE_GB,
QUOTA_REQUESTS_STORAGE,
QUOTA_REQUESTS_GPU,
QUOTA_PVC]
1 change: 1 addition & 0 deletions src/coldfront_plugin_cloud/openshift.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
attributes.QUOTA_LIMITS_MEMORY: lambda x: {":limits.memory": f"{x}Mi"},
attributes.QUOTA_LIMITS_EPHEMERAL_STORAGE_GB: lambda x: {":limits.ephemeral-storage": f"{x}Gi"},
attributes.QUOTA_REQUESTS_STORAGE: lambda x: {":requests.storage": f"{x}Gi"},
attributes.QUOTA_REQUESTS_GPU: lambda x: {":requests.nvidia.com/gpu": f"{x}"},
attributes.QUOTA_PVC: lambda x: {":persistentvolumeclaims": f"{x}"},
}

Expand Down
5 changes: 4 additions & 1 deletion src/coldfront_plugin_cloud/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
attributes.QUOTA_LIMITS_MEMORY: 4096,
attributes.QUOTA_LIMITS_EPHEMERAL_STORAGE_GB: 5,
attributes.QUOTA_REQUESTS_STORAGE: 20,
attributes.QUOTA_REQUESTS_GPU: 1,
attributes.QUOTA_PVC: 2
}
}
Expand All @@ -45,7 +46,9 @@
attributes.QUOTA_FLOATING_IPS: 2,
attributes.QUOTA_GPU: 0,
},
'openshift': dict()
'openshift': {
attributes.QUOTA_REQUESTS_GPU: 0,
}
}


Expand Down

0 comments on commit 3ac55af

Please sign in to comment.