docs: rewrite GIS-Actions local deployment guide (#8)
This commit is contained in:
@@ -15,61 +15,51 @@ GIS Actions 是**本地执行器**,从套件市场下载脚本包并在本地
|
||||
|
||||
## 环境要求
|
||||
|
||||
- Python 3.10+
|
||||
- Docker(用于容器化执行)
|
||||
- Linux 系统(Debian / Ubuntu)
|
||||
- Docker
|
||||
- Python 3.10+(已随系统安装)
|
||||
|
||||
## 获取代码
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
curl -L -o gis-actions.tar.gz "https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/3.0.2/gis-actions_3.0.2_all.deb"
|
||||
tar xzf gis-actions.tar.gz
|
||||
cd gis-actions
|
||||
# 下载并安装 gis-actions(一个 deb 包含全部功能)
|
||||
curl -sLO https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/3.0.2/gis-actions_3.0.2_all.deb
|
||||
sudo dpkg -i gis-actions_3.0.2_all.deb
|
||||
```
|
||||
|
||||
## 配置
|
||||
安装后 `agc` 命令即可用。postinst 会自动下载 gis-base 镜像。
|
||||
|
||||
## 配置(可选)
|
||||
|
||||
```bash
|
||||
# 设置 API Key(从 https://auth.mercator.cn 获取)
|
||||
export AGENTGIS_API_KEY=mk_xxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
或创建 `worker.json`:
|
||||
|
||||
```json
|
||||
{
|
||||
"worker": { "id": "my-machine-001" },
|
||||
"scheduler": { "url": "https://suites.mercator.cn" },
|
||||
"auth": { "api_key": "***" }
|
||||
}
|
||||
```
|
||||
|
||||
## 运行套件
|
||||
|
||||
```bash
|
||||
# 通过套件 ID 执行(推荐)
|
||||
python cli.py run /tmp/workdir --suite-id parcel-analysis --input buffer_distance=0.5
|
||||
# 通过套件 ID 执行
|
||||
agc run /tmp/output --suite-id <suite-id> --input key=value
|
||||
|
||||
# 或直接指定脚本包地址
|
||||
python cli.py run /tmp/workdir --package-url https://git.mercator.cn/.../scripts.tar.gz
|
||||
# 示例
|
||||
agc run /tmp/output --suite-id 2c99a1cb-84a5-42dd-9147-1c8e8f7f2941 --input buffer_distance=0.5
|
||||
```
|
||||
|
||||
## 目录结构
|
||||
## 包结构
|
||||
|
||||
```
|
||||
gis-actions/
|
||||
├── cli.py # 命令行入口(支持 --suite-id / --package-url)
|
||||
├── download_and_run.py # 下载 + 执行核心逻辑
|
||||
├── steps_executor.py # workflow.yaml 步骤执行器
|
||||
├── workdir/ # 默认工作目录
|
||||
└── packaging/deb/ # DEB 打包结构(待完善)
|
||||
/usr/bin/agc # CLI 入口
|
||||
/usr/share/gis-actions/cli.py # CLI 逻辑
|
||||
/usr/share/gis-actions/download_and_run.py # 下载+执行
|
||||
/usr/share/gis-actions/steps_executor.py # 步骤执行器
|
||||
```
|
||||
|
||||
## 执行流程
|
||||
|
||||
1. `cli.py run` 启动
|
||||
1. `agc run` 启动
|
||||
2. 解析套件 ID(调用 Suite Market API 获取 package_url)
|
||||
3. 下载 scripts.tar.gz → 解压到工作目录
|
||||
3. 下载脚本包 → 解压到工作目录
|
||||
4. 读取 workflow.yaml,按 steps 顺序执行
|
||||
5. 每个步骤在 Docker 容器中运行(gis-base 镜像)
|
||||
6. 清理脚本目录(知识产权保护)
|
||||
7. 结果写入本地输出目录
|
||||
6. 结果写入本地输出目录
|
||||
|
||||
Reference in New Issue
Block a user