@delta-infra/cli 1.0.99 → 1.1.0
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
package/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
a10f6e14567f6abf3c5fea000812972a1f3cfe12fa3f4c32bc5a2f6c9625a481 delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
48491c7a1e74c195f58864967fd187cc42757e4b3fce93b9e8c48349585a3b8c delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
619ba18441f4f7210876318f985174e5da6b4b93446f7dac128396563cc41f69 delta-cli-linux-amd64.tar.gz
|
|
4
|
+
1a74f4193f9bf639fedbb572ffcc9bb353a1b38915ad6087a38cbc336e87edac delta-cli-linux-arm64.tar.gz
|
|
5
|
+
07b66fda183467d79de9ecc4431f4e7fe8a1fd243ae86572df4e13c693d94d88 delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -143,7 +143,7 @@ required_outputs:
|
|
|
143
143
|
| 获取资源推荐 | `sandbox recommend --cpu N --memory XGi [--gpu N] [--gpu-mem N]` |
|
|
144
144
|
| 列出当前用户的 sandbox | `sandbox list [--status <running/finished/killed/error>] [--start-time <ISO8601>] [--end-time <ISO8601>] [--sandbox-id <id>] [--days N]` |
|
|
145
145
|
| **生命周期** | |
|
|
146
|
-
| 创建 sandbox | `sandbox create --image-name <镜像名> [--cpu N --memory XGi --gpu N --gpu-mem N --max-life M]`;`--image-name` 用镜像名(`sandbox images` 返回的 `image_name` 字段,如 `"PyTorch CUDA13 (GPU)"
|
|
146
|
+
| 创建 sandbox | `sandbox create --image-name <镜像名> [--cpu N --memory XGi --gpu N --gpu-mem N --gpu-type <型号> --max-life M]`;`--image-name` 用镜像名(`sandbox images` 返回的 `image_name` 字段,如 `"PyTorch CUDA13 (GPU)"`),底层镜像标识对用户隐藏;`--gpu-type` 指定 GPU 型号(如 `"RTX 4090"`、`H100`),服务端映射为 HAMi use-gputype 注解按型号调度,可选型号查 `sandbox resources`(`third_party` 分组 `gpu_types[].gpu_name`),不传则自动调度;不希望被自动清理时加 `--no-auto-cleanup`(仅显式 kill/finish 可销毁);**单沙箱资源上限** cpu ≤ 512 / memory ≤ 1024Gi / gpu ≤ 64 / gpuMem ≤ 1024Gi,超出快速报错不挂起 |
|
|
147
147
|
| 连接 sandbox | `sandbox connect <id>` |
|
|
148
148
|
| 查看状态 | `sandbox status <id>` |
|
|
149
149
|
| 完成 sandbox | `sandbox finish <id> [--results '{...}']` |
|
|
@@ -179,13 +179,14 @@ required_outputs:
|
|
|
179
179
|
|
|
180
180
|
1. **选择镜像(按需)**:
|
|
181
181
|
- 算力后端(provider)是内部概念,由系统自动选择,**不需要也不支持用户指定**。
|
|
182
|
-
- 如果请求里已经明确指定了镜像(例如 `--image-name "PyTorch CUDA13 (GPU)"`,镜像名)和资源(cpu/memory/gpu
|
|
182
|
+
- 如果请求里已经明确指定了镜像(例如 `--image-name "PyTorch CUDA13 (GPU)"`,镜像名)和资源(cpu/memory/gpu,以及可选的 `--gpu-type`),**直接跳到步骤 2 创建 sandbox**,不要再调 `sandbox images` / `sandbox recommend`。
|
|
183
183
|
- 只有在用户要求“推荐一个配置”或需要查询可用镜像时,才调用:
|
|
184
184
|
- `delta-cli sandbox images` — 服务端支持的镜像列表(返回镜像名,隐藏底层镜像标识)
|
|
185
185
|
- `delta-cli sandbox recommend --cpu N --memory XGi [--gpu N]` — 资源配置推荐
|
|
186
186
|
2. **创建**:`delta-cli sandbox create --image-name <镜像名> --cpu 4 --memory 16Gi --gpu 1 --gpu-mem 8000 --max-life 120`。**返回的 JSON 信封中是 `data.sandbox_id`,不是 `data.id`;后续所有命令必须使用这个真实的 `sandbox_id`。**(创建后 sandbox 立即可用,无需额外连接)。**响应会回显请求的镜像名/resource(服务端未返回的字段由 CLI 用请求值补齐,服务端返回值优先),可直接核对一遍资源配置,无需额外调 status。**(镜像回显为显示名;`provider` 为内部概念,不再回显)。**同一次任务若已有 `sandbox_id`,禁止再次 create,必须优先复用。**
|
|
187
187
|
- --max-life 指定 sandbox 最大存活时间(分钟),默认 30。长任务请调高,确保 sandbox 在命令执行期间不被回收。
|
|
188
188
|
- **`--gpu-mem`(单位 MiB)要匹配实际运行的模型**:模型参数量/精度越大所需显存越大,大模型塞进过小显存会直接 OOM。示例中的 8000(8GiB)只适配小模型,跑 7B/9B/13B 前先评估显存需求并适当调大。
|
|
189
|
+
- **`--gpu-type <型号>`(可选)指定 GPU 型号**:如 `"RTX 4090"`、`H100`,服务端映射为 HAMi use-gputype 注解,将 pod 调度到匹配型号的 GPU 上。可用 `sandbox resources` 查看可选型号(`third_party` 分组的 `gpu_types[].gpu_name`)。仅在用户明确要求特定型号时使用;不传则由系统自动调度。
|
|
189
190
|
- `--no-auto-cleanup`:加此 flag 后该 sandbox **不会被自动清理**(服务端超时回收 + 本地周期 cleanup_stale 均跳过),只能通过显式 `sandbox kill`/`finish` 销毁。仅当任务确实需要跨越周期清理长期存活时才使用,任务结束后必须主动销毁,避免资源泄漏。
|
|
190
191
|
- **禁止在 create 成功后反复调用 `sandbox status` 轮询**。`sandbox create` 返回时 sandbox 已经就绪,直接用它返回的 `data.sandbox_id` 执行 `write`/`run` 即可。多余的轮询会增加工具调用次数且没有任何收益。
|
|
191
192
|
3. **写入代码/数据**:
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
|
|
16
16
|
| 命令 | 说明 |
|
|
17
17
|
|------|------|
|
|
18
|
-
| `sandbox create --image-name <镜像名> [--cpu N --memory XGi --gpu N --gpu-mem N --max-life M --no-auto-cleanup]` | 创建 sandbox 容器(`--image-name` 用镜像名,如 `"PyTorch CUDA13 (GPU)"`,底层镜像标识对用户隐藏;`--no-auto-cleanup` 不被自动清理,仅显式 kill/finish 可销毁);**响应回显请求的镜像名/resource**(服务端未返回字段用请求值补齐,服务端值优先);算力后端为内部概念,自动选择,不再支持 `--provider`。**单沙箱资源上限**:`--cpu` ≤ 512、`--memory` ≤ 1024Gi、`--gpu` ≤ 64、`--gpu-mem` ≤ 1024Gi,超出会在请求阶段**快速返回校验错误**(不会挂起),正常任务远低于这些上限 |
|
|
18
|
+
| `sandbox create --image-name <镜像名> [--cpu N --memory XGi --gpu N --gpu-mem N --gpu-type <型号> --max-life M --no-auto-cleanup]` | 创建 sandbox 容器(`--image-name` 用镜像名,如 `"PyTorch CUDA13 (GPU)"`,底层镜像标识对用户隐藏;`--gpu-type` 指定 GPU 型号,如 `"RTX 4090"`、`H100`,服务端映射为 HAMi use-gputype 注解按型号调度,可选型号查 `sandbox resources`(`third_party` 分组 `gpu_types[].gpu_name`),不传则自动调度;`--no-auto-cleanup` 不被自动清理,仅显式 kill/finish 可销毁);**响应回显请求的镜像名/resource**(服务端未返回字段用请求值补齐,服务端值优先);算力后端为内部概念,自动选择,不再支持 `--provider`。**单沙箱资源上限**:`--cpu` ≤ 512、`--memory` ≤ 1024Gi、`--gpu` ≤ 64、`--gpu-mem` ≤ 1024Gi,超出会在请求阶段**快速返回校验错误**(不会挂起),正常任务远低于这些上限 |
|
|
19
19
|
| `sandbox connect <id>` | 连接已有 sandbox |
|
|
20
20
|
| `sandbox status <id>` | 查看 sandbox 状态(running / done) |
|
|
21
21
|
| `sandbox finish <id> [--results '{...}']` | 保存结果后自动销毁 |
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
1. **查看可用镜像** `delta-cli sandbox images` — 查询服务端支持的镜像列表。镜像决定了容器内的语言运行时(Python / Node.js / Go / Java / Rust 等),根据用户的技术栈和 GPU/CPU 需求匹配。
|
|
8
8
|
2. **列出现有 sandbox(可选)** `delta-cli sandbox list` — 查看当前用户已创建的活跃 sandbox,避免重复创建
|
|
9
|
-
3. **创建** `delta-cli sandbox create --image-name <镜像名> --cpu 4 --memory 16Gi --gpu 1 --gpu-mem 8000 --max-life 120`(创建后立即可用,无需连接;--max-life 指定 sandbox 最大存活时间(分钟),默认 30。`--no-auto-cleanup` 可让 sandbox 不被自动清理,仅显式 kill/finish 可销毁。`--image-name` 用镜像名,如 `"PyTorch CUDA13 (GPU)"
|
|
9
|
+
3. **创建** `delta-cli sandbox create --image-name <镜像名> --cpu 4 --memory 16Gi --gpu 1 --gpu-mem 8000 --max-life 120 [--gpu-type <型号>]`(创建后立即可用,无需连接;--max-life 指定 sandbox 最大存活时间(分钟),默认 30。`--no-auto-cleanup` 可让 sandbox 不被自动清理,仅显式 kill/finish 可销毁。`--image-name` 用镜像名,如 `"PyTorch CUDA13 (GPU)"`;算力后端为内部概念,自动选择,无需指定。`--gpu-type`(可选)指定 GPU 型号,如 `"RTX 4090"`、`H100`,服务端映射为 HAMi use-gputype 注解按型号调度,可选型号查 `sandbox resources`(`third_party` 分组 `gpu_types[].gpu_name`),不传则自动调度。**单沙箱资源上限**:cpu ≤ 512、memory ≤ 1024Gi、gpu ≤ 64、gpuMem ≤ 1024Gi,超出会在请求阶段快速返回校验错误而非挂起。)
|
|
10
10
|
4. **写入代码/数据** `delta-cli sandbox write <id> --source <文件名>` — 将本地文件直接写入 sandbox,**不传 `--path` 默认写到该 sandbox 的 working-directory**(`/workspace/{user_id}/{sandbox_id}/<文件名>`,在 OSS 同步范围内,kill 后文件不会丢)。写前可用 `delta-cli sandbox working-directory <id>` 确认路径。**必须**使用相对源路径(如 `--source infer.py`),禁止使用 `"$WORKSPACE_ROOT/<filename>"` 或 `$(pwd)/...`。相对 `--path` 也会拼到 working-directory 下;仅绝对 `--path` 原样使用(`/workspace/<filename>` 根路径不在 OSS 同步范围,不推荐)。也可用 `--data "..."` 写入少量内联内容(需显式 `--path`),`--mode 755` 可设置文件权限。写入后返回的 `size` 字段是 stat 验证后的实际磁盘字节数,可确认写入完整。批量写入用 `write-multiple`。文件路径和扩展名由镜像中的运行时决定。
|
|
11
11
|
5. **运行命令** — 先 `delta-cli sandbox working-directory <id>` 查询 `<wd>`,再根据镜像中的运行时构造命令,常见示例:`python <wd>/train.py`(Python)、`node <wd>/app.js`(Node.js)、`go run <wd>/main.go`(Go)、`bash <wd>/run.sh`(Shell)
|
|
12
12
|
- **短任务 ≤60s**:`delta-cli sandbox run <id> --command "<命令>" --timeout <秒>` 同步执行,SSE 原始 `data:` 帧透传到 stdout(无末尾信封),`exit_code`/`log_file` 从 `complete` 帧读取,完整 stdout 写入 log_file
|