Skip to main content
Version: 1.10.0

GPR

A GPR is a GPU allocation request to the EGS to provision GPUs to workspace for a requested duration. This topic describes the APIs to create and manage GPRs.

Create a GPR

Use this API to create a GPR.

Method and URL

POST /api/v1/gpr

Parameters

ParameterParameter TypeDescriptionRequired
gprNameStringThe name for the GPU provision request.Mandatory
clusterNameStringThe name of the cluster to which the GPU provision request is being created.Mandatory
instanceTypeString (as available on the inventory list)GPU node instance type that you can get from the Inventory list details.Mandatory
numberOfGPUNodesIntegerNumber of GPU Nodes that you want to request.Mandatory
priorityStringPriority of the request. You can change the priority of a GPR in the queue. You can select a GPR and increase the priority number (low: 1-100, medium: 101-200, high: 201-300) to move a GPR higher in the queue.Mandatory
memoryPerGPUIntegerThe memory per GPU is specified using this parameter. The default value is set if you do not pass this parameter.Optional
gpuShapeString (as available on the inventory list)Name of the GPU type that you can get from the List Inventory details.Mandatory
exitDurationTimestampThe duration for which you want the GPU allocation in the timestamp format, DDHHMM.Mandatory
idleTimeOutDurationTimestampThe duration for which a GPU node can be considered idle before it can be used by another GPR.Optional
enforceIdleTimeOutBooleanIf you set the idleTimeOutDuration, then the value of this parameter is enabled by default. Set the value to false if you do not want it enforce the idle time out.Optional

Example Request

curl -X POST --location --globoff '{{host}}/api/v1/gpr' \
--data '{
"gprName":"gr1",
"sliceName":"workspaceName",
"clusterName":"worker-1",
"numberOfGPUs":1,
"instanceType":"n1-standard-8",
"exitDuration":"0d0h5m",
"numberOfGPUNodes": 1,
"priority":201,
"memoryPerGPU":15,
"gpuShape":"Tesla-T4",
"idleTimeOutDuration":"0d0h1m",
"enforceIdleTimeOut":true
}'

Example Responses

Response: Success

{
"statusCode": 200,
"status": "OK",
"message": "Success",
"data": {
"gprId": "gpr-1bb22a0b-9388"
}
}

Response: Bad Request

{
"statusCode": 422,
"status": "Error",
"message": "Bad Request",
"data": null,
"error": {
"errorKey": "",
"message": "",
"data": "{\"error\":{\"Message\":\"Error while fetching GPR wait time\",\"Status\":422,\"DetailedError\":{\"Errormessage\":\"\\\"exitDuration\\\" is not allowed to be empty\",\"Reason\":\"\",\"Details\":\"\"},\"StatusCode\":422,\"ReferenceDocumentation\":\"NA\"}}"
}
}

Edit a GPR

Use this API to update a queued-GPR details or early release a provisioned GPR.

note

If the GPR is already provisioned (GPUs allocated to the workspace), then use the GPR edit API call with the Early Release option to release GPUs, and delete the GPR. If GPR is still in the queued state, then use delete GPR API to delete it.

Method and URL

PUT /api/v1/gpr

Parameters

ParameterParameter TypeDescriptionRequired
earlyReleaseBooleanThe value can be set to true if you want to early release a GPR. The default value is false.Optional
gprIDStringThe ID of the GPR that you want to edit.Mandatory
gprNameStringThe name of the GPR that you want to edit.Mandatory
priorityStringThe priority of the GPR that you want to edit.Optional

Example Request

curl -X PUT --location --globoff --request PUT '{{host}}/api/v1/gpr' \
--data '{
"gprId":"gprId",
"priority": 101
}'

Example Responses

Response: Success

{
"statusCode": 200,
"status": "OK",
"message": "Success",
"data": {}
}

Response: Early Release a GPR Inability

