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

Execute a command in the container via replicaSet

POST
/api/v1/replicaSet/{name}/execute
Execute a command in the replicaSet current version of the container.

Request

Path Params
name
string 
required
ReplicaSet Name
Example:
foo
Body Params application/json
cmd
array[string]
required
One Command
Example
{
  "cmd": [
    "nvidia-smi"
  ]
}

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 POST 'http://127.0.0.1:2378/api/v1/replicaSet/foo/execute' \
--header 'Content-Type: application/json' \
--data-raw '{
    "cmd": ["nvidia-smi"]
}'

Responses

🟢200OK
application/json
Body
code
integer 
required
msg
string 
required
data
object 
required
stdout
string 
required
Response
Example
{
  "code": 200,
  "msg": "Success",
  "data": {
    "stdout": "Mon Jan 22 03:01:02 2024       \n+-----------------------------------------------------------------------------+\n| NVIDIA-SMI 525.85.12    Driver Version: 525.85.12    CUDA Version: 12.0     |\n|-------------------------------+----------------------+----------------------+\n| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |\n| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |\n|                               |                      |               MIG M. |\n|===============================+======================+======================|\n|   0  NVIDIA A100 80G...  On   | 00000000:36:00.0 Off |                    0 |\n| N/A   42C    P0    65W / 300W |  51827MiB / 81920MiB |      0%      Default |\n|                               |                      |             Enabled* |\n+-------------------------------+----------------------+----------------------+\n|   1  NVIDIA A100 80G...  On   | 00000000:89:00.0 Off |                    0 |\n| N/A   47C    P0    70W / 300W |  12481MiB / 81920MiB |      0%      Default |\n|                               |                      |             Enabled* |\n+-------------------------------+----------------------+----------------------+\n|   2  NVIDIA A100 80G...  On   | 00000000:8A:00.0 Off |                    0 |\n| N/A   39C    P0    45W / 300W |      0MiB / 81920MiB |      0%      Default |\n|                               |                      |             Enabled* |\n+-------------------------------+----------------------+----------------------+\n                                                                               \n+-----------------------------------------------------------------------------+\n| Processes:                                                                  |\n|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |\n|        ID   ID                                                   Usage      |\n|=============================================================================|\n+-----------------------------------------------------------------------------+\n"
  }
}
Modified at 2024-01-22 07:53:45
Previous
Commit container as an image via replicaSet
Next
Patch a container via replicaSet
Built with