split metrics installer image
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
|
||||
This package deploys ours RP on Linux servers whose host architecture matches the packaged installer metadata, using Docker Compose and continuous all-five RIR validation.
|
||||
|
||||
The package includes architecture-matched ours RP runtime, Prometheus and Grafana images, so deployment does not need to pull application images on the target host. Runtime state, run artifacts, logs, Prometheus data and Grafana data are persisted through host bind mounts.
|
||||
The package includes four architecture-matched images: ours RP runtime, artifact metrics, Prometheus, and Grafana. Deployment does not need to pull application images on the target host. Runtime state, run artifacts, logs, Prometheus data and Grafana data are persisted through host bind mounts.
|
||||
|
||||
By default the host architecture must match `PACKAGE_ARCH` from `PACKAGE-MANIFEST.env`. If you intentionally want to run this package on a different host architecture through QEMU/binfmt, set:
|
||||
|
||||
@@ -38,6 +38,9 @@ Defaults:
|
||||
- `PERIODIC_SNAPSHOT_MAX_DELTAS=100`
|
||||
- `HOST_DATA_DIR=__HOST_DATA_DIR__`
|
||||
- `SOAK_RESTART_POLICY=unless-stopped`
|
||||
- `RPKI_IMAGE=ours-rp-runtime-__PACKAGE_ARCH__:dev`
|
||||
- `METRICS_IMAGE=ours-rp-metrics-__PACKAGE_ARCH__:dev`
|
||||
- `METRICS_PLATFORM=__PACKAGE_PLATFORM__`
|
||||
- `MONITOR_PLATFORM=__PACKAGE_PLATFORM__`
|
||||
- `ALLOW_CROSS_ARCH=0`
|
||||
|
||||
@@ -45,6 +48,12 @@ Defaults:
|
||||
|
||||
If there is no successful run under `HOST_DATA_DIR/runs`, `start.sh` starts the core `ours-rp-soak` service first and waits for the first snapshot to succeed before starting metrics, Prometheus and Grafana.
|
||||
|
||||
Container/image mapping:
|
||||
|
||||
- `ours-rp-soak` uses `RPKI_IMAGE`
|
||||
- `artifact-metrics` uses `METRICS_IMAGE`
|
||||
- `prometheus` / `grafana` use their monitor images
|
||||
|
||||
The first snapshot refreshes live TA certificates before starting the RP process.
|
||||
|
||||
## Architecture Guardrails
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
|
||||
本安装包用于在目标架构与包元数据匹配的 Linux 服务器上,通过 Docker Compose 部署 ours RP,并持续运行 all5 RIR 同步验证任务。
|
||||
|
||||
安装包内置与包架构一致的 ours RP runtime、Prometheus、Grafana 镜像,部署时不需要现场拉取应用镜像。运行产物、状态数据库、日志、Prometheus 和 Grafana 数据均通过宿主机目录挂载保存。
|
||||
安装包内置与包架构一致的四类镜像:ours RP runtime、artifact metrics、Prometheus、Grafana。部署时不需要现场拉取应用镜像。运行产物、状态数据库、日志、Prometheus 和 Grafana 数据均通过宿主机目录挂载保存。
|
||||
|
||||
默认情况下,宿主架构必须与 `PACKAGE-MANIFEST.env` 中的 `PACKAGE_ARCH` 匹配;若确需在异构主机上通过 QEMU/binfmt 运行,必须显式设置:
|
||||
|
||||
@@ -38,6 +38,9 @@ vim .env
|
||||
- `PERIODIC_SNAPSHOT_MAX_DELTAS=100`
|
||||
- `HOST_DATA_DIR=__HOST_DATA_DIR__`
|
||||
- `SOAK_RESTART_POLICY=unless-stopped`
|
||||
- `RPKI_IMAGE=ours-rp-runtime-__PACKAGE_ARCH__:dev`
|
||||
- `METRICS_IMAGE=ours-rp-metrics-__PACKAGE_ARCH__:dev`
|
||||
- `METRICS_PLATFORM=__PACKAGE_PLATFORM__`
|
||||
- `MONITOR_PLATFORM=__PACKAGE_PLATFORM__`
|
||||
- `ALLOW_CROSS_ARCH=0`
|
||||
|
||||
@@ -45,6 +48,12 @@ vim .env
|
||||
|
||||
如果 `HOST_DATA_DIR/runs` 下没有成功 run,`start.sh` 会先启动核心 `ours-rp-soak`,等待第一轮 snapshot 成功后再启动 metrics、Prometheus 和 Grafana。
|
||||
|
||||
容器镜像分工:
|
||||
|
||||
- `ours-rp-soak` 使用 `RPKI_IMAGE`
|
||||
- `artifact-metrics` 使用 `METRICS_IMAGE`
|
||||
- `prometheus` / `grafana` 使用各自 monitor image
|
||||
|
||||
第一轮 snapshot 会先拉取 live TA,避免 clean state 使用旧 fixture TA。
|
||||
|
||||
## 架构检查
|
||||
|
||||
@@ -10,7 +10,7 @@ The installer is idempotent:
|
||||
|
||||
- existing `.env` is kept;
|
||||
- existing Docker/Compose installation is reused;
|
||||
- repeated loading of packaged ours RP, Prometheus and Grafana images for the package architecture is safe;
|
||||
- repeated loading of packaged runtime, metrics, Prometheus and Grafana images for the package architecture is safe;
|
||||
- existing data directory is reused;
|
||||
- matching host/package architecture is required by default.
|
||||
|
||||
@@ -51,7 +51,7 @@ Then rerun `./install.sh` or `./self-check.sh`, and only then will the scripts a
|
||||
Important checks:
|
||||
|
||||
- Docker/Compose availability;
|
||||
- runtime, Prometheus and Grafana images exist;
|
||||
- runtime, metrics, Prometheus and Grafana images exist;
|
||||
- `HOST_DATA_DIR` is writable;
|
||||
- Compose config is valid;
|
||||
- latest run status;
|
||||
@@ -62,6 +62,8 @@ Important checks:
|
||||
|
||||
- `package_arch`
|
||||
- `package_platform`
|
||||
- `runtime_image`
|
||||
- `metrics_image`
|
||||
- `allow_cross_arch`
|
||||
- `periodic_snapshot_reset`
|
||||
- `periodic_snapshot_max_deltas`
|
||||
@@ -76,6 +78,8 @@ Extract the new package into a new directory and explicitly reuse the existing `
|
||||
|
||||
If the new package directory already has a `.env`, the upgrade script keeps it.
|
||||
|
||||
If an older `.env` does not contain `METRICS_IMAGE` or `METRICS_PLATFORM`, the install/upgrade flow backfills package-matched defaults automatically.
|
||||
|
||||
Upgrade does not delete:
|
||||
|
||||
- `runs/`
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
|
||||
- 已有 `.env` 不覆盖;
|
||||
- 已安装 Docker/Compose 则跳过;
|
||||
- 包内 ours RP、Prometheus、Grafana 对应架构镜像重复加载是安全的;
|
||||
- 包内 runtime、metrics、Prometheus、Grafana 对应架构镜像重复加载是安全的;
|
||||
- 数据目录已存在则复用;
|
||||
- 默认要求宿主与包架构匹配。
|
||||
|
||||
@@ -51,7 +51,7 @@ ALLOW_CROSS_ARCH=1
|
||||
重点检查项:
|
||||
|
||||
- Docker/Compose 可用;
|
||||
- runtime、Prometheus、Grafana 镜像存在;
|
||||
- runtime、metrics、Prometheus、Grafana 镜像存在;
|
||||
- `HOST_DATA_DIR` 可写;
|
||||
- Compose 配置合法;
|
||||
- 最新 run 状态;
|
||||
@@ -62,6 +62,8 @@ ALLOW_CROSS_ARCH=1
|
||||
|
||||
- `package_arch`
|
||||
- `package_platform`
|
||||
- `runtime_image`
|
||||
- `metrics_image`
|
||||
- `allow_cross_arch`
|
||||
- `periodic_snapshot_reset`
|
||||
- `periodic_snapshot_max_deltas`
|
||||
@@ -76,6 +78,8 @@ ALLOW_CROSS_ARCH=1
|
||||
|
||||
如果新目录已经存在 `.env`,升级脚本会保留它,不覆盖。
|
||||
|
||||
如果旧 `.env` 缺失 `METRICS_IMAGE` 或 `METRICS_PLATFORM`,升级/安装链路会按当前包架构自动补齐默认值。
|
||||
|
||||
升级不会删除以下数据:
|
||||
|
||||
- `runs/`
|
||||
|
||||
@@ -44,6 +44,15 @@ docker run --rm --platform __PACKAGE_PLATFORM__ debian:bookworm-slim uname -m
|
||||
|
||||
For `arm64` packages the expected output is `aarch64`; for `amd64` packages the expected output is `x86_64`.
|
||||
|
||||
To confirm the metrics image is also loaded correctly:
|
||||
|
||||
```bash
|
||||
docker image inspect "$(grep '^METRICS_IMAGE=' .env | cut -d= -f2-)"
|
||||
docker run --rm --platform __PACKAGE_PLATFORM__ \
|
||||
"$(grep '^METRICS_IMAGE=' .env | cut -d= -f2-)" \
|
||||
/opt/ours-rp/bin/rpki_artifact_metrics --help
|
||||
```
|
||||
|
||||
## First Snapshot Times Out
|
||||
|
||||
All-five snapshot can be slow, especially under QEMU. Increase timeout:
|
||||
|
||||
@@ -44,6 +44,15 @@ docker run --rm --platform __PACKAGE_PLATFORM__ debian:bookworm-slim uname -m
|
||||
|
||||
对于 `arm64` 包,预期输出 `aarch64`;对于 `amd64` 包,预期输出 `x86_64`。
|
||||
|
||||
如需进一步确认 metrics 镜像也已正确加载:
|
||||
|
||||
```bash
|
||||
docker image inspect "$(grep '^METRICS_IMAGE=' .env | cut -d= -f2-)"
|
||||
docker run --rm --platform __PACKAGE_PLATFORM__ \
|
||||
"$(grep '^METRICS_IMAGE=' .env | cut -d= -f2-)" \
|
||||
/opt/ours-rp/bin/rpki_artifact_metrics --help
|
||||
```
|
||||
|
||||
## 首轮 snapshot 超时
|
||||
|
||||
all5 snapshot 可能很慢,尤其在 QEMU 环境。可以提高超时:
|
||||
|
||||
Reference in New Issue
Block a user