{
"statusCode": 500,
"status": "Error",
"message": "Unable to Early Release",
"data": null,
"error": {
"errorKey": "",
"message": "Unable to Early Release",
"data": "{\"error\":{\"Message\":\"Error while updating a GPR\",\"Status\":500,\"DetailedError\":{\"Errormessage\":\"Cannot update early release of GPR in Queued state\",\"Reason\":\"\",\"Details\":\"\"},\"StatusCode\":500,\"ReferenceDocumentation\":\"NA\"}}"
}
}

View a GPR

Use this API to view a GPR by its ID.

Method and URL

GET /api/v1/gpr/gpr?gprId=<GPR Id>

Parameters

ParameterParameter TypeDescriptionRequired
gprIdStringThe ID of the GPR whose details you want to get.Mandatory

Example Request

curl -X GET  --location --globoff '{{host}}/api/v1/gpr/gpr?gprId=gpr-b900c98b-27a6'

Example Responses

Response: Success

{
"statusCode": 200,
"status": "OK",
"message": "Success",
"data": {
"gprId": "gpr-b900c98b-27a6",
"sliceName": "pink",
"clusterName": "worker-1",
"numberOfGPUs": 1,
"numberOfGPUNodes": 1,
"instanceType": "n1-highcpu-2",
"memoryPerGPU": 15,
"priority": 201,
"gpuSharingMode": "Virtual Machine",
"estimatedStartTime": "2024-12-24T08:13:08Z",
"estimatedWaitTime": "0h0m0s",
"exitDuration": "0h1m0s",
"earlyRelease": false,
"gprName": "created-by-coreapi",
"gpuShape": "Tesla-T4",
"multiNode": false,
"dedicatedNodes": false,
"enableRDMA": false,
"enableSecondaryNetwork": false,
"status": {
"provisioningStatus": "Queued",
"failureReason": "",
"numGpusAllocated": 0,
"startTimestamp": "",
"completionTimestamp": "",
"cost": "",
"nodes": null,
"internalState": "",
"retryCount": 0,
"delayedCount": 0
},
"enforceIdleTimeOut": true,
"idleTimeOutDuration": "0h1m0s"
}
}

Response: Not Found

{
"statusCode": 404,
"status": "UNKNOWN",
"message": "UNKNOWN",
"data": null,
"error": {
"errorKey": "UNKNOWN",
"message": "UNKNOWN",
"data": "{\"error\":{\"Message\":\"Error while fetching GPRs\",\"Status\":404,\"DetailedError\":{\"Errormessage\":\"gpuprovisioningrequests.gpr.kubeslice.io \\\"gpr-1bb22a0b-9388-x\\\" not found\",\"Reason\":\"NotFound\",\"Details\":\"\"},\"StatusCode\":404,\"ReferenceDocumentation\":\"NA\"}}"
}
}

List GPRs by a Slice Workspace

Use this API to list GPRs associated with a slice workspace. The response includes GPR status and other details for each GPR associated with the slice workspace.

Method and URL

GET /api/v1/gpr/list?sliceName=<workspace>

Parameters

ParameterParameter TypeDescriptionRequired
workspaceStringName of the slice whose GPRs you want to list.Mandatory

Example Request

curl -X GET  --location --globoff '{{host}}/api/v1/gpr/list?sliceName=workspace1'

Example Responses

Response: Success

