docs: 更新 suite-user/TOOLS.md — 去 Registry、加 Gitea 镜像下载
This commit is contained in:
+31
-52
@@ -6,86 +6,65 @@ https://suites.mercator.cn
|
||||
|
||||
浏览套件、查看详情。
|
||||
|
||||
## CLI 安装(gis-actions 本地执行器)
|
||||
## 安装
|
||||
|
||||
所有套件在你的机器上通过 Docker 本地执行,数据不上云。
|
||||
|
||||
安装 gis-actions 包即可获得 CLI + worker:
|
||||
安装 `gis-actions` 包即可获得全部功能(CLI + 执行引擎),一次安装:
|
||||
|
||||
```bash
|
||||
# 下载
|
||||
curl -OJ https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/2.0.14/gis-actions_2.0.14_all.deb
|
||||
curl -sLO https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/2.0.14/gis-actions_2.0.14_all.deb
|
||||
|
||||
# 安装
|
||||
sudo dpkg -i gis-actions_2.0.14_all.deb
|
||||
|
||||
# 登录 Docker Registry(拉取 gis-base 镜像)
|
||||
docker login registry.mercator.cn
|
||||
```
|
||||
|
||||
安装后可用 `agc` 命令(已内置在包中)。
|
||||
|
||||
## 前提条件
|
||||
|
||||
- Linux 系统(Debian / Ubuntu)
|
||||
- Docker(验证:`docker ps`)
|
||||
- 能访问 `registry.mercator.cn`
|
||||
- **Linux 系统**(Debian / Ubuntu)
|
||||
- **Docker**(验证:`docker ps`)
|
||||
|
||||
### gis-base 基础镜像
|
||||
|
||||
所有套件运行在 `gis-base` 镜像中(含 Python 3, GDAL, Shapely, GeoPandas, numpy, openpyxl, xlrd)。
|
||||
|
||||
首次执行套件时,系统会自动下载镜像。也可提前准备:
|
||||
|
||||
```bash
|
||||
# 从 Gitea 直接下载镜像包(无需 registry 账号)
|
||||
curl -sLO https://git.mercator.cn/api/packages/SuiteHub/generic/gis-base/1.0.0/gis-base.tar.gz
|
||||
docker load -i gis-base.tar.gz
|
||||
```
|
||||
|
||||
## 执行套件
|
||||
|
||||
```bash
|
||||
SUITE_MARKET_URL="https://suites.mercator.cn" \
|
||||
python3 /usr/share/gis-actions/cli.py run /tmp/work-output \
|
||||
--suite-id <suite-id> \
|
||||
--input bid_xls=/path/to/bid.xls \
|
||||
--input points_shp=/path/to/points.shp
|
||||
# 列出市场所有套件
|
||||
agc suites list
|
||||
|
||||
# 执行套件,输入文件用本地绝对路径
|
||||
agc run <suite-id> --inputs '{"input_path": "/data/myfile.shp"}' --wait --poll 5
|
||||
```
|
||||
|
||||
- `<suite-id>` 从 Suite Market 界面获取
|
||||
- 输入文件路径用本地绝对路径,shapefile 只需传 .shp 路径,配套文件自动复制
|
||||
- 支持 `--input key=value` 多参数传递
|
||||
`<suite-id>` 从 `agc suites list` 获取。
|
||||
|
||||
## 数据流向
|
||||
|
||||
```
|
||||
你本地的 SHP/XLS 文件
|
||||
你本地的 SHP/GeoJSON/TIFF/XLS 文件
|
||||
│
|
||||
▼
|
||||
cli.py(你的机器)
|
||||
gis-actions(你的机器)
|
||||
│ ← 从市场下载套件脚本包
|
||||
│ ← 复制输入文件到工作目录
|
||||
│ → docker run gis-base + 套件脚本
|
||||
│ ← docker run gis-base + 套件脚本
|
||||
│ → 结果写入 /tmp/output/
|
||||
▼
|
||||
结果文件(你的机器)
|
||||
```
|
||||
|
||||
## 系统服务管理
|
||||
|
||||
```bash
|
||||
# 查看状态
|
||||
sudo systemctl status gis-actions
|
||||
|
||||
# 查看日志
|
||||
journalctl -u gis-actions -f
|
||||
|
||||
# 停止
|
||||
sudo systemctl stop gis-actions
|
||||
```
|
||||
|
||||
## 快速上手(使用测试文件)
|
||||
|
||||
```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
|
||||
```
|
||||
|
||||
## 注意事项
|
||||
|
||||
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`
|
||||
- 输入文件路径使用你的本地绝对路径
|
||||
- shapefile 需要传入目录路径而非单文件路径(因 .dbf/.shx 配套文件)
|
||||
- 套件数据不上传云端,全部在你的机器上处理
|
||||
|
||||
Reference in New Issue
Block a user