87 lines
2.2 KiB
Markdown
87 lines
2.2 KiB
Markdown
# GIS Actions 本地部署指南(双平台)
|
||
|
||
## 架构
|
||
|
||
GIS Actions 是**本地执行器**,从套件市场下载脚本包并在本地运行(Linux Docker / Windows 本机):
|
||
|
||
```
|
||
用户 / Agent 指定套件 ID
|
||
→ gis-actions(本地)
|
||
→ 从 Suite Market 下载脚本包
|
||
→ 解析 workflow.yaml
|
||
\u2192 runtime: docker -> docker run gis-base / python3/arcpy -> subprocess
|
||
\u2192 \u7ed3\u679c\u5199\u5165\u672c\u5730\u5de5\u4f5c\u76ee\u5f55
|
||
```
|
||
|
||
## 环境要求
|
||
|
||
**Linux:**
|
||
- Debian / Ubuntu 系统
|
||
- Docker
|
||
- Python 3.10+
|
||
|
||
**Windows:**
|
||
- Windows 10/11
|
||
- ArcMap 10.8(arcpy 步骤需要)
|
||
- 无需 Docker
|
||
|
||
## 安装
|
||
|
||
**Linux:**
|
||
```bash
|
||
curl -sLO https://packages.mercator.cn/public/gis-actions/latest.deb
|
||
sudo dpkg -i latest.deb
|
||
```
|
||
安装后 `agc` 命令即可用。
|
||
|
||
**Windows:**
|
||
1. 下载 [latest-windows.zip](https://packages.mercator.cn/public/gis-actions/latest-windows.zip)
|
||
2. 解压到 `%LOCALAPPDATA%\AgentGIS\gis-actions\`
|
||
3. 将路径加入 `PATH`
|
||
4. 验证:`agc --help`
|
||
|
||
## 配置(可选)
|
||
|
||
```bash
|
||
# 设置 API Key(从 https://auth.mercator.cn 获取)
|
||
export AGENTGIS_API_KEY=mk_xxxxxxxxxxxxx
|
||
```
|
||
|
||
## 运行套件
|
||
|
||
```bash
|
||
# 通过套件 ID 执行
|
||
agc run /tmp/output --suite-id <suite-id> --input key=value
|
||
|
||
# 示例
|
||
agc run /tmp/output --suite-id 2c99a1cb-84a5-42dd-9147-1c8e8f7f2941 --input buffer_distance=0.5
|
||
```
|
||
|
||
## 包结构
|
||
|
||
**Linux(deb 包):**
|
||
```
|
||
/usr/bin/agc # CLI 入口
|
||
/usr/share/gis-actions/cli.py # CLI 逻辑
|
||
/usr/share/gis-actions/download_and_run.py # 下载+执行
|
||
/usr/share/gis-actions/local_executor.py # 本地步骤执行器
|
||
/usr/share/gis-actions/steps_executor.py # Docker 步骤执行器
|
||
```
|
||
|
||
**Windows(zip 包):**
|
||
```
|
||
%LOCALAPPDATA%\AgentGIS\gis-actions\agc.exe # CLI 入口
|
||
```
|
||
|
||
## 执行流程
|
||
|
||
1. `agc run` 启动
|
||
2. 解析套件 ID(调用 Suite Market API 获取 package_url)
|
||
3. 下载脚本包 → 解压到工作目录
|
||
4. 读取 workflow.yaml,按 steps 顺序执行
|
||
5. 每个步骤按 runtime 执行:
|
||
- `docker` -> Docker 容器(gis-base 镜像)
|
||
- `python3` -> 本地 subprocess
|
||
- `arcpy` -> 系统 arcpy
|
||
6. 结果写入本地输出目录,临时文件自动清理
|