@delta-infra/cli 1.0.8 → 1.0.10

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
@@ -100,7 +100,7 @@ delta-cli config init \
100
100
 
101
101
  # 通过环境变量
102
102
  export DELTA_INFRA_BASE_URL=http://your-server/api/v1
103
- export DELTA_SANDBOX_TOKEN=your-token
103
+ export DELTA_INFRA_TOKEN=your-token
104
104
  delta-cli config init
105
105
  ```
106
106
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@delta-infra/cli",
3
- "version": "1.0.8",
3
+ "version": "1.0.10",
4
4
  "description": "Delta Sandbox CLI",
5
5
  "bin": {
6
6
  "delta-cli": "scripts/run.js"
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: delta-sandbox
3
- version: 1.0.0
3
+ version: 1.0.10
4
4
  description: "通过 Delta Sandbox HTTP API 运行 GPU/CPU 计算任务。适用于训练、微调、CUDA/PyTorch 推理等场景。认证/配置/权限错误转 delta-shared。"
5
5
  metadata:
6
6
  requires:
@@ -44,7 +44,7 @@ metadata:
44
44
  | 查看状态 | `sandbox status <id>` |
45
45
  | 同步运行命令 | `sandbox run <id> --command "..."` |
46
46
  | 后台运行命令 | `sandbox run-bg <id> --command "..."` |
47
- | 查看日志 | `sandbox logs <id> --execution-id <exec_id>` |
47
+ | 查看后台日志 | `sandbox logs <id> --execution-id <exec_id>`(仅用于 `run-bg`) |
48
48
  | 读取文件 | `sandbox read <id> --path <path>` |
49
49
  | 写入文件 | `sandbox write <id> --path <path> --data "..."` |
50
50
  | 完成 sandbox | `sandbox finish <id> --results '{...}'` |
@@ -57,6 +57,7 @@ metadata:
57
57
  - 这是 `sandbox create` 支持的完整资源参数集合,不存在其它“更正确”的资源 flag,不要 invented 不存在的参数。
58
58
  3. **写入代码**:`delta-cli sandbox write <id> --path /workspace/train.py --data "..."`
59
59
  4. **运行**:`delta-cli sandbox run <id> --command "python /workspace/train.py" --timeout 3600`
60
+ - `sandbox run` 是同步执行,结果(`stdout` / `stderr` / `exit_code`)会直接返回,**不要**再调用 `sandbox logs`
60
61
  5. **读取结果**:`delta-cli sandbox read <id> --path /workspace/result.json`
61
62
  6. **销毁**:`delta-cli sandbox kill <id>`(如需保存结果,用 `sandbox finish --results '{...}'` 替代 kill,finish 会自动销毁 sandbox)
62
63
 
@@ -11,8 +11,8 @@
11
11
  | `sandbox kill` | 直接销毁 sandbox,不保存结果(有结果要保存时用 finish 替代) |
12
12
  | `sandbox finish` | 保存结果后自动销毁 sandbox(二选一:finish 或 kill,不要同时调用) |
13
13
  | `sandbox status` | 查看状态 |
14
- | `sandbox run` | 同步运行命令 |
14
+ | `sandbox run` | 同步运行命令,结果直接返回 |
15
15
  | `sandbox run-bg` | 后台运行命令 |
16
- | `sandbox logs` | 获取日志 |
16
+ | `sandbox logs` | 获取后台命令日志(仅配合 `run-bg`) |
17
17
  | `sandbox read` | 读取文件 |
18
18
  | `sandbox write` | 写入文件 |
@@ -9,14 +9,17 @@
9
9
  3. **创建** `delta-cli sandbox create --image <image> --cpu 4 --memory 16Gi --gpu 1 --gpu-mem 8000`(创建后立即可用,无需连接;这些是 `create` 全部资源参数,不要 invented 其它 flag)
10
10
  4. **写入代码/数据** `delta-cli sandbox write <id> --path /workspace/train.py --data "..."`
11
11
  5. **运行命令** `delta-cli sandbox run <id> --command "python /workspace/train.py"`
12
+ - `sandbox run` 是同步执行,返回结果里直接包含 `stdout`、`stderr`、`exit_code`,**不要**再调 `sandbox logs`
12
13
  6. **读取结果** `delta-cli sandbox read <id> --path /workspace/result.json`
13
14
  7. **销毁** `delta-cli sandbox kill <id>`(如需保存结果用 finish,finish 会自动销毁)
14
15
 
15
16
  ## 后台任务
16
17
 
17
- 对于长时间运行的训练:
18
+ 对于长时间运行的训练,才使用 `run-bg` + `logs`:
18
19
 
19
20
  ```bash
20
21
  delta-cli sandbox run-bg <id> --command "python train.py" --timeout 3600
21
22
  delta-cli sandbox logs <id> --execution-id <exec_id>
22
23
  ```
24
+
25
+ **注意**:`sandbox logs` 只应配合 `sandbox run-bg` 使用;同步 `sandbox run` 的结果直接返回,不能也不应该调用 `logs`。
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: delta-shared
3
- version: 1.0.8
3
+ version: 1.0.9
4
4
  description: "delta-cli 全局共享规则:配置/认证检查、安全红线、错误处理、sandbox 销毁。"
5
5
  ---
6
6
 
@@ -34,7 +34,7 @@ delta-cli config init --base-url <server-url> --token <token>
34
34
 
35
35
  ### 信息来源优先级
36
36
 
37
- 1. 环境变量:`DELTA_INFRA_BASE_URL`、`DELTA_SANDBOX_TOKEN`
37
+ 1. 环境变量:`DELTA_INFRA_BASE_URL`、`DELTA_INFRA_TOKEN`
38
38
  2. `~/.delta-infra/config.json` 中的 `base_url` / `token`
39
39
  3. 默认值:仅 `base_url` 有内部默认值
40
40
  4. 以上都缺失时,**必须询问用户**,禁止虚构