@delta-infra/cli 1.1.21 → 1.1.23
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md
CHANGED
|
@@ -244,6 +244,8 @@ delta-cli sandbox kill <sandbox_id>
|
|
|
244
244
|
### Sandbox 命令
|
|
245
245
|
|
|
246
246
|
> **提示**:`sandbox list`(列沙箱实例)与 `sandbox ls <id>`(列目录)不同,注意区分。
|
|
247
|
+
>
|
|
248
|
+
> **沙箱内路径**:指向沙箱内部的路径(`--path`、`write-multiple --entry` 的远端部分、`upload --target`、`pull --source`、`run`/`run-bg --log-file`)若为相对路径,会自动拼到沙箱工作目录(`sandbox working-directory <id>` 可查),绝对路径原样使用;指向本地机器的路径(`write --source`、`upload --source`、`pull --target`、`read --output`)不做任何改写。
|
|
247
249
|
|
|
248
250
|
| 命令 | 说明 |
|
|
249
251
|
|------|------|
|
|
@@ -318,9 +320,11 @@ Skill 文档 `skills/delta-science/references/qe.md` 与
|
|
|
318
320
|
{"ok":true,"data":{"id":"sb-xxx","status":"running"}}
|
|
319
321
|
|
|
320
322
|
// 错误
|
|
321
|
-
{"ok":false,"error":{"type":"auth","message":"not authenticated","hint":"run 'delta-cli auth login'"}}
|
|
323
|
+
{"ok":false,"error":{"type":"auth","message":"not authenticated","hint":"run 'delta-cli auth login'","request_id":"create_a1b2c3"}}
|
|
322
324
|
```
|
|
323
325
|
|
|
326
|
+
`error.hint` 给出可执行的下一步(创建失败时会说明具体原因,例如「镜像未在目标节点缓存,重试或换一个已缓存该镜像的 GPU 型号」),`error.request_id` 用于在服务端日志中定位同一次失败。
|
|
327
|
+
|
|
324
328
|
错误类型及退出码:
|
|
325
329
|
|
|
326
330
|
| Type | Exit Code | 场景 |
|
package/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
9eb9fe9e0d02bf4e67695e306a3108c0b1c7cdccca74c91ec3a0e31ab1445e85 delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
0bad652d1b34bda5023cc33dbb45c69728652eda998563eae51f43c1b9e69a9c delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
a209b2e939ca8a1774a1c1a6ccf382484faa07bdc7a69b4f7ee25574a182022a delta-cli-linux-amd64.tar.gz
|
|
4
|
+
9cbcf8c8ef861fbcb36e63d3d7ede2087eb16cf774e9a4ee9e17c2b8094d19e0 delta-cli-linux-arm64.tar.gz
|
|
5
|
+
da62e711c7e1f93912982a380d96b32584df2ade08eeb9a4a99872bb70304238 delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -164,7 +164,7 @@ The reason is that, after running a command, this skill reads `log_file` from th
|
|
|
164
164
|
| Read a file | `sandbox read <id> --path <path> [--output <local-path> --tail N --grep <pattern> --offset N --limit N --context N --max-bytes N --parse-json]` |
|
|
165
165
|
| Pull a file/directory | `sandbox pull <id> --source <sandbox-path> --target <local-path> [--recursive] [--pattern <glob>]` — pull a single file or recursively pull a directory, with sha1 verification (the reverse of upload: source=remote, target=local) |
|
|
166
166
|
| View the working directory | `sandbox working-directory <id>` (returns `data.path`, such as `/workspace/{user_id}/{sandbox_id}`) |
|
|
167
|
-
| Write a file | `sandbox write <id> --source <filename>` (without `--path`, writes to the working directory by default);
|
|
167
|
+
| Write a file | `sandbox write <id> --source <filename>` (without `--path`, writes to the working directory by default); **every sandbox-side path** — `--path`, the remote part of `write-multiple --entry`, `upload --target`, `pull --source`, `run`/`run-bg --log-file` — is prefixed with the working directory when relative, while an absolute path is used as given |
|
|
168
168
|
| Write multiple files | `sandbox write-multiple <id> --entry <remote-path>=<local-path> [--entry ...]` |
|
|
169
169
|
| Upload a directory | `sandbox upload <id> --source <local-directory> --target <sandbox-path>` |
|
|
170
170
|
| List a directory | `sandbox ls <id> --path <path>` (defaults to `.`) |
|
|
@@ -176,7 +176,6 @@ The reason is that, after running a command, this skill reads `log_file` from th
|
|
|
176
176
|
| Delete directories | `sandbox rmdir <id> --path <path> [--path ...]` |
|
|
177
177
|
| Create directories | `sandbox mkdir <id> --path <path> [--path ...]` |
|
|
178
178
|
| Search files | `sandbox search <id> --path <root-directory> --pattern <glob>` |
|
|
179
|
-
| Upload a directory | `sandbox upload <id> --source <local-directory> --target <sandbox-path>` |
|
|
180
179
|
|
|
181
180
|
## Full lifecycle
|
|
182
181
|
|
|
@@ -195,7 +194,7 @@ The reason is that, after running a command, this skill reads `log_file` from th
|
|
|
195
194
|
- `--no-auto-cleanup`: when this flag is set, the sandbox **will not be cleaned up automatically** (both server-side timeout reclamation and the local periodic `cleanup_stale` process are skipped). It can be destroyed only by an explicit `sandbox kill`/`finish`. Use this only when the task genuinely needs to survive past periodic cleanup; you must destroy it explicitly when the task is done to avoid leaking resources.
|
|
196
195
|
- **Do not repeatedly poll with `sandbox status` after a successful create**. The sandbox is ready as soon as `sandbox create` returns; use its returned `data.sandbox_id` directly for `write`/`run`. Extra polling adds tool calls without providing any benefit.
|
|
197
196
|
3. **Write code/data**:
|
|
198
|
-
- **Single file**: `delta-cli sandbox write <id> --source <filename>` — omit `--path` to write to the sandbox's working directory by default (`/workspace/{user_id}/{sandbox_id}/`; query it with `delta-cli sandbox working-directory <id>`). Pass only a local filename to `--source` (for example, `--source train.py`). **Do not** use shell-variable paths such as `"$WORKSPACE_ROOT/train.py"` or `$(pwd)/train.py`. With `--source`, the CLI reads the local file itself without shell expansion, making this the safest option. If you need a specific path, a relative `--path <relative-path>` is automatically prefixed with the working directory; absolute paths are used as given (**avoid** paths such as `/workspace/<filename>` outside `{user_id}`, as they do not persist after `kill`). The returned `size` field is the actual number of bytes on disk (verified with stat), so you can check that the write is complete. For small configuration files (<20 lines), you may use `--data "..."`, but you must also pass `--path`. File paths and extensions depend on the runtime in the image.
|
|
197
|
+
- **Single file**: `delta-cli sandbox write <id> --source <filename>` — omit `--path` to write to the sandbox's working directory by default (`/workspace/{user_id}/{sandbox_id}/`; query it with `delta-cli sandbox working-directory <id>`). Pass only a local filename to `--source` (for example, `--source train.py`). **Do not** use shell-variable paths such as `"$WORKSPACE_ROOT/train.py"` or `$(pwd)/train.py`. With `--source`, the CLI reads the local file itself without shell expansion, making this the safest option. If you need a specific path, a relative `--path <relative-path>` is automatically prefixed with the working directory; absolute paths are used as given (the same rule applies to every sandbox-side path: the remote part of `write-multiple --entry`, `upload --target`, `pull --source`, and `run`/`run-bg --log-file`) (**avoid** paths such as `/workspace/<filename>` outside `{user_id}`, as they do not persist after `kill`). The returned `size` field is the actual number of bytes on disk (verified with stat), so you can check that the write is complete. For small configuration files (<20 lines), you may use `--data "..."`, but you must also pass `--path`. File paths and extensions depend on the runtime in the image.
|
|
199
198
|
- **Write multiple files**: `sandbox write-multiple <id> --entry <remote-path>=<local-path> [--entry ...]` (remote path is on the left of `=`, local path on the right; bulk writes with `--data` are not supported)
|
|
200
199
|
- **Upload a directory**: `sandbox upload <id> --source <local-directory> --target <sandbox-path>` — the CLI packages the local directory as tar.gz and uploads it using multipart/form-data; the server extracts it into the target directory. The response lists each file's path, size and mode. After upload, the CLI checks the local and remote file lists for integrity and warns about mismatched sizes, extra files and similar issues.
|
|
201
200
|
- **Note**: `--source` is a **local directory path**; `--target` is the **target directory inside the sandbox**. The target directory is created if it does not exist.
|
|
@@ -383,6 +382,7 @@ This skill is designed to make the conclusion self-contained: when execution end
|
|
|
383
382
|
| `error.type: validation` | Check parameter formats and required flags |
|
|
384
383
|
| `error.type: auth / permission` | Follow the permission-denied guidance in delta-shared |
|
|
385
384
|
| `error.type: api` (5xx) | Server error; check the API service status |
|
|
385
|
+
| `sandbox create` failed | Read `error.hint` — it states the cause and the next step (for example, the image was not cached on the target node, so the initial pull exceeded the readiness timeout: retry once, or pick a GPU type whose node already has the image). A failed create leaves no sandbox behind, so retrying is safe. `error.request_id` identifies the failure in the server log. |
|
|
386
386
|
| Command execution failed (`exit_code ≠ 0`) | Check stdout/stderr returned by `run` |
|
|
387
387
|
| Command timed out | Increase `--timeout` or use `run-bg` |
|
|
388
388
|
| `error.type: internal` | Client-side internal error; check the delta-cli version or contact the maintainer |
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
> **Prerequisite:** Read [`../../delta-shared/SKILL.md`](../../delta-shared/SKILL.md) first for authentication, configuration and general error handling.
|
|
2
2
|
|
|
3
|
+
> **Paths inside the sandbox:** every path that points *inside* the sandbox — `--path`, the remote part of `write-multiple --entry`, `upload --target`, `pull --source`, and `run`/`run-bg --log-file` — is resolved against the sandbox working directory when it is relative; an absolute path is used as-is. Flags that point at the *local* machine (`write --source`, `upload --source`, `pull --target`, `read --output`) are local and are never rewritten.
|
|
4
|
+
|
|
3
5
|
# Command reference
|
|
4
6
|
|
|
5
7
|
## Discovery
|
|
@@ -15,11 +17,12 @@
|
|
|
15
17
|
|
|
16
18
|
| Command | Description |
|
|
17
19
|
|------|------|
|
|
18
|
-
| `sandbox create --image-name <image-name> [--cpu N --memory XGi --gpu N --gpu-mem N --gpu-type <model> --shm-size XGi --devices kvm --max-life M --no-auto-cleanup]` | Create a sandbox container (`--image-name` takes an image name, such as `"PyTorch CUDA13 (GPU)"`; the underlying image identifier is hidden from users. `--gpu-type` selects a GPU model, such as `"RTX 4090"` or `H100`; the server maps this to the HAMi use-gputype annotation for model-based scheduling. To see available models, check `sandbox resources` (the `third_party` group's `gpu_types[].gpu_name`); if omitted, scheduling is automatic. `--no-auto-cleanup` prevents automatic cleanup; the sandbox can then be destroyed only with an explicit kill/finish); `--memory`/`--gpu-mem` accept g/m/G/M formats (for example, `1G`/`512M`; lowercase is also accepted), which the CLI converts to the `Gi`/`Mi` units accepted by the server; `--shm-size` increases the container's `/dev/shm` (the **default is only 64Mi**; it must be increased if PyTorch `DataLoader(num_workers>0)`/`multiprocessing`, Chromium-based engines or similar report `No space left on device`/`Bus error` because shared memory is insufficient; **a Gi/Mi unit is required** (`4G`/`512M` are normalised by the CLI; the server rejects a bare number); it **must not exceed `--memory`** (it is a memory filesystem and filling it causes OOMKill; `--memory` defaults to only `1Gi`, so increasing shm usually requires increasing memory too); validation is backend-independent and rejects invalid values before creation, but this setting is applied only on private compute (third-party compute ignores it); `--devices` requests host-device passthrough using comma-separated tokens (for example, `kvm` makes `/dev/kvm` available inside the container for nested virtualisation; this raises privileges, and if the server allowlist is not enabled, creation is **explicitly rejected** rather than silently ignored; this setting is applied only on private compute); **resource limits per sandbox**: `--cpu` ≤ 512, `--memory` ≤ 1024Gi, `--gpu` ≤ 64, `--gpu-mem` ≤ 1024Gi, and `--shm-size` ≤ `--memory`. Exceeding a limit returns a **validation error promptly at request time** (it does not hang); normal tasks are well below these limits. The response echoes the requested image name/resource (request values fill fields not returned by the server; server values take precedence); compute backend is an internal detail and is selected automatically, so `--provider` is no longer supported. |
|
|
20
|
+
| `sandbox create --image-name <image-name> [--cpu N --memory XGi --gpu N --gpu-mem N --gpu-type <model> --shm-size XGi --devices kvm --max-life M --no-auto-cleanup]` | Create a sandbox container (`--image-name` takes an image name, such as `"PyTorch CUDA13 (GPU)"`; the underlying image identifier is hidden from users. `--gpu-type` selects a GPU model, such as `"RTX 4090"` or `H100`; the server maps this to the HAMi use-gputype annotation for model-based scheduling. To see available models, check `sandbox resources` (the `third_party` group's `gpu_types[].gpu_name`); if omitted, scheduling is automatic. `--no-auto-cleanup` prevents automatic cleanup; the sandbox can then be destroyed only with an explicit kill/finish); `--memory`/`--gpu-mem` accept g/m/G/M formats (for example, `1G`/`512M`; lowercase is also accepted), which the CLI converts to the `Gi`/`Mi` units accepted by the server; `--shm-size` increases the container's `/dev/shm` (the **default is only 64Mi**; it must be increased if PyTorch `DataLoader(num_workers>0)`/`multiprocessing`, Chromium-based engines or similar report `No space left on device`/`Bus error` because shared memory is insufficient; **a Gi/Mi unit is required** (`4G`/`512M` are normalised by the CLI; the server rejects a bare number); it **must not exceed `--memory`** (it is a memory filesystem and filling it causes OOMKill; `--memory` defaults to only `1Gi`, so increasing shm usually requires increasing memory too); validation is backend-independent and rejects invalid values before creation, but this setting is applied only on private compute (third-party compute ignores it); `--devices` requests host-device passthrough using comma-separated tokens (for example, `kvm` makes `/dev/kvm` available inside the container for nested virtualisation; this raises privileges, and if the server allowlist is not enabled, creation is **explicitly rejected** rather than silently ignored; this setting is applied only on private compute); **resource limits per sandbox**: `--cpu` ≤ 512, `--memory` ≤ 1024Gi, `--gpu` ≤ 64, `--gpu-mem` ≤ 1024Gi, and `--shm-size` ≤ `--memory`. Exceeding a limit returns a **validation error promptly at request time** (it does not hang); normal tasks are well below these limits. The response echoes the requested image name/resource (request values fill fields not returned by the server; server values take precedence); compute backend is an internal detail and is selected automatically, so `--provider` is no longer supported. If creation fails, `error.hint` states the cause and the next step (for example, the image was not cached on the target node: retry, or pick a GPU type whose node already has the image), and `error.request_id` identifies the failure in the server log. |
|
|
19
21
|
| `sandbox connect <id>` | Connect to an existing sandbox. |
|
|
20
22
|
| `sandbox status <id>` | Check sandbox status (running / done). |
|
|
21
23
|
| `sandbox finish <id> [--results '{...}']` | Save results and destroy the sandbox automatically. |
|
|
22
24
|
| `sandbox kill <id>` | Destroy the sandbox immediately without saving results. |
|
|
25
|
+
| `sandbox extend <id> [--max-life N]` | Query or adjust the max lifetime of a running sandbox (N in minutes; omit `--max-life` to query the current lifecycle). `status` also reports the lifecycle summary under `data.lifecycle`. |
|
|
23
26
|
|
|
24
27
|
## Command execution
|
|
25
28
|
|
|
@@ -38,17 +41,27 @@
|
|
|
38
41
|
| `sandbox working-directory <id>` | Get the sandbox's current working directory (absolute path `/workspace/{user_id}/{sandbox_id}`). |
|
|
39
42
|
| `sandbox write <id> [--path <path>] --source <filename>` | Write a file (recommended). If `--path` is omitted, write to the working directory (`<working-directory>/<filename>`); a relative `--path` is also resolved under the working directory. An absolute `--path` is used as-is (but the `/workspace/<filename>` root path is outside the OSS sync scope and is not recommended). |
|
|
40
43
|
| `sandbox write <id> --path <absolute-path> --data "..."` | Write a small amount of inline content (`--data` has no source filename, so `--path` must be specified explicitly). |
|
|
41
|
-
| `sandbox write-multiple <id> --entry <
|
|
44
|
+
| `sandbox write-multiple <id> --entry <remote-path>=<local-path> [--entry ...]` | Write multiple files in one operation (a relative target `path` is also resolved under the working directory). |
|
|
42
45
|
| `sandbox pull <id> --source <sandbox-path> --target <local-path> [--recursive] [--pattern <glob>]` | Pull files/directories to the local machine (the reverse of `upload`; flag directions are reversed: `--source`=remote sandbox path, `--target`=local path). Single files are detected automatically; directories are traversed recursively by default; SHA-1 integrity is checked by both the CLI and server. |
|
|
46
|
+
| `sandbox upload <id> --source <local-directory> --target <sandbox-path>` | Upload a local directory (packaged as tar.gz, extracted server-side) and verify the resulting file list against the local manifest. `--source` is local, `--target` is inside the sandbox. |
|
|
43
47
|
| `sandbox ls <id> --path <path>` | List directory contents (defaults to `.`). |
|
|
44
48
|
| `sandbox stat <id> --path <path>` | Get file metadata (size / mode / owner / group). |
|
|
45
49
|
| `sandbox mv <id> --entry <source=dest> [--entry ...]` | Move or rename files. |
|
|
46
50
|
| `sandbox replace <id> --path <path> --old <text> --new <text> [--regex] [--ignore-case]` | Replace file contents. |
|
|
47
51
|
| `sandbox chmod <id> --path <path> --mode <octal>` | Change file permissions. |
|
|
48
52
|
| `sandbox rm <id> --path <path> [--path ...]` | Delete files. |
|
|
53
|
+
| `sandbox rmdir <id> --path <path> [--path ...]` | Delete directories recursively (cannot be undone). |
|
|
49
54
|
| `sandbox mkdir <id> --path <path> [--path ...]` | Create directories (`mkdir -p`). |
|
|
50
55
|
| `sandbox search <id> --path <root-directory> --pattern <glob>` | Search for files. |
|
|
51
56
|
|
|
57
|
+
## Tunnelling (port exposure)
|
|
58
|
+
|
|
59
|
+
| Command | Description |
|
|
60
|
+
|------|------|
|
|
61
|
+
| `sandbox expose <id> [--port N]` | Expose a service port inside the sandbox to the public internet and return the `public_url` (the platform default inner port is 8700). |
|
|
62
|
+
| `sandbox exposes <id>` | List the public tunnels currently active for this sandbox. |
|
|
63
|
+
| `sandbox dispose <id> --port N` | Recycle one tunnel (stop frpc and release the public port); killing the sandbox also reclaims its tunnels. |
|
|
64
|
+
|
|
52
65
|
## Notes
|
|
53
66
|
|
|
54
67
|
- `list` ≠ `ls`: `sandbox list` lists sandbox instances; `sandbox ls <id>` lists directories inside a sandbox.
|
|
@@ -7,7 +7,8 @@
|
|
|
7
7
|
1. **Check available images** `delta-cli sandbox images` — list the images supported by the server. The image determines which language runtimes are available in the container (Python / Node.js / Go / Java / Rust, etc.); choose one that fits the user's technology stack and GPU/CPU requirements.
|
|
8
8
|
2. **List existing sandboxes (optional)** `delta-cli sandbox list` — check the active sandboxes already created by the current user to avoid creating duplicates.
|
|
9
9
|
3. **Create** `delta-cli sandbox create --image-name <image-name> --cpu 4 --memory 16Gi --gpu 1 --gpu-mem 8000 --max-life 120 [--gpu-type <model>] [--shm-size XGi] [--devices kvm]` (the sandbox is ready to use immediately; no connection step is needed. `--memory`/`--gpu-mem` accept g/m/G/M formats (for example, 1G/512M; lowercase is also accepted), which the CLI converts to Gi/Mi. `--max-life` sets the sandbox's maximum lifetime in minutes; the default is 30. `--no-auto-cleanup` prevents automatic cleanup; the sandbox can then be destroyed only with an explicit kill/finish. `--image-name` takes an image name, such as `"PyTorch CUDA13 (GPU)"`; compute backend selection is automatic and does not need to be specified. `--gpu-type` (optional) selects a GPU model, such as `"RTX 4090"` or `H100`; the server maps this to the HAMi use-gputype annotation for model-based scheduling. To see available models, check `sandbox resources` (the `third_party` group's `gpu_types[].gpu_name`); if omitted, scheduling is automatic. `--shm-size` (optional) increases the container's `/dev/shm` (the **default is only 64Mi**)—it must be increased when PyTorch `DataLoader(num_workers>0)`/`multiprocessing`, Chromium-based engines or similar report `No space left on device`/`Bus error`; **a Gi/Mi unit is required** (`4G`/`512M` are normalised by the CLI; the server rejects a bare number), and it **must not exceed `--memory`** (it is a memory filesystem and filling it causes OOMKill; `--memory` defaults to only 1Gi, so increasing shm usually requires increasing memory too, for example, `--memory 8Gi --shm-size 4Gi`). Only private compute (`private`) applies this setting (third-party compute ignores it), but unit/limit validation is backend-independent and rejects invalid values before creation. `--devices` (optional) requests host-device passthrough using comma-separated tokens (for example, `--devices kvm` makes `/dev/kvm` available inside the container for nested virtualisation); this raises privileges, and if the server allowlist is not enabled, creation is **explicitly rejected** (not silently ignored; validation is backend-independent). If this error occurs, do not retry; use an approach that does not depend on that device. Only private compute applies this setting. **Resource limits per sandbox**: cpu ≤ 512, memory ≤ 1024Gi, gpu ≤ 64, gpuMem ≤ 1024Gi, shmSize ≤ memory. Exceeding a limit returns a validation error promptly at request time rather than hanging.)
|
|
10
|
-
|
|
10
|
+
- **If `create` fails**: the error envelope's `hint` states the cause and the next step. A common one is "the image may not be cached on the target node" — the initial pull exceeded the readiness timeout, so retry once (the pull continues in the background and later creates succeed) or pick a GPU type whose node already has the image. A failed create leaves no sandbox behind, so retrying is safe; `error.request_id` identifies the failure in the server log.
|
|
11
|
+
4. **Write code/data** `delta-cli sandbox write <id> --source <filename>` — write a local file directly to the sandbox. If `--path` is omitted, the file is written to that sandbox's working directory by default (`/workspace/{user_id}/{sandbox_id}/<filename>`, which is within the OSS sync scope, so the file persists after kill). Before writing, use `delta-cli sandbox working-directory <id>` to confirm the path. **You must** use a relative source path (for example, `--source infer.py`); do not use `"$WORKSPACE_ROOT/<filename>"` or `$(pwd)/...`. A relative `--path` is also resolved under the working directory; an absolute `--path` is used as-is (the same rule applies to every sandbox-side path: the remote part of `write-multiple --entry`, `upload --target`, `pull --source`, and `run`/`run-bg --log-file`) (`/workspace/<filename>` is outside the OSS sync scope and is not recommended). You can also use `--data "..."` to write a small amount of inline content (requires an explicit `--path`), and `--mode 755` to set file permissions. The returned `size` field is the actual on-disk byte count verified with stat, so it can confirm that the write completed. Use `write-multiple` to write several files at once. File paths and extensions depend on the runtimes in the image.
|
|
11
12
|
5. **Run a command** — first use `delta-cli sandbox working-directory <id>` to get `<wd>`, then construct a command for a runtime in the image. Common examples: `python <wd>/train.py` (Python), `node <wd>/app.js` (Node.js), `go run <wd>/main.go` (Go), `bash <wd>/run.sh` (Shell).
|
|
12
13
|
- **Short tasks ≤60s**: `delta-cli sandbox run <id> --command "<command>" --timeout <seconds>` runs synchronously; raw SSE `data:` frames are passed through to stdout (with no trailing envelope), `exit_code`/`log_file` are read from the `complete` frame, and full stdout is written to the log_file.
|
|
13
14
|
- **Long tasks >60s**: run `delta-cli sandbox run-bg <id> --command "<command>" --timeout <seconds> --wait` in the background (recommended), or use `run-bg` + `logs` for manual polling (`run-bg --wait` includes `--summary` by default; without `--wait`, it returns `{execution_id, sandbox_id}` immediately).
|
|
@@ -71,13 +71,14 @@ This returns the current user's information and remaining credits (through the g
|
|
|
71
71
|
|
|
72
72
|
```json
|
|
73
73
|
{"ok":true,"data":{...}}
|
|
74
|
-
{"ok":false,"error":{"type":"auth","message":"...","hint":"..."}}
|
|
74
|
+
{"ok":false,"error":{"type":"auth","message":"...","hint":"...","request_id":"..."}}
|
|
75
75
|
```
|
|
76
76
|
|
|
77
77
|
AI agent parsing rules:
|
|
78
78
|
- Always check `ok`; do not rely on the exit code alone.
|
|
79
79
|
- `error.type` is the stable field for branching on: `auth`, `permission`, `not_found`, `validation`, `network`, `api`, `command_failed`, `internal`.
|
|
80
|
-
- `error.hint` may be shown to the user.
|
|
80
|
+
- `error.hint` may be shown to the user. **Act on it rather than retrying blindly**: for a failed `sandbox create` the hint names the concrete cause and the next step (for example, the image was not cached on the target node — retry, or pick a GPU type whose node already has the image).
|
|
81
|
+
- `error.request_id` identifies the same failure in the server log; quote it when reporting the failure.
|
|
81
82
|
|
|
82
83
|
## Exit code conventions
|
|
83
84
|
|
|
@@ -110,4 +111,5 @@ delta-cli upgrade
|
|
|
110
111
|
| `error.type: network` | Check `base_url` and network connectivity |
|
|
111
112
|
| `error.type: validation` | Check required flags and argument formats |
|
|
112
113
|
| `error.type: command_failed` | Command failed inside the sandbox: the envelope's `message` already includes the stderr tail to help locate the issue quickly; the full `stderr` / `result_summary` are in the `complete` frame. Retry or correct the command |
|
|
114
|
+
| `sandbox create` failed (`error.type: api` with a specific `hint`) | Follow the hint — it names the cause and the next step. "the image may not be cached on the target node" → retry once (the pull continues in the background, so later creates succeed) or pick a GPU type whose node already has the image. "check the target node's free disk space" → a retry will not help until an operator frees the node. A failed create leaves no sandbox behind, so retrying is safe. Quote `error.request_id` when reporting it. |
|
|
113
115
|
| Configuration file parsing failed | Check that `~/.delta-infra/config.json` contains valid JSON |
|