From 4a78fd7f410be0dbe33df6913d23edb57d79a6e5 Mon Sep 17 00:00:00 2001 From: Huawei Date: Thu, 9 Jul 2026 15:10:24 +0000 Subject: [PATCH] =?UTF-8?q?docs:=20suites-help/=E7=B3=BB=E7=BB=9F=E4=BD=BF?= =?UTF-8?q?=E7=94=A8=E6=89=8B=E5=86=8C/GIS-Actions-=E6=9C=AC=E5=9C=B0?= =?UTF-8?q?=E9=83=A8=E7=BD=B2.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../系统使用手册/GIS-Actions-本地部署.md | 84 +++++++++++++++++++ 1 file changed, 84 insertions(+) create mode 100644 suites-help/系统使用手册/GIS-Actions-本地部署.md diff --git a/suites-help/系统使用手册/GIS-Actions-本地部署.md b/suites-help/系统使用手册/GIS-Actions-本地部署.md new file mode 100644 index 0000000..22ba361 --- /dev/null +++ b/suites-help/系统使用手册/GIS-Actions-本地部署.md @@ -0,0 +1,84 @@ +# GIS Actions 本地部署 + +GIS Actions 是套件的本地执行引擎,跑在你的机器上。 + +## 前提条件 + +- **Python 3.10+**(验证:`python3 --version`) +- **Docker**(验证:`docker ps`) + - Linux:`apt install docker.io` 或 `yum install docker` + - Windows/Mac:安装 Docker Desktop +- 能访问 `registry.mercator.cn`(拉取 gis-base 镜像) + +## 安装 + +```bash +pip install gis-actions +``` + +(也可从源码安装:`git clone https://git.mercator.cn/AgentGIS/gis-actions.git`) + +## 配置 + +创建 `config.json`: + +```json +{ + "worker": { + "id": "my-machine-001", + "capabilities": ["gis-operations"] + }, + "scheduler": { + "url": "https://suites.mercator.cn", + "poll_interval": 5, + "heartbeat_interval": 30 + }, + "auth": { + "api_key": "mk_xxxxxxxxxxxxxxxxxxxx" + } +} +``` + +API Key 从 [https://auth.mercator.cn](https://auth.mercator.cn) 获取。 + +## 启动 + +```bash +python3 -m gis_actions --config config.json +``` + +启动后自动连接调度中心,注册自身,开始等待任务。 + +## 验证 + +日志中应看到: + +``` +Worker xxx started, polling https://suites.mercator.cn every 5s +Worker registered successfully +``` + +## 进程管理 + +- **Linux**:建议使用 systemd 或 supervisor 托管,开机自启 +- **Windows**:建议注册为 Windows Service +- **macOS**:建议使用 launchd + +## 停止 + +按 `Ctrl+C` 停止。脚本包自动清理,不留痕迹。 + +## 数据流向 + +``` +你本地的 SHP/GeoJSON/TIFF 文件 + │ + ▼ +GIS Actions(你的机器) + │ ← 从调度中心拉取任务 + │ ← 下载套件脚本包 + │ ← docker run gis-base + 套件脚本 + │ → 结果写入 /tmp/output/ + ▼ +结果文件(你的机器) +```