Workloads
Workloads are trainings, workspaces, and inferences that are fully controlled by NVIDIA Run:ai. Workloads can be native, third party integrations, and typical Kubernetes workload types. For more information, see Workloads overview.
Retrieve a list of active workloads with details.
Bearer authentication
Return only deleted resources when true.
The offset of the first item returned in the collection.
100The maximum number of entries to return.
50Sort results in descending or ascending order.
ascPossible values: Sort results by a parameter.
Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contain, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.
["name!=some-workload-name","allocatedGPU>=2","createdAt>=2021-01-01T00:00:00Z"]Filter results by a free text search.
test projectExecuted successfully.
1Unauthorized
Forbidden
unexpected error
unexpected error
GET /api/v1/workloads HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"next": 1,
"workloads": [
{
"tenantId": 1001,
"runningPods": 1,
"phaseUpdatedAt": "2022-06-08T11:28:24.131Z",
"k8sPhaseUpdatedAt": "2022-06-08T11:28:24.131Z",
"updatedAt": "2022-06-08T11:28:24.131Z",
"source": "CLI",
"deletedAt": "2022-08-12T19:28:24.131Z",
"type": "runai-job",
"name": "very-important-job",
"id": "123e4567-e89b-12d3-a456-426614174000",
"priority": 50,
"priorityClassName": "high-priority",
"submittedBy": "researcher@run.ai",
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"projectName": "proj-1",
"projectId": "1",
"departmentName": "department-1",
"departmentId": "1",
"namespace": "runai-proj-1",
"createdAt": "2022-01-01T03:49:52.531Z",
"workloadRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"podsRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"allocatedResources": {
"gpu": 1.5,
"gpuMemory": "200Mi",
"cpu": 0.5,
"cpuMemory": "0B",
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"actionsSupport": {
"delete": true,
"suspend": true
},
"phase": "Creating",
"conditions": [
{
"type": "Ready",
"status": "False",
"message": "Resource validation failed: ...",
"reason": "ErrorConfig",
"lastTransitionTime": "2022-01-01T03:49:52.531Z"
}
],
"phaseMessage": "Not enough resources in the requested nodepool",
"k8sPhase": "Pending",
"requestedPods": {
"number": 1,
"min": 2,
"max": 5,
"parallelism": 3,
"completions": 5
},
"requestedNodePools": [
"default"
],
"currentNodePools": [
"default"
],
"completedAt": "2022-01-01T03:49:52.531Z",
"images": [
"alpine:latest"
],
"urls": [
"text"
],
"datasources": [
{
"type": "pvc",
"name": "my-pvc-datasource-1",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
],
"environments": [
{
"connections": [
{
"name": "my-pytorch-env",
"toolType": "pytorch",
"connectionType": "ExternalUrl",
"url": "http://wandb.com/yourproject",
"authorizationType": "public",
"authorizedUsers": [
"user@company.ai",
"another@company.ai"
],
"authorizedGroups": [
"group-a",
"group-b"
],
"containerPort": 8080
}
],
"name": "pytorch",
"id": "123e4567-e89b-12d3-a456-426614174000",
"replicaType": "Master"
}
],
"externalConnections": [
{
"name": "my-pytorch-env",
"toolType": "pytorch",
"connectionType": "ExternalUrl",
"url": "http://wandb.com/yourproject",
"authorizationType": "public",
"authorizedUsers": [
"user@company.ai",
"another@company.ai"
],
"authorizedGroups": [
"group-a",
"group-b"
],
"containerPort": 8080
}
],
"distributedFramework": "Pytorch",
"additionalFields": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"preemptible": true,
"environmentVariables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"command": "sleep",
"arguments": "1000",
"phaseReason": "text",
"idleAllocatedGpus": 1
}
]
}Retrieve workload data using a workloadId.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
Executed successfully.
The id of the tenant.
100112022-06-08T11:28:24.131Z2022-06-08T11:28:24.131Z2022-06-08T11:28:24.131Z2022-08-12T19:28:24.131Zrunai-jobvery-important-job50high-priorityresearcher@run.aiThe id of the cluster.
71f69d83-ba66-4822-adf5-55ce55efd210proj-11department-11runai-proj-12022-01-01T03:49:52.531ZNot enough resources in the requested nodepoolPendingdefaultdefault2022-01-01T03:49:52.531Zalpine:latestPytorchsleep1000deprecated. use idleAllocatedGpus instead
3sum of idle allocated gpus in the workload
1Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId} HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"tenantId": 1001,
"runningPods": 1,
"phaseUpdatedAt": "2022-06-08T11:28:24.131Z",
"k8sPhaseUpdatedAt": "2022-06-08T11:28:24.131Z",
"updatedAt": "2022-06-08T11:28:24.131Z",
"source": "CLI",
"deletedAt": "2022-08-12T19:28:24.131Z",
"type": "runai-job",
"name": "very-important-job",
"id": "123e4567-e89b-12d3-a456-426614174000",
"priority": 50,
"priorityClassName": "high-priority",
"submittedBy": "researcher@run.ai",
"clusterId": "71f69d83-ba66-4822-adf5-55ce55efd210",
"projectName": "proj-1",
"projectId": "1",
"departmentName": "department-1",
"departmentId": "1",
"namespace": "runai-proj-1",
"createdAt": "2022-01-01T03:49:52.531Z",
"workloadRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"podsRequestedResources": {
"gpuRequestType": "portion",
"gpu": {
"limit": 1.5,
"request": 1
},
"gpuMemory": {
"limit": "2G",
"request": "200M"
},
"cpu": {
"limit": 1.5,
"request": 1
},
"cpuMemory": {
"limit": "2G",
"request": "200M"
},
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"allocatedResources": {
"gpu": 1.5,
"gpuMemory": "200Mi",
"cpu": 0.5,
"cpuMemory": "0B",
"extendedResources": [
{
"resource": "hardware-vendor.example/foo",
"quantity": 2,
"exclude": false
}
]
},
"actionsSupport": {
"delete": true,
"suspend": true
},
"phase": "Creating",
"conditions": [
{
"type": "Ready",
"status": "False",
"message": "Resource validation failed: ...",
"reason": "ErrorConfig",
"lastTransitionTime": "2022-01-01T03:49:52.531Z"
}
],
"phaseMessage": "Not enough resources in the requested nodepool",
"k8sPhase": "Pending",
"requestedPods": {
"number": 1,
"min": 2,
"max": 5,
"parallelism": 3,
"completions": 5
},
"requestedNodePools": [
"default"
],
"currentNodePools": [
"default"
],
"completedAt": "2022-01-01T03:49:52.531Z",
"images": [
"alpine:latest"
],
"urls": [
"text"
],
"datasources": [
{
"type": "pvc",
"name": "my-pvc-datasource-1",
"id": "123e4567-e89b-12d3-a456-426614174000"
}
],
"environments": [
{
"connections": [
{
"name": "my-pytorch-env",
"toolType": "pytorch",
"connectionType": "ExternalUrl",
"url": "http://wandb.com/yourproject",
"authorizationType": "public",
"authorizedUsers": [
"user@company.ai",
"another@company.ai"
],
"authorizedGroups": [
"group-a",
"group-b"
],
"containerPort": 8080
}
],
"name": "pytorch",
"id": "123e4567-e89b-12d3-a456-426614174000",
"replicaType": "Master"
}
],
"externalConnections": [
{
"name": "my-pytorch-env",
"toolType": "pytorch",
"connectionType": "ExternalUrl",
"url": "http://wandb.com/yourproject",
"authorizationType": "public",
"authorizedUsers": [
"user@company.ai",
"another@company.ai"
],
"authorizedGroups": [
"group-a",
"group-b"
],
"containerPort": 8080
}
],
"distributedFramework": "Pytorch",
"additionalFields": {
"ANY_ADDITIONAL_PROPERTY": "anything"
},
"preemptible": true,
"environmentVariables": {
"ANY_ADDITIONAL_PROPERTY": "text"
},
"command": "sleep",
"arguments": "1000",
"phaseReason": "text",
"idleAllocatedGpus": 1,
"pendingSchedulingMessages": [
{
"nodePool": "default",
"phaseReason": "NonPreemptibleOverQuota",
"reason": "Non-preemptible over quota",
"orgType": "text",
"userMessage": "You have reached the limit of non-preemptible resources"
}
]
}Retrieve the number of workloads.
Bearer authentication
Return only deleted resources when true.
Filter results by a parameter. Use the format field-name operator value. Operators are == Equals, != Not equals, <= Less than or equal, >= Greater than or equal, =@ contains, !@ Does not contain, =^ Starts with and =$ Ends with. Dates are in ISO 8601 timestamp format and available for operators ==, !=, <= and >=.
["name!=some-workload-name","allocatedGPU>=2","createdAt>=2021-01-01T00:00:00Z"]Filter results by a free text search.
test projectExecuted successfully.
1Unauthorized
Forbidden
unexpected error
unexpected error
GET /api/v1/workloads/count HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"count": 1
}Retrieves workload data by telemetry type.
Bearer authentication
Filter using the Universally Unique Identifier (UUID) of the cluster.
d73a738f-fab3-430a-8fa3-5241493d7128Filter using the nodepool.
defaultFilter using the department id.
1Select a telemetry type.
Executed successfully.
specifies what data returned
ALLOCATION_RATIO2023-06-06 12:09:18.211Bad request.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/telemetry?telemetryType=WORKLOADS_COUNT HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"type": "ALLOCATION_RATIO",
"timestamp": "2023-06-06 12:09:18.211",
"values": [
{
"value": "85",
"groups": [
{
"key": "department",
"value": "1",
"name": "department-A"
}
]
}
]
}Retrieves workloads data metrics from the metrics database. Use in reporting and analysis tools.
Bearer authentication
The Universally Unique Identifier (UUID) of the workload.
Start date of time range to fetch data in ISO 8601 timestamp format.
2023-06-06T12:09:18.211ZEnd date of time range to fetch data in ISO 8601 timestamp format.
2023-06-07T12:09:18.211ZThe number of samples to take in the specified time range.
20Example: 20Executed successfully.
Partial success.
Bad request.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
unexpected error
GET /api/v1/workloads/{workloadId}/metrics?metricType=GPU_UTILIZATION&start=2023-06-06T12%3A09%3A18.211Z&end=2023-06-07T12%3A09%3A18.211Z HTTP/1.1
Host: app.run.ai
Authorization: Bearer YOUR_SECRET_TOKEN
Accept: */*
{
"measurements": [
{
"type": "ALLOCATED_GPU",
"labels": "{'gpu': '3'}",
"values": [
{
"value": "85",
"timestamp": "2023-06-06 12:09:18.211"
}
]
}
]
}Last updated