docs: 更新 TOOLS.md 适配 gis-actions v2.0.14(本地执行模型 + cli.py 用法)
This commit is contained in:
+45
-45
@@ -6,60 +6,53 @@ https://suites.mercator.cn
|
|||||||
|
|
||||||
浏览套件、查看详情。
|
浏览套件、查看详情。
|
||||||
|
|
||||||
## CLI 安装
|
## CLI 安装(gis-actions 本地执行器)
|
||||||
|
|
||||||
|
所有套件在你的机器上通过 Docker 本地执行,数据不上云。
|
||||||
|
|
||||||
|
安装 gis-actions 包即可获得 CLI + worker:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 安装 agentgis-cli v0.2.0
|
# 下载
|
||||||
pip install https://git.mercator.cn/api/packages/SuiteHub/generic/agentgis-cli/0.2.0/agentgis_cli-0.2.0.tar.gz
|
curl -OJ https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/2.0.14/gis-actions_2.0.14_all.deb
|
||||||
|
|
||||||
# 配置 API Key
|
# 安装
|
||||||
agc config set api-key mk_xxxxxxxxx
|
sudo dpkg -i gis-actions_2.0.14_all.deb
|
||||||
|
|
||||||
# 查看套件列表
|
# 登录 Docker Registry(拉取 gis-base 镜像)
|
||||||
agc suites list
|
docker login registry.mercator.cn
|
||||||
```
|
```
|
||||||
|
|
||||||
## 本地执行环境
|
## 前提条件
|
||||||
|
|
||||||
所有套件在 **你自己的机器上** 通过 Docker 执行,数据不上云。
|
- Linux 系统(Debian / Ubuntu)
|
||||||
|
- Docker(验证:`docker ps`)
|
||||||
|
- 能访问 `registry.mercator.cn`
|
||||||
|
|
||||||
### 前提条件
|
## 执行套件
|
||||||
|
|
||||||
- **Linux 系统**(Debian / Ubuntu)
|
|
||||||
- **Docker**(验证:`docker ps`)
|
|
||||||
- `sudo apt install docker.io`
|
|
||||||
- 能访问 `registry.mercator.cn`(拉取 gis-base 镜像)
|
|
||||||
|
|
||||||
### 安装本地执行器
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# 安装 gis-actions
|
SUITE_MARKET_URL="https://suites.mercator.cn" \
|
||||||
curl -OJ https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/2.0.8/gis-actions_2.0.8_all.deb
|
python3 /usr/share/gis-actions/cli.py run /tmp/work-output \
|
||||||
sudo dpkg -i gis-actions_2.0.8_all.deb
|
--suite-id <suite-id> \
|
||||||
|
--input bid_xls=/path/to/bid.xls \
|
||||||
# 配置 Docker Registry 认证
|
--input points_shp=/path/to/points.shp
|
||||||
echo "agw_readonly_2026" | docker login registry.mercator.cn -u agentgis-worker --password-stdin
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### 执行套件
|
- `<suite-id>` 从 Suite Market 界面获取
|
||||||
|
- 输入文件路径用本地绝对路径,shapefile 只需传 .shp 路径,配套文件自动复制
|
||||||
|
- 支持 `--input key=value` 多参数传递
|
||||||
|
|
||||||
```bash
|
## 数据流向
|
||||||
agc run <suite-id> --inputs '{"input_path": "/data/myfile.shp"}' --wait --poll 5
|
|
||||||
```
|
|
||||||
|
|
||||||
- `<suite-id>` 从 `agc suites list` 获取
|
|
||||||
- 输入文件路径用你的本地绝对路径
|
|
||||||
- `--wait` 等待执行完成,`--poll 5` 每 5 秒轮询结果
|
|
||||||
|
|
||||||
### 数据流向
|
|
||||||
|
|
||||||
```
|
```
|
||||||
你本地的 SHP/GeoJSON/TIFF/XLS 文件
|
你本地的 SHP/XLS 文件
|
||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
gis-actions(你的机器)
|
cli.py(你的机器)
|
||||||
│ ← 从市场下载套件脚本包
|
│ ← 从市场下载套件脚本包
|
||||||
│ ← docker run gis-base + 套件脚本
|
│ ← 复制输入文件到工作目录
|
||||||
|
│ → docker run gis-base + 套件脚本
|
||||||
│ → 结果写入 /tmp/output/
|
│ → 结果写入 /tmp/output/
|
||||||
▼
|
▼
|
||||||
结果文件(你的机器)
|
结果文件(你的机器)
|
||||||
@@ -76,16 +69,23 @@ journalctl -u gis-actions -f
|
|||||||
|
|
||||||
# 停止
|
# 停止
|
||||||
sudo systemctl stop gis-actions
|
sudo systemctl stop gis-actions
|
||||||
|
|
||||||
# 卸载
|
|
||||||
sudo dpkg --purge gis-actions
|
|
||||||
```
|
```
|
||||||
|
|
||||||
## 已知限制
|
## 快速上手(使用测试文件)
|
||||||
|
|
||||||
| 问题 | 说明 |
|
```bash
|
||||||
|------|------|
|
SUITE_MARKET_URL="https://suites.mercator.cn" \
|
||||||
| 输入文件 | shapefile 需传入目录路径而非单文件路径(因 .dbf/.shx 配套文件) |
|
python3 /usr/share/gis-actions/cli.py run /tmp/my-output \
|
||||||
| 模板文件 | 含 Excel 模板的套件需确保 templates/ 目录随脚本包一起发布 |
|
--suite-id 2c99a1cb-84a5-42dd-9147-1c8e8f7f2941 \
|
||||||
|
--input bid_xls=/path/to/标段清单.xls \
|
||||||
|
--input points_shp=/path/to/点状工程.shp \
|
||||||
|
--input lines_shp=/path/to/线性工程.shp \
|
||||||
|
--input polygons_shp=/path/to/面状工程.shp
|
||||||
|
```
|
||||||
|
|
||||||
详见 https://git.mercator.cn/SuiteHub/agent-profiles/issues/6
|
## 注意事项
|
||||||
|
|
||||||
|
1. 先安装 gis-actions(含 cli.py)
|
||||||
|
2. `docker login registry.mercator.cn` 确保能拉镜像
|
||||||
|
3. 从 Suite Market 获取 suite id
|
||||||
|
4. 执行:`python3 /usr/share/gis-actions/cli.py run ... --input key=value`
|
||||||
|
|||||||
Reference in New Issue
Block a user