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

Patch a container via replicaSet

PATCH
/api/v1/replicaSet/{name}
Patch the configuration of the latest version of existing container via create a new container and copy the old container system data to the new container.
Including changing the number of gpu and updating the volume binding.
If you request body is empty(e.g. {}), it will recreate a container based on the existing configuration.
The old version container will be deleted.
For example, if foo-1 calls the /api/v1/replicaSet/:name and create foo-2, foo-1 will be deleted.

Request

Path Params
name
string 
required
Body Params application/json
gpuPatch
object 
required
gpuCount
integer 
required
To adjust the number of gpus, it is so simple.
If you don't want to use the gpu, set it to 0.
volumePatch
object 
required
First find the mount information by matching oldBind, then change it.
oldBind
object 
required
The old binding information, which you can get via '/api/v1/replicaSet/:name'.
newBind
object 
required
If it is a docker volume, make sure it already exists.
Example
{
  "gpuPatch": {
    "gpuCount": 1
  },
  "volumePatch": {
    "oldBind": {
      "src": "veil-0",
      "dest": "/root/veil-0"
    },
    "newBind": {
      "src": "veil-1",
      "dest": "/root/veil-1"
    }
  }
}

Request 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 PATCH 'http://127.0.0.1:2378/api/v1/replicaSet/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "gpuPatch": {
        "gpuCount": 1
    },
    "volumePatch": {
        "oldBind": {
            "src": "veil-0",
            "dest": "/root/veil-0"
        },
        "newBind": {
            "src": "veil-1",
            "dest": "/root/veil-1"
        }
    }
}'

Responses

🟢200OK
application/json
Body
code
integer 
required
msg
string 
required
data
object 
required
containerName
string 
required
Example
{
  "code": 200,
  "msg": "Success",
  "data": {
    "containerName": "foo-2"
  }
}
Modified at 2024-01-23 02:04:52
Previous
Execute a command in the container via replicaSet
Next
Rollback a container via replicaSet
Built with