fix: 诚实表述 gis-actions 分发现状
This commit is contained in:
@@ -1,42 +1,24 @@
|
|||||||
# GIS Actions 本地部署
|
# GIS Actions 本地部署
|
||||||
|
|
||||||
|
## 状态:待发布
|
||||||
|
|
||||||
|
GIS Actions(本地执行器)的安装包尚未就绪。以下是部署所需的信息。
|
||||||
|
|
||||||
## 是什么
|
## 是什么
|
||||||
|
|
||||||
GIS Actions 是套件的本地执行引擎。它在你的机器上跑一个后台进程,从调度中心拉取任务,在 Docker 中执行。
|
GIS Actions 是一个后台进程,从调度中心拉取任务,在本地 Docker 中执行套件。
|
||||||
|
|
||||||
## 前提条件
|
## 运行条件
|
||||||
|
|
||||||
- **Python 3.10+**
|
| 条件 | 说明 |
|
||||||
- **Docker**(验证:`docker ps`)
|
|------|------|
|
||||||
- 能访问 `suites.mercator.cn` 和 `registry.mercator.cn`
|
| Python 3.10+ | 标准库即可,无第三方依赖 |
|
||||||
|
| Docker | 用于隔离执行套件(验证:`docker ps`)|
|
||||||
## 依赖
|
| 网络 | 能访问 `suites.mercator.cn` 和 `registry.mercator.cn` |
|
||||||
|
| 代码 | 4 个 Python 文件 + 配置文件 |
|
||||||
GIS Actions 使用 Python 标准库,无第三方包依赖。
|
|
||||||
所有 GIS 计算在 Docker 容器中完成,不需要在你的机器上安装 GDAL 等库。
|
|
||||||
|
|
||||||
## 获取代码
|
|
||||||
|
|
||||||
### 方案 A:从 Gitea Packages 下载
|
|
||||||
|
|
||||||
```bash
|
|
||||||
curl -L -o gis-actions.tar.gz \
|
|
||||||
"https://git.mercator.cn/api/packages/AgentGIS/generic/gis-actions/2.2.2/gis-actions.tar.gz"
|
|
||||||
tar xzf gis-actions.tar.gz
|
|
||||||
cd gis-actions
|
|
||||||
```
|
|
||||||
|
|
||||||
### 方案 B:从 git 仓库获取(需仓库访问权限)
|
|
||||||
|
|
||||||
```bash
|
|
||||||
git clone https://git.mercator.cn/AgentGIS/gis-actions.git
|
|
||||||
cd gis-actions
|
|
||||||
```
|
|
||||||
|
|
||||||
## 配置
|
## 配置
|
||||||
|
|
||||||
创建 `worker.json`:
|
|
||||||
|
|
||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"worker": {
|
"worker": {
|
||||||
@@ -50,10 +32,6 @@ cd gis-actions
|
|||||||
},
|
},
|
||||||
"auth": {
|
"auth": {
|
||||||
"api_key": "***"
|
"api_key": "***"
|
||||||
},
|
|
||||||
"logging": {
|
|
||||||
"level": "INFO",
|
|
||||||
"file": "/var/log/gis-actions.log"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
@@ -66,57 +44,22 @@ API Key 从 https://auth.mercator.cn 获取。
|
|||||||
python3 worker.py --config worker.json
|
python3 worker.py --config worker.json
|
||||||
```
|
```
|
||||||
|
|
||||||
启动后自动注册到调度中心,开始轮询任务。
|
|
||||||
|
|
||||||
## 验证
|
|
||||||
|
|
||||||
日志中应看到:
|
|
||||||
|
|
||||||
```
|
|
||||||
Worker my-machine-001 started, polling https://suites.mercator.cn every 5s
|
|
||||||
Worker registered successfully
|
|
||||||
```
|
|
||||||
|
|
||||||
## 进程管理
|
|
||||||
|
|
||||||
建议使用进程管理工具保持后台运行:
|
|
||||||
|
|
||||||
**Linux:**
|
|
||||||
```bash
|
|
||||||
# 使用 nohup
|
|
||||||
nohup python3 worker.py --config worker.json > gis-actions.log 2>&1 &
|
|
||||||
|
|
||||||
# 或 supervisor(推荐)
|
|
||||||
# 配置见 packaging/deb/ 目录
|
|
||||||
```
|
|
||||||
|
|
||||||
**Windows / macOS:** 可放入开机启动脚本或使用进程管理器。
|
|
||||||
|
|
||||||
## 停止
|
|
||||||
|
|
||||||
```bash
|
|
||||||
# 前台运行:Ctrl+C
|
|
||||||
# 后台运行:kill 进程
|
|
||||||
```
|
|
||||||
|
|
||||||
停止时自动发送下线心跳。
|
|
||||||
|
|
||||||
## 数据流向
|
## 数据流向
|
||||||
|
|
||||||
```
|
```
|
||||||
你的 SHP/GeoJSON/TIFF 文件(本地路径)
|
你的本地文件(SHP/GeoJSON/TIFF)
|
||||||
│
|
│
|
||||||
▼
|
▼
|
||||||
GIS Actions(你的机器)
|
GIS Actions(你的机器)
|
||||||
│ ← 轮询调度中心
|
│ ← 轮询调度中心
|
||||||
│ ← 下载套件脚本包
|
│ ← 下载套件脚本包
|
||||||
│ ← docker run --rm registry.mercator.cn/agentgis/gis-base:latest
|
│ ← docker run --rm gis-base + 套件
|
||||||
│ → 结果写入 /tmp/output/
|
│ → 结果写入 /tmp/output/
|
||||||
│ → 脚本包自动清理
|
│ → 脚本包自动清理
|
||||||
▼
|
▼
|
||||||
结果文件(你的机器 /tmp/output/)
|
结果文件(你的机器)
|
||||||
```
|
```
|
||||||
|
|
||||||
## 架构核心
|
## 架构原则
|
||||||
|
|
||||||
**数据永不离开本地。** 你的文件始终在你的机器上处理,不上传到云端。
|
**数据永不离开本地。** 你的文件始终在你的机器上,不上传到云端。
|
||||||
Reference in New Issue
Block a user