Skip to content

Commit

Permalink
add OpenShift GPU quota support
Browse files Browse the repository at this point in the history
  • Loading branch information
jtriley committed Nov 9, 2023
1 parent 16f0d9d commit f7db726
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 @@ -47,6 +47,7 @@
QUOTA_LIMITS_CPU = 'OpenShift Limit on CPU Quota'
QUOTA_LIMITS_MEMORY = 'OpenShift Limit on RAM Quota (MB)'
QUOTA_LIMITS_EPHEMERAL_STORAGE_GB = 'OpenShift Limit on Ephemeral Storage Quota (GB)'
QUOTA_LIMITS_GPU = 'OpenShift Limit on GPU Quota'
QUOTA_REQUESTS_STORAGE = 'OpenShift Request on Storage Quota (GB)'
QUOTA_PVC = 'OpenShift Persistent Volume Claims Quota'

Expand All @@ -62,5 +63,6 @@
QUOTA_LIMITS_CPU,
QUOTA_LIMITS_MEMORY,
QUOTA_LIMITS_EPHEMERAL_STORAGE_GB,
QUOTA_LIMITS_GPU,
QUOTA_REQUESTS_STORAGE,
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 @@ -13,6 +13,7 @@
attributes.QUOTA_LIMITS_CPU: lambda x: {":limits.cpu": f"{x * 1000}m"},
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_LIMITS_GPU: lambda x: {":requests.nvidia.com/gpu": f"{x}"},
attributes.QUOTA_REQUESTS_STORAGE: lambda x: {":requests.storage": f"{x}Gi"},
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 @@ -32,6 +32,7 @@
attributes.QUOTA_LIMITS_CPU: 1,
attributes.QUOTA_LIMITS_MEMORY: 4096,
attributes.QUOTA_LIMITS_EPHEMERAL_STORAGE_GB: 5,
attributes.QUOTA_LIMITS_GPU: 1,
attributes.QUOTA_REQUESTS_STORAGE: 20,
attributes.QUOTA_PVC: 2
}
Expand All @@ -45,7 +46,9 @@
attributes.QUOTA_FLOATING_IPS: 2,
attributes.QUOTA_GPU: 0,
},
'openshift': dict()
'openshift': {
attributes.QUOTA_LIMITS_GPU: 0,
}
}


Expand Down

0 comments on commit f7db726

Please sign in to comment.