GPR Templates
This topic describes the REST APIs to manage GPR Templates.
Create a GPR Template
Use this API to create a GPR Template.
Method and URL
POST /api/v1/gpr-template
Parameters
Parameter | Parameter Type | Description | Required |
---|---|---|---|
name | String | The name for the GPR template. | Mandatory |
clusterName | String | The name of the cluster this template is being created for. | Mandatory |
numberOfGPUs | Integer | The number of GPUs that needs to be provisioned. | Mandatory |
instanceType | String (as available on the inventory list) | GPU node instance type that you can get from the Inventory list details. | Mandatory |
numberOfGPUNodes | Integer | Number of GPU Nodes that you want to request. | Mandatory |
priority | String | Priority 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 |
memoryPerGPU | Integer | The memory per GPU is specified using this parameter. The default value is set if you do not pass this parameter. | Mandatory |
gpuShape | String (as available on the inventory list) | Name of the GPU type that you can get from the List Inventory details. | Mandatory |
exitDuration | Timestamp | The duration for which you want the GPU allocation in the timestamp format, DDHHMM. | Mandatory |
idleTimeOutDuration | Timestamp | The duration for which a GPU node can be considered idle before it can be used by another GPR. | Optional |
enforceIdleTimeOut | Boolean | If 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 |
enableEviction | Boolean | Enable this option to enable auto-eviction of the low priority GPR. | Optional |
requeueOnFailure | Boolean | Enable this option to requeue GPR in case it fails. | Optional |
Example Request
curl -X POST --location --globoff --request
'{
"name":"final-tes1",
"clusterName":"worker-1",
"numberOfGPUs":1,
"instanceType":"n1-highcpu-2",
"exitDuration":"0d0h1m",
"numberOfGPUNodes": 1,
"priority":201,
"memoryPerGPU":15,
"gpuShape":"Tesla-T4",
"enableEviction": true,
"requeueOnFailure": true,
"idleTimeOutDuration": "0d0h1m",
"enforceIdleTimeOut":true
}'
Example Responses
Successful Response
{
"statusCode": 200,
"status": "OK",
"message": "Success",
"data": {
"gprTemplateName": "api-test1"
}
}
Bad Request
{
"statusCode": 409,
"status": "UPSTREAM_REQUEST_ERROR",
"message": "Error while creating a GPR Template",
"data": null,
"error": {
"errorKey": "UPSTREAM_REQUEST_ERROR",
"message": "Error while creating a GPR Template",
"data": "Error: gprtemplates.gpr.kubeslice.io \"api-test1\" already exists; Reason: AlreadyExists"
}
}