2.1 KiB
2.1 KiB
TOOLS.md — 套件开发工具与资源
安装
gis-actions(CLI + 执行引擎)
curl -sLO https://packages.mercator.cn/public/gis-actions/latest.deb
sudo dpkg -i latest.deb
CLI 用法
# 执行套件
agc run <work_dir> --suite-id <suite-id> --input key=value
agc run <work_dir> --package-url <url> --input key=value
API 端点
| 用途 | 端点 |
|---|---|
| 浏览套件 | GET https://suites.mercator.cn/api/v1/suites |
| 套件详情 | GET https://suites.mercator.cn/api/v1/suites/{id} |
| 发布套件(文件上传) | POST https://suites.mercator.cn/publish/upload(需 Gitea Token) |
| 发布套件(Git 仓库) | POST https://suites.mercator.cn/publish(需 Gitea Token) |
| API 文档 | https://suites.mercator.cn/docs |
套件结构
my-suite/
├── workflow.yaml # 步骤定义(必填)
└── scripts/
└── run.py # 执行入口脚本
workflow.yaml 格式
name: 我的套件
description: 套件描述
version: 1.0.0
author: 作者
tags: [标签1, 标签2]
category: 业务分类
params:
input_path:
type: string
required: true
desc: 输入文件路径
base_image: gis-base:latest
steps:
- id: step1
name: 步骤名称
type: python
script_id: run
params:
input: $params.input_path
包命名规则
套件发布到 Gitea Packages 时,包名由套件名称自动生成 slug:
例:"土地整治竣工结算" → land-remediation-settlement
"Hello World" → hello-world
"Buffer Analysis" → buffer-analysis
slug 规则:转小写 → 非字母数字替换为连字符 → 合并连续连字符 → 去掉首尾连字符。
基础镜像
所有套件在 gis-base 镜像中执行,包含:Python 3.11, GDAL, Shapely, GeoPandas, numpy, openpyxl, xlrd
- 镜像名:
gis-base:latest - 来源:安装 gis-actions 时自动从 MinIO 下载(
docker load)
知识库
| 文件 | 内容 |
|---|---|
knowledge/data-execution-model.md |
数据执行模型(本地执行设计) |
文档
公开文档在 SuiteHub/agent-profiles 仓库中。