An environment resource designates the container image, the image pull policy, working directory, security parameters, and others. It exposes all the necessary tools (open source, 3rd party, or custom tools) along with their connection interfaces including external node port and the container ports. You can also specify a standard, distributed, or inference workload architecture for the environment. An environment is a mandatory building block for the creation of a workload. For more information, see Environments.
Use to retrieve a list of environment assets.
Request completed successfully.
Unauthorized
Forbidden
unexpected error
{- "entries": [
- {
- "meta": {
- "name": "my-asset",
- "scope": "tenant",
- "id": "a418ed33-9399-48c0-a890-122cadd13bfd",
- "kind": "s3",
- "createdBy": "test@run.ai",
- "createdAt": "2023-02-23T14:25:36.707685Z",
- "updatedBy": "test@run.ai",
- "updatedAt": "2023-02-23T14:25:36.707685Z",
- "workloadSupportedTypes": {
- "workspace": false,
- "training": false,
- "distributed": true,
- "distFramework": "TF"
}
}, - "spec": {
- "command": "python",
- "args": "-x my-script.py",
- "runAsUid": 500,
- "runAsGid": 30,
- "supplementalGroups": "2,3,5,8",
- "environmentVariables": [
- {
- "name": "HOME",
- "value": "/home/my-folder",
- "secret": {
- "name": "postgress_secret",
- "key": "POSTGRES_PASSWORD"
}, - "exclude": false
}
], - "image": "python:3.8",
- "imagePullPolicy": "Always",
- "workingDir": "/home/myfolder",
- "createHomeDir": true,
- "probes": {
- "readiness": {
- "initialDelaySeconds": 0,
- "periodSeconds": 1,
- "timeoutSeconds": 1,
- "successThreshold": 1,
- "failureThreshold": 1,
- "handler": {
- "httpGet": {
- "path": null,
- "port": null,
- "host": null,
- "scheme": null
}
}
}
}, - "uidGidSource": "fromTheImage",
- "capabilities": [
- "CHOWN",
- "KILL"
], - "seccompProfileType": "RuntimeDefault",
- "runAsNonRoot": true,
- "readOnlyRootFilesystem": false,
- "tty": true,
- "stdin": true,
- "allowPrivilegeEscalation": false,
- "hostIpc": false,
- "hostNetwork": false,
- "connections": [
- {
- "name": "string",
- "isExternal": false,
- "internalToolInfo": {
- "toolType": "jupyter-notebook",
- "connectionType": "LoadBalancer",
- "containerPort": 1,
- "nodePortInfo": {
- "isCustomPort": null
}, - "externalUrlInfo": {
- "isCustomUrl": null,
- "externalUrl": null
}, - "servingPortInfo": {
- "protocol": null
}
},
}
], - "overrideUidGidInWorkspace": false
}, - "usedBy": {
- "workspaces": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "trainings": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "distributed": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "inferences": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "templates": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "assets": {
- "environment": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset",
- "toolTypes": [
- "jupyter-notebook"
]
}, - "environments": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "compute": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}, - "computes": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "datasources": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset",
- "kind": "compute",
- "overrides": {
- "containerPath": null
}
}
]
}
}, - "usageTimes": {
- "lastUsedByWorkload": "2019-08-24T14:15:22Z"
}, - "compliance": {
- "imposed": true,
- "compliance": true,
- "reason": [
- {
- "field": "string",
- "details": "string"
}
]
}, - "status": {
- "status": "Issues found",
- "issues": [
- {
- "scopeId": "string",
- "scopeType": "system",
- "issue": "ReplicationError"
}
], - "message": "string",
- "url": "string"
}
}
]
}
Use to create an environment asset.
required | object (AssetCreationRequest) |
required | object or null (EnvironmentAssetSpec) Container overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request. |
Request accepted successfully.
Bad request.
Unauthorized
Forbidden
The specified resource already exists
unexpected error
{- "meta": {
- "name": "my-asset",
- "scope": "tenant",
- "workloadSupportedTypes": {
- "workspace": false,
- "training": false,
- "inference": false,
- "distributed": true,
- "distFramework": "TF"
}
}, - "spec": {
- "command": "python",
- "args": "-x my-script.py",
- "runAsUid": 500,
- "runAsGid": 30,
- "supplementalGroups": "2,3,5,8",
- "environmentVariables": [
- {
- "name": "HOME",
- "value": "/home/my-folder",
- "secret": {
- "name": "postgress_secret",
- "key": "POSTGRES_PASSWORD"
}, - "exclude": false
}
], - "image": "python:3.8",
- "imagePullPolicy": "Always",
- "workingDir": "/home/myfolder",
- "createHomeDir": true,
- "probes": {
- "readiness": {
- "initialDelaySeconds": 0,
- "periodSeconds": 1,
- "timeoutSeconds": 1,
- "successThreshold": 1,
- "failureThreshold": 1,
- "handler": {
- "httpGet": {
- "path": "/",
- "port": 1,
- "host": "example.com",
- "scheme": "HTTP"
}
}
}
}, - "uidGidSource": "fromTheImage",
- "capabilities": [
- "CHOWN",
- "KILL"
], - "seccompProfileType": "RuntimeDefault",
- "runAsNonRoot": true,
- "readOnlyRootFilesystem": false,
- "tty": true,
- "stdin": true,
- "allowPrivilegeEscalation": false,
- "hostIpc": false,
- "hostNetwork": false,
- "connections": [
- {
- "name": "string",
- "isExternal": false,
- "internalToolInfo": {
- "toolType": "jupyter-notebook",
- "connectionType": "LoadBalancer",
- "containerPort": 1,
- "nodePortInfo": {
- "isCustomPort": false
}, - "externalUrlInfo": {
- "isCustomUrl": false,
- "externalUrl": "string"
}, - "servingPortInfo": {
- "protocol": "grpc"
}
},
}
], - "overrideUidGidInWorkspace": false
}
}
{- "meta": {
- "name": "my-asset",
- "scope": "tenant",
- "id": "a418ed33-9399-48c0-a890-122cadd13bfd",
- "kind": "s3",
- "createdBy": "test@run.ai",
- "createdAt": "2023-02-23T14:25:36.707685Z",
- "updatedBy": "test@run.ai",
- "updatedAt": "2023-02-23T14:25:36.707685Z",
- "workloadSupportedTypes": {
- "workspace": false,
- "training": false,
- "distributed": true,
- "distFramework": "TF"
}
}, - "spec": {
- "command": "python",
- "args": "-x my-script.py",
- "runAsUid": 500,
- "runAsGid": 30,
- "supplementalGroups": "2,3,5,8",
- "environmentVariables": [
- {
- "name": "HOME",
- "value": "/home/my-folder",
- "secret": {
- "name": "postgress_secret",
- "key": "POSTGRES_PASSWORD"
}, - "exclude": false
}
], - "image": "python:3.8",
- "imagePullPolicy": "Always",
- "workingDir": "/home/myfolder",
- "createHomeDir": true,
- "probes": {
- "readiness": {
- "initialDelaySeconds": 0,
- "periodSeconds": 1,
- "timeoutSeconds": 1,
- "successThreshold": 1,
- "failureThreshold": 1,
- "handler": {
- "httpGet": {
- "path": "/",
- "port": 1,
- "host": "example.com",
- "scheme": "HTTP"
}
}
}
}, - "uidGidSource": "fromTheImage",
- "capabilities": [
- "CHOWN",
- "KILL"
], - "seccompProfileType": "RuntimeDefault",
- "runAsNonRoot": true,
- "readOnlyRootFilesystem": false,
- "tty": true,
- "stdin": true,
- "allowPrivilegeEscalation": false,
- "hostIpc": false,
- "hostNetwork": false,
- "connections": [
- {
- "name": "string",
- "isExternal": false,
- "internalToolInfo": {
- "toolType": "jupyter-notebook",
- "connectionType": "LoadBalancer",
- "containerPort": 1,
- "nodePortInfo": {
- "isCustomPort": false
}, - "externalUrlInfo": {
- "isCustomUrl": false,
- "externalUrl": "string"
}, - "servingPortInfo": {
- "protocol": "grpc"
}
},
}
], - "overrideUidGidInWorkspace": false
}, - "usedBy": {
- "workspaces": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "trainings": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "distributed": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "inferences": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "templates": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "assets": {
- "environment": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset",
- "toolTypes": [
- "jupyter-notebook"
]
}, - "environments": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "compute": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}, - "computes": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "datasources": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset",
- "kind": "compute",
- "overrides": {
- "containerPath": "/container/directory"
}
}
]
}
}, - "usageTimes": {
- "lastUsedByWorkload": "2019-08-24T14:15:22Z"
}, - "compliance": {
- "imposed": true,
- "compliance": true,
- "reason": [
- {
- "field": "string",
- "details": "string"
}
]
}, - "status": {
- "status": "Issues found",
- "issues": [
- {
- "scopeId": "string",
- "scopeType": "system",
- "issue": "ReplicationError"
}
], - "message": "string",
- "url": "string"
}
}
Use to retrieve the details of environment asset by id.
Request completed successfully.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
{- "meta": {
- "name": "my-asset",
- "scope": "tenant",
- "id": "a418ed33-9399-48c0-a890-122cadd13bfd",
- "kind": "s3",
- "createdBy": "test@run.ai",
- "createdAt": "2023-02-23T14:25:36.707685Z",
- "updatedBy": "test@run.ai",
- "updatedAt": "2023-02-23T14:25:36.707685Z",
- "workloadSupportedTypes": {
- "workspace": false,
- "training": false,
- "distributed": true,
- "distFramework": "TF"
}
}, - "spec": {
- "command": "python",
- "args": "-x my-script.py",
- "runAsUid": 500,
- "runAsGid": 30,
- "supplementalGroups": "2,3,5,8",
- "environmentVariables": [
- {
- "name": "HOME",
- "value": "/home/my-folder",
- "secret": {
- "name": "postgress_secret",
- "key": "POSTGRES_PASSWORD"
}, - "exclude": false
}
], - "image": "python:3.8",
- "imagePullPolicy": "Always",
- "workingDir": "/home/myfolder",
- "createHomeDir": true,
- "probes": {
- "readiness": {
- "initialDelaySeconds": 0,
- "periodSeconds": 1,
- "timeoutSeconds": 1,
- "successThreshold": 1,
- "failureThreshold": 1,
- "handler": {
- "httpGet": {
- "path": "/",
- "port": 1,
- "host": "example.com",
- "scheme": "HTTP"
}
}
}
}, - "uidGidSource": "fromTheImage",
- "capabilities": [
- "CHOWN",
- "KILL"
], - "seccompProfileType": "RuntimeDefault",
- "runAsNonRoot": true,
- "readOnlyRootFilesystem": false,
- "tty": true,
- "stdin": true,
- "allowPrivilegeEscalation": false,
- "hostIpc": false,
- "hostNetwork": false,
- "connections": [
- {
- "name": "string",
- "isExternal": false,
- "internalToolInfo": {
- "toolType": "jupyter-notebook",
- "connectionType": "LoadBalancer",
- "containerPort": 1,
- "nodePortInfo": {
- "isCustomPort": false
}, - "externalUrlInfo": {
- "isCustomUrl": false,
- "externalUrl": "string"
}, - "servingPortInfo": {
- "protocol": "grpc"
}
},
}
], - "overrideUidGidInWorkspace": false
}, - "usedBy": {
- "workspaces": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "trainings": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "distributed": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "inferences": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "templates": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "assets": {
- "environment": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset",
- "toolTypes": [
- "jupyter-notebook"
]
}, - "environments": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "compute": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}, - "computes": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "datasources": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset",
- "kind": "compute",
- "overrides": {
- "containerPath": "/container/directory"
}
}
]
}
}, - "usageTimes": {
- "lastUsedByWorkload": "2019-08-24T14:15:22Z"
}, - "compliance": {
- "imposed": true,
- "compliance": true,
- "reason": [
- {
- "field": "string",
- "details": "string"
}
]
}, - "status": {
- "status": "Issues found",
- "issues": [
- {
- "scopeId": "string",
- "scopeType": "system",
- "issue": "ReplicationError"
}
], - "message": "string",
- "url": "string"
}
}
Use to update the details of environment asset by id.
required | object (AssetUpdateRequest) |
required | object or null (EnvironmentAssetSpec) Container overrideable fields. In the context of assets,these are environment asset fields that can be overriden in the submit workload request. |
Request accepted successfully.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
{- "meta": {
- "name": "my-asset"
}, - "spec": {
- "command": "python",
- "args": "-x my-script.py",
- "runAsUid": 500,
- "runAsGid": 30,
- "supplementalGroups": "2,3,5,8",
- "environmentVariables": [
- {
- "name": "HOME",
- "value": "/home/my-folder",
- "secret": {
- "name": "postgress_secret",
- "key": "POSTGRES_PASSWORD"
}, - "exclude": false
}
], - "image": "python:3.8",
- "imagePullPolicy": "Always",
- "workingDir": "/home/myfolder",
- "createHomeDir": true,
- "probes": {
- "readiness": {
- "initialDelaySeconds": 0,
- "periodSeconds": 1,
- "timeoutSeconds": 1,
- "successThreshold": 1,
- "failureThreshold": 1,
- "handler": {
- "httpGet": {
- "path": "/",
- "port": 1,
- "host": "example.com",
- "scheme": "HTTP"
}
}
}
}, - "uidGidSource": "fromTheImage",
- "capabilities": [
- "CHOWN",
- "KILL"
], - "seccompProfileType": "RuntimeDefault",
- "runAsNonRoot": true,
- "readOnlyRootFilesystem": false,
- "tty": true,
- "stdin": true,
- "allowPrivilegeEscalation": false,
- "hostIpc": false,
- "hostNetwork": false,
- "connections": [
- {
- "name": "string",
- "isExternal": false,
- "internalToolInfo": {
- "toolType": "jupyter-notebook",
- "connectionType": "LoadBalancer",
- "containerPort": 1,
- "nodePortInfo": {
- "isCustomPort": false
}, - "externalUrlInfo": {
- "isCustomUrl": false,
- "externalUrl": "string"
}, - "servingPortInfo": {
- "protocol": "grpc"
}
},
}
], - "overrideUidGidInWorkspace": false
}
}
{- "meta": {
- "name": "my-asset",
- "scope": "tenant",
- "id": "a418ed33-9399-48c0-a890-122cadd13bfd",
- "kind": "s3",
- "createdBy": "test@run.ai",
- "createdAt": "2023-02-23T14:25:36.707685Z",
- "updatedBy": "test@run.ai",
- "updatedAt": "2023-02-23T14:25:36.707685Z",
- "workloadSupportedTypes": {
- "workspace": false,
- "training": false,
- "distributed": true,
- "distFramework": "TF"
}
}, - "spec": {
- "command": "python",
- "args": "-x my-script.py",
- "runAsUid": 500,
- "runAsGid": 30,
- "supplementalGroups": "2,3,5,8",
- "environmentVariables": [
- {
- "name": "HOME",
- "value": "/home/my-folder",
- "secret": {
- "name": "postgress_secret",
- "key": "POSTGRES_PASSWORD"
}, - "exclude": false
}
], - "image": "python:3.8",
- "imagePullPolicy": "Always",
- "workingDir": "/home/myfolder",
- "createHomeDir": true,
- "probes": {
- "readiness": {
- "initialDelaySeconds": 0,
- "periodSeconds": 1,
- "timeoutSeconds": 1,
- "successThreshold": 1,
- "failureThreshold": 1,
- "handler": {
- "httpGet": {
- "path": "/",
- "port": 1,
- "host": "example.com",
- "scheme": "HTTP"
}
}
}
}, - "uidGidSource": "fromTheImage",
- "capabilities": [
- "CHOWN",
- "KILL"
], - "seccompProfileType": "RuntimeDefault",
- "runAsNonRoot": true,
- "readOnlyRootFilesystem": false,
- "tty": true,
- "stdin": true,
- "allowPrivilegeEscalation": false,
- "hostIpc": false,
- "hostNetwork": false,
- "connections": [
- {
- "name": "string",
- "isExternal": false,
- "internalToolInfo": {
- "toolType": "jupyter-notebook",
- "connectionType": "LoadBalancer",
- "containerPort": 1,
- "nodePortInfo": {
- "isCustomPort": false
}, - "externalUrlInfo": {
- "isCustomUrl": false,
- "externalUrl": "string"
}, - "servingPortInfo": {
- "protocol": "grpc"
}
},
}
], - "overrideUidGidInWorkspace": false
}, - "usedBy": {
- "workspaces": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "trainings": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "distributed": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "inferences": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-workload-name",
- "status": "string"
}
], - "templates": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "assets": {
- "environment": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset",
- "toolTypes": [
- "jupyter-notebook"
]
}, - "environments": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "compute": {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}, - "computes": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset"
}
], - "datasources": [
- {
- "id": "497f6eca-6276-4993-bfeb-53cbbbba6f08",
- "name": "my-asset",
- "kind": "compute",
- "overrides": {
- "containerPath": "/container/directory"
}
}
]
}
}, - "usageTimes": {
- "lastUsedByWorkload": "2019-08-24T14:15:22Z"
}, - "compliance": {
- "imposed": true,
- "compliance": true,
- "reason": [
- {
- "field": "string",
- "details": "string"
}
]
}, - "status": {
- "status": "Issues found",
- "issues": [
- {
- "scopeId": "string",
- "scopeType": "system",
- "issue": "ReplicationError"
}
], - "message": "string",
- "url": "string"
}
}
Use to delete an environment asset by id.
Accepted.
Unauthorized
Forbidden
The specified resource was not found
unexpected error
{- "code": 202,
- "message": "Request has been accepted."
}