dma-cli 0.1.0__tar.gz → 0.1.1__tar.gz

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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dma-cli
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: DMA 任务提交命令行工具
5
5
  Requires-Python: >=3.8
6
6
  Description-Content-Type: text/markdown
@@ -9,11 +9,7 @@ Requires-Dist: pyyaml
9
9
 
10
10
  # DMA CLI —— 任务提交工具
11
11
 
12
- 深度挖掘(DMA,`https://szc.test.dp.tech`)网页外的命令行提交工具,用于提交单个或批量任务。
13
- 与压测无关,只借用压测脚本里已验证的接口形态,不改动任何压测内容。
14
-
15
- > **术语**:本工具的 `image`(镜像)即网页上的「软件目录」,底层接口为 `/softwares/deep-mining`,
16
- > snapshot 用 `softwareId`/`softwareVersionId`。容器镜像接口(image/public|private)不参与 job 提交,但 `image list` 合并展示供参考。
12
+ 深度挖掘算法(DMA)网页外的命令行提交工具,用于提交单个或批量任务。
17
13
 
18
14
  ## 安装
19
15
 
@@ -22,14 +18,6 @@ Requires-Dist: pyyaml
22
18
  pip install dma-cli
23
19
  dma --help
24
20
 
25
- # 从源码安装
26
- cd tools/dma-cli
27
- pip install .
28
-
29
- # 方式二:本地开发模式(可直接修改代码调试)
30
- cd tools/dma-cli
31
- pip install -e .
32
-
33
21
  # 安装后 dma 命令即可全局使用
34
22
  dma --help
35
23
  ```
@@ -64,7 +52,7 @@ cp config.example.yaml config.yaml
64
52
  base_url: https://szc.test.dp.tech
65
53
  auth:
66
54
  email: "" # 验证码登录邮箱(留空则必须填 token)
67
- captcha: "952754" # 固定验证码(测试环境)
55
+ captcha: "952754" # 验证码(测试环境)
68
56
  token: "" # 直接配 token(优先于 email 登录)
69
57
  uexid: "" # 留空从 JWT 自动解析为 fe_<userId>
70
58
  user_id: "" # 留空从 JWT 自动解析
@@ -175,7 +163,6 @@ dma job submit \
175
163
  | `--machine_type` | `-t` | 机器类型名(自动匹配) |
176
164
  | `--command` | `-c` | 执行命令 |
177
165
  | `--max_run_time` | — | 最大运行时间(分钟) |
178
- | `--nnode` | — | 节点数 |
179
166
  | `--count` | — | 批量提交任务数 |
180
167
  | `--concurrency` | — | 批量并发数 |
181
168
  | `--batch_file` | — | 批量任务 JSON 数组文件 |
@@ -191,7 +178,8 @@ dma job submit \
191
178
  dma job submit \
192
179
  --machine_type c2_m2_cpu \
193
180
  --image_address ubuntu:22.04-py3.10-terminal-20260916 \
194
- --count 10 \
181
+ --command "python calc.py" \
182
+ --count 5 \
195
183
  --concurrency 5
196
184
  ```
197
185
 
@@ -215,6 +203,7 @@ dma job submit \
215
203
  --batch_input_dir ./inputs \
216
204
  --machine_type c2_m2_cpu \
217
205
  --image_address ubuntu:22.04-py3.10-terminal-20260916 \
206
+ --command "python calc.py" \
218
207
  --concurrency 5
219
208
  ```
220
209
 
@@ -242,28 +231,3 @@ dma job submit -i job.example.json
242
231
  # 6. 批量提交
243
232
  dma job submit --batch_file batch.json
244
233
  ```
