Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
chore: add resource pools mock api [DET-4639] (#1662)
Until we have the resource pool APIs we set this up so that the UI 
can get a sample response to unblock the rest of the development.
  • Loading branch information
hamidzr committed Dec 10, 2020
1 parent b1c2930 commit 194af45
Show file tree
Hide file tree
Showing 2 changed files with 185 additions and 0 deletions.
177 changes: 177 additions & 0 deletions webui/react/src/fixtures/responses/cluster/resource-pools.json
@@ -0,0 +1,177 @@
[
{
"name": "perception-cpu-aws",
"description": "AWS CPU-only resource pool for tensorboards",
"type": "aws",
"numAgents": 1,
"slotsAvailable": 0,
"slotsUsed": 0,
"cpuContainerCapacity": 100,
"cpuContainersRunning": 5,
"defaultCpuPool": "true",
"defaultGpuPool": "false",
"spotOrPreemptible": "false",
"minInstances": 0,
"maxInstances": 5,
"gpusPerAgent": 0,
"cpuContainerCapacityPerAgent": 100,
"schedulerType": "fair share",
"schedulerFittingPolicy": "best fit",
"location": "us-east-1",
"imageId": "ami-0e4b739ea71222f80",
"instanceType": "m5.large",
"details": {
"poolName": "perception-cpu-aws",
"description": "AWS CPU-only resource pool for tensorboards",
"maxCpuContainersPerAgent": 100,
"provisionerType": "aws",
"masterUrl": "172.0.0.1:8080",
"masterCertName": "",
"startupScript": "# This can be extremely long",
"containerStartupScript": "# This can be extremely long",
"agentDockerRuntime": "runc",
"agentDockerImage": "determinedai/determined-agent:1.0",
"agentFluentImage": "fluent/fluent1.6.6",
"maxIdleAgentPeriod": "5m",
"maxAgentStartingPeriod": "5m",
"minInstances": 0,
"maxInstances": 5,
"aws": {
"region": "us-east-1",
"rootVolumeSize": 200,
"imageId": "ami-0e4b739ea71222f80",
"tagKey": "someKey",
"tagValue": "someValue",
"instanceName": "determined-ai-agent",
"sshKeyName": "determined-agent-us-east-1",
"publicIp": "true",
"subnetId": "subnet-1234567",
"securityGroupId": "sg-123123123abcd",
"iamInstanceProfileArn": "aen:129u98y1ojkj1vy2fui",
"instanceType": "m5.large",
"logGroup": "/determined/master/xyz",
"logStream": "/determined/master/master",
"spotEnabled": "false",
"spotMaxPrice": "",
"customTags": [
{
"key": "myKey",
"value": "myValue"
}
]
},
"schedulerType": "fair share",
"schedulerFittingPolicy": "best fit"
}
},
{
"name": "v100-gcp",
"description": "GCP resource pool with V100s",
"type": "gcp",
"numAgents": 1,
"slotsAvailable": 8,
"slotsUsed": 4,
"cpuContainerCapacity": 100,
"cpuContainersRunning": 1,
"defaultCpuPool": "true",
"spotOrPreemptible": "true",
"minInstances": 0,
"maxInstances": 2,
"gpusPerAgent": 8,
"cpuContainerCapacityPerAgent": 100,
"location": "us-west1-c",
"imageId": "ubuntu-1604-xenial-v20200611",
"instanceType": "n1-standard-32, 8 nvidia-tesla-v100",
"schedulerType": "priority",
"schedulerFittingPolicy": "best fit",
"details": {
"poolName": "v100-gcp",
"description": "GCP resource pool with V100s",
"maxCpuContainersPerAgent": 100,
"provisionerType": "gcp",
"masterUrl": "172.0.0.1:8080",
"masterCertName": "",
"startupScript": "",
"containerStartupScript": "",
"agentDockerRuntime": "runc",
"agentDockerImage": "determinedai/determined-agent:1.0",
"agentFluentImage": "fluent/fluent1.6.6",
"maxIdleAgentPeriod": "5m",
"maxAgentStartingPeriod": "5m",
"minInstances": 0,
"maxInstances": 2,
"gcp": {
"project": "determined",
"zone": "us-west1-c",
"bootDiskSize": 200,
"bootDiskSourceImage": "kajhsdjaksdkjaskjda",
"labelKey": "key",
"labelValue": "value",
"namePrefix": "determined-ai-agent-",
"network": "default",
"subnetwork": "",
"externalIp": "true",
"networkTags": [
"tag1",
"tag2"
],
"serviceAccountEmail": "service@something.something",
"serviceAccountScopes": [
"something",
"something"
],
"machineType": "n1-standard-32",
"gpuType": "nvidia-v100",
"gpuNum": 8,
"preemptible": "true",
"operationTimeoutPeriod": "5m"
},
"schedulerType": "priority",
"schedulerFittingPolicy": "best fit",
"priorityScheduler": {
"preemption": "true",
"defaultPriority": 42
}
}
},
{
"name": "on-prem-1",
"description": "On prem cluster with K80s. Use for prototyping",
"type": "static",
"numAgents": 3,
"slotsAvailable": 12,
"slotsUsed": 2,
"cpuContainerCapacity": 300,
"cpuContainersRunning": 0,
"defaultCpuPool": "false",
"spotOrPreemptible": "false",
"minInstances": "N/A",
"maxInstances": "N/A",
"gpusPerAgent": 4,
"cpuContainerCapacityPerAgent": 100,
"schedulerType": "fair share",
"schedulerFittingPolicy": "worst fit",
"location": "N/A",
"imageId": "N/A",
"instanceType": "N/A",
"details": {
"poolName": "on-prem-1",
"description": "On prem cluster with K80s. Use for prototyping",
"maxCpuContainersPerAgent": 100,
"provisionerType": "static",
"masterUrl": "master.determined.ai:8080",
"masterCertName": "",
"startupScript": "",
"containerStartupScript": "",
"agentDockerRuntime": "runc",
"agentDockerImage": "determinedai/determined-agent:1.0",
"agentFluentImage": "fluent/fluent1.6.6",
"maxIdleAgentPeriod": "5m",
"maxAgentStartingPeriod": "5m",
"minInstances": "N/A",
"maxInstances": "N/A",
"schedulerType": "fair share",
"schedulerFittingPolicy": "worst fit"
}
}
]
8 changes: 8 additions & 0 deletions webui/react/src/services/api.ts
@@ -1,3 +1,4 @@
import resourcePools from 'fixtures/responses/cluster/resource-pools.json';
import * as Api from 'services/api-ts-sdk';
import * as Config from 'services/apiConfig';
import {
Expand Down Expand Up @@ -51,6 +52,13 @@ export const getInfo = generateApi<EmptyParams, DeterminedInfo>(Config.getInfo);
export const getAgents =
generateDetApi<EmptyParams, Api.V1GetAgentsResponse, Agent[]>(Config.getAgents);

// Placeholder for getResourcePools API.
/* eslint-disable */
export const getResourcePools = async () => {
return resourcePools;
};
/* eslint-enable */

/* Experiments */

export const getExperiments =
Expand Down

0 comments on commit 194af45

Please sign in to comment.