@delta-infra/cli 1.0.40 → 1.0.41
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/checksums.txt
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
88c2594af0fa0e800a22c84a104df746cf68db36208551e00af5a113329d355f delta-cli-darwin-amd64.tar.gz
|
|
2
|
+
2aec4ac96fb4bbc17aad0af625d00130cbeed69348373fa041f01f37fb6a7ef2 delta-cli-darwin-arm64.tar.gz
|
|
3
|
+
4a119af2d747e0f833a69ec18c3bb240c54ed7c566458ba198f7ed120fcb98e1 delta-cli-linux-amd64.tar.gz
|
|
4
|
+
6fa695bff9884698f831d01f91d3bc5b9456423eeec09bd7d3077e4cff247189 delta-cli-linux-arm64.tar.gz
|
|
5
|
+
2eec78a6462d116f97237f45892e79c29b149d0538cce4ea346e51ff979c5f97 delta-cli-windows-amd64.zip
|
package/package.json
CHANGED
|
@@ -118,13 +118,13 @@ metadata:
|
|
|
118
118
|
- 支持嵌套目录,空目录也会被创建。
|
|
119
119
|
- **写后验证**:`sandbox stat <id> --path <path>` 确认文件存在且 size 符合预期;`sandbox read <id> --path <path>` 读取内容并对比返回的 `size`(磁盘字节)和 `content_length`(字符长度)判断是否有编码偏差。
|
|
120
120
|
4. **运行命令**:
|
|
121
|
-
|
|
121
|
+
- **短任务(预计 ≤ 60 秒)**:`delta-cli sandbox run <id> --command "<命令>" --timeout <秒>` 同步执行,返回 `stderr` / `exit_code` / `result_file`,完整 `stdout` 在结果文件中,**不要**再调用 `sandbox logs`。可通过 `--result-file <路径>` 自定义结果文件路径;默认值为 `/tmp/delta-result-{execution_id}.json`。根据镜像中的运行时构造命令,常见示例:
|
|
122
122
|
- Python:`python /workspace/train.py`
|
|
123
123
|
- Node.js:`node /workspace/app.js`
|
|
124
124
|
- Go:`go run /workspace/main.go`
|
|
125
125
|
- Shell:`bash /workspace/run.sh`
|
|
126
|
-
- **长任务(预计 > 60 秒,如下载模型、训练、编译、大规模数据处理)**:`delta-cli sandbox run-bg <id> --command "<命令>" --timeout
|
|
127
|
-
|
|
126
|
+
- **长任务(预计 > 60 秒,如下载模型、训练、编译、大规模数据处理)**:`delta-cli sandbox run-bg <id> --command "<命令>" --timeout <秒> [--result-file <路径>]` 提交后台任务,获得 `execution_id` 后通过以下命令轮询:
|
|
127
|
+
- `delta-cli sandbox logs <id> --execution-id <execution_id>` — 返回 `cursor`、`running`、`finished`、`exit_code`、`result_file`(完成后)。当 `finished=true` 时认为完成,完整输出需读取 `result_file`。
|
|
128
128
|
- `delta-cli sandbox status bg <id> --execution-id <execution_id>` — 返回 `running`、`finished`、`exit_code`。
|
|
129
129
|
禁止对长任务使用同步 `sandbox run`
|
|
130
130
|
5. **读取结果**:`delta-cli sandbox read <id> --path /workspace/result.json` — 返回 `content`(内容)、`size`(磁盘字节数,来自 stat 验证)、`content_length`(内存字符长度)。对比 `size` 与 `content_length` 可判断文件是否为纯文本。读不存在的文件会返回 error,不会静默返回空内容。
|
|
@@ -132,6 +132,17 @@ metadata:
|
|
|
132
132
|
|
|
133
133
|
详细步骤见 [lifecycle.md](references/lifecycle.md)。
|
|
134
134
|
|
|
135
|
+
## 输出阅读与最终回答格式
|
|
136
|
+
|
|
137
|
+
1. **`sandbox run` / `sandbox run-bg --wait` / `sandbox logs` 返回的 JSON 中包含 `data.result_file`**(沙箱内结构化结果文件的路径)。
|
|
138
|
+
2. **只要 `data.result_file` 存在,必须优先使用 `delta-cli sandbox read <id> --path <result_file>` 读取该文件。**
|
|
139
|
+
- 结果文件包含完整 `stdout`、`stderr`、`exit_code`、`finished`、`command`、`error`。
|
|
140
|
+
3. **基于结果文件内容给出最终结论**,开头用 `RESULT:`,例如:
|
|
141
|
+
```
|
|
142
|
+
RESULT: exit_code=0, CUDA available=True, GPU=NVIDIA H100 80GB HBM3, tensor addition on cuda:0 succeeded.
|
|
143
|
+
```
|
|
144
|
+
4. **不要依赖或被截断的 `stdout`/`stderr` 字段**,关键结论必须来自读取结果文件后的分析。
|
|
145
|
+
|
|
135
146
|
## 常见恢复
|
|
136
147
|
|
|
137
148
|
| 错误 / 现象 | 恢复动作 |
|
|
@@ -25,9 +25,9 @@
|
|
|
25
25
|
|
|
26
26
|
| 命令 | 说明 |
|
|
27
27
|
|------|------|
|
|
28
|
-
| `sandbox run <id> --command "..." [--timeout N]` |
|
|
29
|
-
| `sandbox run-bg <id> --command "..." [--timeout N] [--wait]` |
|
|
30
|
-
| `sandbox logs <id> --execution-id <eid>` |
|
|
28
|
+
| `sandbox run <id> --command "..." [--timeout N]` | 同步运行命令;返回 stderr/exit_code/result_file(完整 stdout 在结果文件中) |
|
|
29
|
+
| `sandbox run-bg <id> --command "..." [--timeout N] [--wait]` | 后台运行命令;--wait 完成后返回状态与 result_file |
|
|
30
|
+
| `sandbox logs <id> --execution-id <eid>` | 获取后台命令日志;返回 cursor/exit_code/result_file |
|
|
31
31
|
| `sandbox status bg <id> --execution-id <eid>` | 查询后台命令状态(不含日志内容) |
|
|
32
32
|
| `sandbox cancel <id> --execution-id <eid>` | 中断正在运行的后台命令 |
|
|
33
33
|
|