245
-
246
- ## 文件结构
247
-
248
- ```
249
- tools/dma-cli/
250
- ├── README.md # 本文档
251
- ├── pyproject.toml # 打包配置
252
- ├── requirements.txt # requests, pyyaml
253
- ├── config.example.yaml # 配置模板
254
- ├── job.example.json # 任务配置示例
255
- ├── batch.example.json # 批量任务示例
256
- └── dma_cli/ # Python 包目录
257
- ├── __init__.py
258
- ├── cli.py # 命令行入口
259
- ├── client.py # API 客户端
260
- ├── state.py # 状态管理
261
- ├── resources.py # 资源查询
262
- ├── submit.py # 任务提交
263
- └── calc.py # 默认任务脚本
264
- ```
265
-
266
- ## 不在范围
267
-
268
- - 不做多用户 / 不改压测脚本
269
- - 不做分布式压测
@@ -1,10 +1,6 @@
1
1
  # DMA CLI —— 任务提交工具
2
2
 
3
- 深度挖掘(DMA,`https://szc.test.dp.tech`)网页外的命令行提交工具,用于提交单个或批量任务。
4
- 与压测无关,只借用压测脚本里已验证的接口形态,不改动任何压测内容。
5
-
6
- > **术语**:本工具的 `image`(镜像)即网页上的「软件目录」,底层接口为 `/softwares/deep-mining`,
7
- > snapshot 用 `softwareId`/`softwareVersionId`。容器镜像接口(image/public|private)不参与 job 提交,但 `image list` 合并展示供参考。
3
+ 深度挖掘算法(DMA)网页外的命令行提交工具,用于提交单个或批量任务。
8
4
 
9
5
  ## 安装
10
6
 
@@ -13,14 +9,6 @@
13
9
  pip install dma-cli
14
10
  dma --help
15
11
 
16
- # 从源码安装
17
- cd tools/dma-cli
18
- pip install .
19
-
20
- # 方式二:本地开发模式(可直接修改代码调试)
21
- cd tools/dma-cli
22
- pip install -e .
23
-
24
12
  # 安装后 dma 命令即可全局使用
25
13
  dma --help
26
14
  ```
@@ -55,7 +43,7 @@ cp config.example.yaml config.yaml
55
43
  base_url: https://szc.test.dp.tech
56
44
  auth:
57
45
  email: "" # 验证码登录邮箱(留空则必须填 token)
58
- captcha: "952754" # 固定验证码(测试环境)
46
+ captcha: "952754" # 验证码(测试环境)
59
47
  token: "" # 直接配 token(优先于 email 登录)
60
48
  uexid: "" # 留空从 JWT 自动解析为 fe_<userId>
61
49
  user_id: "" # 留空从 JWT 自动解析
@@ -166,7 +154,6 @@ dma job submit \
166
154
  | `--machine_type` | `-t` | 机器类型名(自动匹配) |
167
155
  | `--command` | `-c` | 执行命令 |
168
156
  | `--max_run_time` | — | 最大运行时间(分钟) |
169
- | `--nnode` | — | 节点数 |
170
157
  | `--count` | — | 批量提交任务数 |
171
158
  | `--concurrency` | — | 批量并发数 |
172
159
  | `--batch_file` | — | 批量任务 JSON 数组文件 |
@@ -182,7 +169,8 @@ dma job submit \
182
169
  dma job submit \
183
170
  --machine_type c2_m2_cpu \
184
171
  --image_address ubuntu:22.04-py3.10-terminal-20260916 \
185
- --count 10 \
172
+ --command "python calc.py" \
173
+ --count 5 \
186
174
  --concurrency 5
187
175
  ```
188
176
 
@@ -206,6 +194,7 @@ dma job submit \
206
194
  --batch_input_dir ./inputs \
207
195
  --machine_type c2_m2_cpu \
208
196
  --image_address ubuntu:22.04-py3.10-terminal-20260916 \
197
+ --command "python calc.py" \
209
198
  --concurrency 5
210
199
  ```
211
200
 
@@ -233,28 +222,3 @@ dma job submit -i job.example.json
233
222
  # 6. 批量提交
234
223
  dma job submit --batch_file batch.json
235
224
  ```
