fix: 清除 suite-developer 文件中的平台内部引用
This commit is contained in:
+21
-59
@@ -1,12 +1,11 @@
|
||||
# MEMORY.md — 套件开发者长期记忆
|
||||
|
||||
## 平台关键信息
|
||||
## 平台入口
|
||||
|
||||
- **套件市场:** https://suites.mercator.cn(浏览和发现套件)
|
||||
- **API 基础地址:** https://suites.mercator.cn
|
||||
- **认证中心:** https://auth.mercator.cn(获取 API Key)
|
||||
- **基础镜像:** `registry.mercator.cn/agentgis/gis-base:latest`
|
||||
- **API:** https://suites.mercator.cn
|
||||
- **API Key 获取:** https://auth.mercator.cn
|
||||
- **API 文档:** https://suites.mercator.cn/docs
|
||||
- **基础镜像:** `registry.mercator.cn/agentgis/gis-base:latest`
|
||||
|
||||
## Workflow.yaml 核心规则
|
||||
|
||||
@@ -14,70 +13,33 @@
|
||||
|
||||
```yaml
|
||||
steps:
|
||||
- id: my-step # 步骤 ID
|
||||
name: 我的步骤 # 步骤名称
|
||||
script_id: run # ✅ 正确:script_id: run
|
||||
# ❌ 错误:script: run.py
|
||||
- id: my-step
|
||||
name: 我的步骤
|
||||
script_id: run # ✅ script_id: run,不是 script: run.py
|
||||
params:
|
||||
input_path: "${{inputs.input_path}}" # ✅ 双花括号
|
||||
# ❌ $inputs.input_path
|
||||
input: "${{inputs.input_path}}" # ✅ 双花括号
|
||||
```
|
||||
|
||||
### 参数引用
|
||||
### 常见错误
|
||||
|
||||
| 语法 | 说明 |
|
||||
|------|------|
|
||||
| `${{inputs.xxx}}` | 引用套件输入参数 |
|
||||
| `${{steps.step_id.output_key}}` | 引用前序步骤的输出 |
|
||||
| ❌ 错误 | ✅ 正确 |
|
||||
|---------|--------|
|
||||
| `script: run.py` | `script_id: run` |
|
||||
| `params_mapping: {...}` | `params: {...}` |
|
||||
| `$inputs.xxx` | `${{inputs.xxx}}` |
|
||||
|
||||
### resovled_params
|
||||
### 跨步骤文件共享
|
||||
|
||||
必须在 `resolved_params` 中提供参数默认值:
|
||||
所有步骤共享 `/tmp/output` 目录。Step 1 写入的文件,Step 2 可以直接读取。
|
||||
|
||||
```yaml
|
||||
resolved_params:
|
||||
- step_index: 0
|
||||
step_name: 我的步骤
|
||||
params:
|
||||
input_path: "/data/input.shp"
|
||||
```
|
||||
## 发布流程
|
||||
|
||||
### 文件共享
|
||||
|
||||
所有 steps 共享 `/tmp/output` 目录。Step 1 写入的文件 Step 2 可以直接读取。
|
||||
每个步骤也有独立的 `/tmp/step_output` 目录。
|
||||
|
||||
### 输出规范
|
||||
|
||||
脚本通过 stdout 输出 JSON,格式如下:
|
||||
|
||||
```python
|
||||
result = {"status": "ok", "output_path": "/tmp/output/result.geojson"}
|
||||
print(json.dumps(result))
|
||||
```
|
||||
`agc publish` 一键完成:打包 → 上传 → 注册 Skill → 注册 Suite。
|
||||
|
||||
## 执行环境
|
||||
|
||||
- 每个任务跑在独立 Docker 容器中,用完即销毁
|
||||
- 容器使用 gis-base 镜像(含 GDAL / Shapely / GeoPandas)
|
||||
- 容器使用 gis-base 镜像
|
||||
- 脚本目录挂载到 `/tmp/scripts`(只读)
|
||||
- 工作目录挂载到 `/tmp/output`(读写,步骤间共享)
|
||||
- 参数通过 `/tmp/params.json` 文件传入
|
||||
|
||||
## 发布流程
|
||||
|
||||
推荐使用 `agc publish` 一键发布。内部流程:
|
||||
1. 打包 workflow.yaml + scripts/ 为 tar.gz
|
||||
2. 上传到平台包存储
|
||||
3. 注册 Skill(可供执行)
|
||||
4. (可选)注册 Suite(在市场中展示)
|
||||
|
||||
## 合规检测
|
||||
|
||||
发布时会自动检测:
|
||||
- workflow.yaml 格式是否正确
|
||||
- 引用的脚本是否存在
|
||||
- 参数类型是否匹配
|
||||
- 是否有循环依赖
|
||||
|
||||
不通过则发布失败,返回具体错误信息。
|
||||
- 工作目录 `/tmp/output`(步骤间共享)
|
||||
- 参数通过 `/tmp/params.json` 传入
|
||||
|
||||
Reference in New Issue
Block a user