docs: 更新 TOOLS.md 适配 v0.2.0(开发者 + 使用者)

This commit is contained in:
Ubuntu
2026-07-13 11:14:22 +08:00
parent c6758a4308
commit 8dc7b8c041
2 changed files with 114 additions and 85 deletions
+43 -70
View File
@@ -4,118 +4,91 @@
https://suites.mercator.cn
浏览套件、查看详情、提交执行任务
浏览套件、查看详情。
## CLI(可选)
## CLI 安装
```bash
# 安装 agentgis-cli
pip install https://git.mercator.cn/api/packages/SuiteHub/generic/agentgis-cli/0.1.0/agentgis_cli-0.1.0-py3-none-any.whl
# 安装 agentgis-cli v0.2.0
pip install https://git.mercator.cn/api/packages/SuiteHub/generic/agentgis-cli/0.2.0/agentgis_cli-0.2.0.tar.gz
# 配置 API Key
agc config set api-key mk_xxxxxxxxx
# 执行套件(在市场找到 suite-id 后)
agc run <suite-id> --inputs '{"input_path": "/data/myfile.shp"}'
# 查看套件列表
agc suites list
# 查看执行状态
agc status <task-id>
```
## gis-actions(本地执行器部署)
## 本地执行环境
gis-actions 是套件的本地执行引擎,跑在你的机器上
所有套件在 **你自己的机器上** 通过 Docker 执行,数据不上云
### 前提条件
- **Debian / Ubuntu 系统**
- **Linux 系统**Debian / Ubuntu
- **Docker**(验证:`docker ps`
- `sudo apt install docker.io`
- 能访问 `registry.mercator.cn`(拉取 gis-base 镜像)
### 安装
### 安装本地执行器
```bash
# 下载并安装 gis-actions
# 安装 worker
wget -O agentgis-worker.deb https://git.mercator.cn/api/packages/SuiteHub/generic/gis-actions/v2.0.0-alpha/agentgis-worker_2.0.0-alpha_all.deb
sudo dpkg -i agentgis-worker.deb
# 安装后会自动配置 systemd 服务和 Docker insecure-registry
```
# 配置 Docker Registry 认证
echo "agw_readonly_2026" | docker login registry.mercator.cn -u agentgis-worker --password-stdin
### 配置
编辑 `/etc/agentgis/worker.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": "你的 API Key"
}
}
```
API Key 从 https://auth.mercator.cn 获取。
### 启动
```bash
# 启动 worker
sudo systemctl start agentgis-worker
sudo systemctl status agentgis-worker
```
### 验证
### 执行套件
```bash
journalctl -u agentgis-worker -f
# 应看到:Worker xxx started, polling https://suites.mercator.cn every 5s
agc run <suite-id> --inputs '{"input_path": "/data/myfile.shp"}' --wait --poll 5
```
### 停止
```bash
sudo systemctl stop agentgis-worker
```
### 卸载
```bash
sudo dpkg --purge agentgis-worker
```
- `<suite-id>``agc suites list` 获取
- 输入文件路径用你的本地绝对路径
- `--wait` 等待执行完成,`--poll 5` 每 5 秒轮询结果
### 数据流向
```
你本地的 SHP/GeoJSON/TIFF 文件
你本地的 SHP/GeoJSON/TIFF/XLS 文件
gis-actions(你的机器)
│ ← 从调度中心拉取任务
│ ← 下载套件脚本包
worker(你的机器)
│ ← 从市场下载套件脚本包
│ ← docker run gis-base + 套件脚本
│ → 结果写入 /tmp/output/
结果文件(你的机器)
```
## 支持的输入类型
## 系统服务管理
| 类型 | 说明 | 示例 |
|------|------|------|
| `file` | 本地文件路径 | `/data/land_use.shp` |
| `string` | 文本 | `"缓冲区距离: 500"` |
| `number` | 数值 | `500.0` |
| `integer` | 整数 | `100` |
| `boolean` | 布尔值 | `true` |
```bash
# 查看状态
sudo systemctl status agentgis-worker
# 查看日志
journalctl -u agentgis-worker -f
# 停止
sudo systemctl stop agentgis-worker
# 卸载
sudo dpkg --purge agentgis-worker
```
## 已知限制
| 问题 | 说明 |
|------|------|
| 输入文件挂载 | worker 暂未自动将输入文件挂载到容器内,需等待 Issue #6 修复 |
| 基础镜像缺包 | gis-base 暂缺 openpyxl/xlrdExcel 套件运行时会自动 pip install |
详见 https://git.mercator.cn/SuiteHub/agent-profiles/issues/6