236
-
237
- ## 文件结构
238
-
239
- ```
240
- tools/dma-cli/
241
- ├── README.md # 本文档
242
- ├── pyproject.toml # 打包配置
243
- ├── requirements.txt # requests, pyyaml
244
- ├── config.example.yaml # 配置模板
245
- ├── job.example.json # 任务配置示例
246
- ├── batch.example.json # 批量任务示例
247
- └── dma_cli/ # Python 包目录
248
- ├── __init__.py
249
- ├── cli.py # 命令行入口
250
- ├── client.py # API 客户端
251
- ├── state.py # 状态管理
252
- ├── resources.py # 资源查询
253
- ├── submit.py # 任务提交
254
- └── calc.py # 默认任务脚本
255
- ```
256
-
257
- ## 不在范围
258
-
259
- - 不做多用户 / 不改压测脚本
260
- - 不做分布式压测
@@ -1,3 +1,3 @@
1
1
  """DMA CLI —— 任务提交命令行工具"""
2
2
 
3
- __version__ = "0.1.0"
3
+ __version__ = "0.1.1"
@@ -407,7 +407,7 @@ def handle_submit(client, args):
407
407
  json_config = json_config["_batch_data"][0] if json_config["_batch_data"] else {}
408
408
 
409
409
  # 映射 JSON 字段到 overrides
410
- if json_config.get("project_id"):
410
+ if json_config.get("project_id") is not None and json_config.get("project_id") != 0:
411
411
  overrides["project_id"] = json_config["project_id"]
412
412
  if json_config.get("job_name"):
413
413
  args.job_name = json_config["job_name"]
@@ -435,7 +435,7 @@ def handle_submit(client, args):
435
435
  overrides["dataset_path"] = json_config["dataset_path"]
436
436
 
437
437
  # CLI 参数覆盖 JSON 配置
438
- if args.project_id:
438
+ if args.project_id is not None and args.project_id != 0:
439
439
  overrides["project_id"] = args.project_id
440
440
  if args.machine_type:
441
441
  overrides["machine_type"] = args.machine_type
@@ -542,8 +542,12 @@ def handle_submit(client, args):
542
542
  for key in ["project_id", "job_name", "machine_type", "image_address", "command",
543
543
  "input_directory", "max_run_time", "max_reschedule_times", "nnode",
544
544
  "log_file", "out_files", "result_path", "dataset_path"]:
545
- if config.get(key):
546
- item_overrides[key] = config[key]
545
+ val = config.get(key)
546
+ if val is not None:
547
+ # 如果 project_id 显式为 0,则应使用默认当前项目
548
+ if key == "project_id" and val == 0:
549
+ continue
550
+ item_overrides[key] = val
547
551
 
548
552
  # 自动查找
549
553
  if item_overrides.get("machine_type"):
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: dma-cli
3
- Version: 0.1.0
3
+ Version: 0.1.1
4
4
  Summary: DMA 任务提交命令行工具
5
5
  Requires-Python: >=3.8
6
6
  Description-Content-Type: text/markdown
@@ -9,11 +9,7 @@ Requires-Dist: pyyaml
9
9
 
10
10
  # DMA CLI —— 任务提交工具
11
11
 
12
- 深度挖掘(DMA,`https://szc.test.dp.tech`)网页外的命令行提交工具,用于提交单个或批量任务。
13
- 与压测无关,只借用压测脚本里已验证的接口形态,不改动任何压测内容。
14
-
15
- > **术语**:本工具的 `image`(镜像)即网页上的「软件目录」,底层接口为 `/softwares/deep-mining`,
16
- > snapshot 用 `softwareId`/`softwareVersionId`。容器镜像接口(image/public|private)不参与 job 提交,但 `image list` 合并展示供参考。
12
+ 深度挖掘算法(DMA)网页外的命令行提交工具,用于提交单个或批量任务。
17
13
 
18
14
  ## 安装