{
"statusCode": 200,
"status": "OK",
"message": "Success",
"data": {
"items": [
{
"gprId": "gpr-1bb22a0b-9388",
"sliceName": "workspace1",
"clusterName": "worker-1",
"numberOfGPUs": 1,
"numberOfGPUNodes": 1,
"instanceType": "n1-standard-8",
"memoryPerGPU": 15,
"priority": 201,
"gpuSharingMode": "Virtual Machine",
"estimatedStartTime": "2024-10-22T11:12:38Z",
"estimatedWaitTime": "0h0m0s",
"exitDuration": "1h15m0s",
"earlyRelease": true,
"gprName": "gpr1",
"gpuShape": "Tesla-T4",
"multiNode": false,
"dedicatedNodes": false,
"enableRDMA": false,
"enableSecondaryNetwork": false,
"status": {
"provisioningStatus": "Queued",
"failureReason": "",
"numGpusAllocated": 0,
"startTimestamp": "",
"completionTimestamp": "",
"cost": "",
"nodes": ["gke-dev-2-gke-cluste-dev-2-gke-cluste-9d71107a-hs19"],
"internalState": "Queued",
"retryCount": 0,
"delayedCount": 0
},
"enforceIdleTimeOut": true,
"idleTimeOutDuration": "0h1m0s"
},
{
"gprId": "gpr-5d278fd3-e868",
"sliceName": "workspace1",
"clusterName": "worker-1",
"numberOfGPUs": 1,
"numberOfGPUNodes": 1,
"instanceType": "n1-standard-8",
"memoryPerGPU": 15,
"priority": 101,
"gpuSharingMode": "Virtual Machine",
"estimatedStartTime": "2024-10-22T06:30:39Z",
"estimatedWaitTime": "0h0m0s",
"exitDuration": "0h10m0s",
"earlyRelease": false,
"gprName": "rag-gpr-1",
"gpuShape": "Tesla-T4",
"multiNode": false,
"dedicatedNodes": false,
"enableRDMA": false,
"enableSecondaryNetwork": false,
"status": {
"provisioningStatus": "Complete",
"failureReason": "",
"numGpusAllocated": 0,
"startTimestamp": "",
"completionTimestamp": "2024-10-22T06:41:17Z",
"cost": "",
"nodes": ["gke-dev-2-gke-cluste-dev-2-gke-cluste-9d71107a-hs19"],
"internalState": "Released",
"retryCount": 0,
"delayedCount": 0
},
"enforceIdleTimeOut": true,
"idleTimeOutDuration": "0h1m0s"
}
]
}
}

Response: Not Found

{
"statusCode": 404,
"status": "Error",
"message": "Slice Workspace Not Found",
"data": null,
"error": {
"errorKey": "",
"message": "Slice Workspace Not Found",
"data": "{\"error\":{\"Message\":\"Error in listing GPR's for slice evening-x\",\"Status\":404,\"DetailedError\":{\"Errormessage\":\"sliceconfigs.controller.kubeslice.io \\\"evening-x\\\" not found\",\"Reason\":\"NotFound\",\"Details\":\"\"},\"StatusCode\":404,\"ReferenceDocumentation\":\"NA\"}}"
}
}

Delete a GPR

Use this API to delete a queued GPR. You cannot delete provisioned GPR using this API call.

note

If the GPR is already provisioned, then use GPR edit API call with the Early Release option to release the GPUs, and delete the GPR.

Method and URL

DELETE /api/v1/gpr

Parameters

ParameterParameter TypeDescriptionRequired
gprIdStringThe ID of the queued GPR that you want to delete.Mandatory

Example Request

curl -X DELETE --location --globoff '{{host}}/api/v1/slice-workspace/kube-config' \
--data '{ "gprId": "gpr-e4e38fc5-4742"}'

Example Responses

Response Success

{
"statusCode": 200,
"status": "OK",
"message": "Success",
"data": {}
}

Response: Cannot delete

{
"statusCode": 500,
"status": "Error",
"message": "Cannot delete",
"data": null,
"error": {
"errorKey": "",
"message": "UNKNOWN",
"data": "{\"error\":{\"Message\":\"Error while deleting GPR\",\"Status\":500,\"DetailedError\":{\"Errormessage\":\"Cannot delete GPR in Successful state\",\"Reason\":\"\",\"Details\":\"\"},\"StatusCode\":500,\"ReferenceDocumentation\":\"NA\"}}"
}
}