GPU-Docker-API-Official
  1. ReplicaSet
GPU-Docker-API-Official
  • ReplicaSet
    • Run a container via replicaSet
      POST
    • Commit container as an image via replicaSet
      POST
    • Execute a command in the container via replicaSet
      POST
    • Patch a container via replicaSet
      PATCH
    • Rollback a container via replicaSet
      PATCH
    • Stop a container via replicaSet
      PATCH
    • Restart a container via replicaSet
      PATCH
    • Pause a replicaSet via replicaSet
      PATCH
    • Continue a replicaSet via replicaSet
      PATCH
    • Get version info about replicaSet
      GET
    • Get all version info about replicaSet
      GET
    • Delete a container via replicaSet
      DELETE
  • Volume
    • Create a volume
      POST
    • Patch a volume
      PATCH
    • Get version info about a volume
      GET
    • Get all version info about a volume
      GET
    • Delete a volume
      DELETE
  • Resource
    • Get gpu usage status
      GET
    • Get port usage status
      GET
  1. ReplicaSet

Run a container via replicaSet

POST
/api/v1/replicaSet
Run a container consists of two parts: create and start.
When the container is created, the creation information is saved to etcd.
ReplicaSet is just an abstract concept, there is no concrete implementations,it just has to manage docker container, and save the container historical version information, that's all.

Request

Body Params application/json

Example
{
    "imageName": "nvidia/cuda:10.0-base",
    "replicaSetName": "foo",
    "gpuCount": 3,
    "binds": [
        {
            "src": "veil-0",
            "dest": "/root/veil-0"
        },
        {
            "src": "/mynfs/data/ctr-knock",
            "dest": "/root/data/ctr-knock"
        }
    ],
    "env": [
        "USER=foo"
    ],
    "containerPorts": [
        "22",
        "443"
    ]
}

Request Code Samples

Shell
JavaScript
Java
Swift
Go
PHP
Python
HTTP
C
C#
Objective-C
Ruby
OCaml
Dart
R
Request Request Example
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://127.0.0.1:2378/api/v1/replicaSet' \
--header 'Content-Type: application/json' \
--data-raw '{
    "imageName": "nvidia/cuda:10.0-base",
    "replicaSetName": "foo",
    "gpuCount": 3,
    "binds": [
        {
            "src": "veil-0",
            "dest": "/root/veil-0"
        },
        {
            "src": "/mynfs/data/ctr-knock",
            "dest": "/root/data/ctr-knock"
        }
    ],
    "env": [
        "USER=foo"
    ],
    "containerPorts": [
        "22",
        "443"
    ]
}'

Responses

🟢200OK
application/json
Body

Example
{
    "code": 200,
    "msg": "Success",
    "data": {
        "name": "foo-1"
    }
}
Modified at 2024-01-23 02:24:35
Previous
ReplicaSet
Next
Commit container as an image via replicaSet
Built with