From 6d0d8df8082891cd977f8cbc4943645879f8bff7 Mon Sep 17 00:00:00 2001 From: Huawei Date: Mon, 13 Jul 2026 07:09:10 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=9B=B4=E6=96=B0=20TOOLS.md=20?= =?UTF-8?q?=E9=80=82=E9=85=8D=20gis-actions=20v2.0.14=EF=BC=88=E6=9C=AC?= =?UTF-8?q?=E5=9C=B0=E6=89=A7=E8=A1=8C=E6=A8=A1=E5=9E=8B=20+=20cli.py=20?= =?UTF-8?q?=E7=94=A8=E6=B3=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- suite-user/TOOLS.md | 90 ++++++++++++++++++++++----------------------- 1 file changed, 45 insertions(+), 45 deletions(-) diff --git a/suite-user/TOOLS.md b/suite-user/TOOLS.md index 3573c73..e450c53 100644 --- a/suite-user/TOOLS.md +++ b/suite-user/TOOLS.md @@ -6,60 +6,53 @@ https://suites.mercator.cn 浏览套件、查看详情。 -## CLI 安装 +## CLI 安装(gis-actions 本地执行器) + +所有套件在你的机器上通过 Docker 本地执行,数据不上云。 + +安装 gis-actions 包即可获得 CLI + worker: ```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 -# 查看套件列表 -agc suites list +# 登录 Docker Registry(拉取 gis-base 镜像) +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 -# 安装 gis-actions -curl -OJ https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/2.0.8/gis-actions_2.0.8_all.deb -sudo dpkg -i gis-actions_2.0.8_all.deb - -# 配置 Docker Registry 认证 -echo "agw_readonly_2026" | docker login registry.mercator.cn -u agentgis-worker --password-stdin +SUITE_MARKET_URL="https://suites.mercator.cn" \ +python3 /usr/share/gis-actions/cli.py run /tmp/work-output \ + --suite-id \ + --input bid_xls=/path/to/bid.xls \ + --input points_shp=/path/to/points.shp ``` -### 执行套件 +- `` 从 Suite Market 界面获取 +- 输入文件路径用本地绝对路径,shapefile 只需传 .shp 路径,配套文件自动复制 +- 支持 `--input key=value` 多参数传递 -```bash -agc run --inputs '{"input_path": "/data/myfile.shp"}' --wait --poll 5 -``` - -- `` 从 `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/ ▼ 结果文件(你的机器) @@ -76,16 +69,23 @@ journalctl -u gis-actions -f # 停止 sudo systemctl stop gis-actions - -# 卸载 -sudo dpkg --purge gis-actions ``` -## 已知限制 +## 快速上手(使用测试文件) -| 问题 | 说明 | -|------|------| -| 输入文件 | shapefile 需传入目录路径而非单文件路径(因 .dbf/.shx 配套文件) | -| 模板文件 | 含 Excel 模板的套件需确保 templates/ 目录随脚本包一起发布 | +```bash +SUITE_MARKET_URL="https://suites.mercator.cn" \ +python3 /usr/share/gis-actions/cli.py run /tmp/my-output \ + --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`