From fb5412d6eeb3b22e1ccda1719c4638f5ba795578 Mon Sep 17 00:00:00 2001 From: admin Date: Thu, 9 Jul 2026 15:48:47 +0000 Subject: [PATCH] docs: rewrite gis-actions local executor guide --- .../系统使用手册/GIS-Actions-本地部署.md | 85 +++++++++---------- 1 file changed, 40 insertions(+), 45 deletions(-) diff --git a/suites-help/系统使用手册/GIS-Actions-本地部署.md b/suites-help/系统使用手册/GIS-Actions-本地部署.md index 01b4af1..dc5d4b2 100644 --- a/suites-help/系统使用手册/GIS-Actions-本地部署.md +++ b/suites-help/系统使用手册/GIS-Actions-本地部署.md @@ -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 | 用于隔离执行套件(验证:`docker ps`)| -| 网络 | 能访问 `suites.mercator.cn` 和 `registry.mercator.cn` | -| 代码 | 4 个 Python 文件 + 配置文件 | +- Python 3.10+ +- Docker(用于执行容器化脚本任务) + +## 安装 + +```bash +git clone https://git.mercator.cn/AgentGIS/gis-actions.git +cd gis-actions +pip install -r requirements.txt +``` ## 配置 -```json -{ - "worker": { - "id": "my-machine-001", - "capabilities": ["gis-operations"] - }, - "scheduler": { - "url": "https://suites.mercator.cn", - "poll_interval": 5, - "heartbeat_interval": 30 - }, - "auth": { - "api_key": "***" - } -} +```bash +export GITEA_TOKEN=your_gitea_token_here ``` -API Key 从 https://auth.mercator.cn 获取。 - -## 启动 +## 运行套件 ```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(你的机器) - │ ← 轮询调度中心 - │ ← 下载套件脚本包 - │ ← docker run --rm gis-base + 套件 - │ → 结果写入 /tmp/output/ - │ → 脚本包自动清理 - ▼ -结果文件(你的机器) +gis-actions/ +├── cli.py # 命令行入口 +├── download_and_run.py # 下载 + 执行核心逻辑 +├── steps_executor.py # Workflow 步骤执行器 +├── docker-wrapper.sh # Docker 包装脚本 +├── workdir/ # 默认工作目录 +└── e2e_test.py # 端到端测试 ``` -## 架构原则 +## 工作流程 -**数据永不离开本地。** 你的文件始终在你的机器上,不上传到云端。 \ No newline at end of file +1. cli.py run 启动执行 +2. download_and_run.run_suite() 根据 package_url 下载套件包 +3. 解压到工作目录 +4. 读取 workflow.yml,按步骤执行 +5. 脚本步骤通过 Docker 容器运行 +6. 结果输出到工作目录