docs: rewrite gis-actions local executor guide

This commit is contained in:
2026-07-09 15:48:47 +00:00
parent 8099d40a8e
commit fb5412d6ee
@@ -1,65 +1,60 @@
# GIS Actions 本地部署 # GIS-Actions 本地部署指南
## 状态:待发布 ## 架构
GIS Actions本地执行器)的安装包尚未就绪。以下是部署所需的信息。 gis-actions 是**本地执行器**,直接从 Gitea 下载套件包并在本地 Docker 中运行:
## 是什么 ```
用户 / CLI → gis-actions(本地)
→ 下载套件包(从 Gitea)
→ Docker 执行
→ 结果写入本地
```
GIS Actions 是一个后台进程,从调度中心拉取任务,在本地 Docker 中执行套件 不再需要云端 Worker 注册、心跳、任务队列轮询
## 运行条件 ## 环境要求
| 条件 | 说明 | - Python 3.10+
|------|------| - Docker(用于执行容器化脚本任务)
| Python 3.10+ | 标准库即可,无第三方依赖 |
| Docker | 用于隔离执行套件(验证:`docker ps`| ## 安装
| 网络 | 能访问 `suites.mercator.cn``registry.mercator.cn` |
| 代码 | 4 个 Python 文件 + 配置文件 | ```bash
git clone https://git.mercator.cn/AgentGIS/gis-actions.git
cd gis-actions
pip install -r requirements.txt
```
## 配置 ## 配置
```json ```bash
{ export GITEA_TOKEN=your_gitea_token_here
"worker": {
"id": "my-machine-001",
"capabilities": ["gis-operations"]
},
"scheduler": {
"url": "https://suites.mercator.cn",
"poll_interval": 5,
"heartbeat_interval": 30
},
"auth": {
"api_key": "***"
}
}
``` ```
API Key 从 https://auth.mercator.cn 获取。 ## 运行套件
## 启动
```bash ```bash
python3 worker.py --config worker.json python cli.py run /tmp/my-workdir --input package_url=https://git.mercator.cn/.../suite.tar.gz
``` ```
## 数据流向 ## 目录结构
``` ```
你的本地文件(SHP/GeoJSON/TIFF gis-actions/
├── cli.py # 命令行入口
├── download_and_run.py # 下载 + 执行核心逻辑
GIS Actions(你的机器) ├── steps_executor.py # Workflow 步骤执行器
│ ← 轮询调度中心 ├── docker-wrapper.sh # Docker 包装脚本
│ ← 下载套件脚本包 ├── workdir/ # 默认工作目录
│ ← docker run --rm gis-base + 套件 └── e2e_test.py # 端到端测试
│ → 结果写入 /tmp/output/
│ → 脚本包自动清理
结果文件(你的机器)
``` ```
## 架构原则 ## 工作流程
**数据永不离开本地。** 你的文件始终在你的机器上,不上传到云端。 1. cli.py run 启动执行
2. download_and_run.run_suite() 根据 package_url 下载套件包
3. 解压到工作目录
4. 读取 workflow.yml,按步骤执行
5. 脚本步骤通过 Docker 容器运行
6. 结果输出到工作目录