19
15
 
@@ -22,14 +18,6 @@ Requires-Dist: pyyaml
22
18
  pip install dma-cli
23
19
  dma --help
24
20
 
25
- # 从源码安装
26
- cd tools/dma-cli
27
- pip install .
28
-
29
- # 方式二:本地开发模式(可直接修改代码调试)
30
- cd tools/dma-cli
31
- pip install -e .
32
-
33
21
  # 安装后 dma 命令即可全局使用
34
22
  dma --help
35
23
  ```
@@ -64,7 +52,7 @@ cp config.example.yaml config.yaml
64
52
  base_url: https://szc.test.dp.tech
65
53
  auth:
66
54
  email: "" # 验证码登录邮箱(留空则必须填 token)
67
- captcha: "952754" # 固定验证码(测试环境)
55
+ captcha: "952754" # 验证码(测试环境)
68
56
  token: "" # 直接配 token(优先于 email 登录)
69
57
  uexid: "" # 留空从 JWT 自动解析为 fe_<userId>
70
58
  user_id: "" # 留空从 JWT 自动解析
@@ -175,7 +163,6 @@ dma job submit \
175
163
  | `--machine_type` | `-t` | 机器类型名(自动匹配) |
176
164
  | `--command` | `-c` | 执行命令 |
177
165
  | `--max_run_time` | — | 最大运行时间(分钟) |
178
- | `--nnode` | — | 节点数 |
179
166
  | `--count` | — | 批量提交任务数 |
180
167
  | `--concurrency` | — | 批量并发数 |
181
168
  | `--batch_file` | — | 批量任务 JSON 数组文件 |
@@ -191,7 +178,8 @@ dma job submit \
191
178
  dma job submit \
192
179
  --machine_type c2_m2_cpu \
193
180
  --image_address ubuntu:22.04-py3.10-terminal-20260916 \
194
- --count 10 \
181
+ --command "python calc.py" \
182
+ --count 5 \
195
183
  --concurrency 5
196
184
  ```
197
185
 
@@ -215,6 +203,7 @@ dma job submit \
215
203
  --batch_input_dir ./inputs \
216
204
  --machine_type c2_m2_cpu \
217
205
  --image_address ubuntu:22.04-py3.10-terminal-20260916 \
206
+ --command "python calc.py" \
218
207
  --concurrency 5
219
208
  ```
220
209
 
@@ -242,28 +231,3 @@ dma job submit -i job.example.json
242
231
  # 6. 批量提交
243
232
  dma job submit --batch_file batch.json
244
233
  ```
245
-
246
- ## 文件结构
247
-
248
- ```
249
- tools/dma-cli/
250
- ├── README.md # 本文档
251
- ├── pyproject.toml # 打包配置
252
- ├── requirements.txt # requests, pyyaml
253
- ├── config.example.yaml # 配置模板
254
- ├── job.example.json # 任务配置示例
255
- ├── batch.example.json # 批量任务示例
256
- └── dma_cli/ # Python 包目录
257
- ├── __init__.py
258
- ├── cli.py # 命令行入口
259
- ├── client.py # API 客户端
260
- ├── state.py # 状态管理
261
- ├── resources.py # 资源查询
262
- ├── submit.py # 任务提交
263
- └── calc.py # 默认任务脚本
264
- ```
265
-
266
- ## 不在范围
267
-
268
- - 不做多用户 / 不改压测脚本
269
- - 不做分布式压测
@@ -1,5 +1,5 @@
1
1
  {
2
- "project_id": 3948,
2
+ "project_id": 0,
3
3
  "job_name": "cli-job-001",
4
4
  "image_address": "ubuntu:22.04-py3.10-terminal-20260916",
5
5
  "machine_type": "c2_m2_cpu",
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "dma-cli"
7
- version = "0.1.0"
7
+ version = "0.1.1"
8
8
  description = "DMA 任务提交命令行工具"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.8"
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes