From 5ede13e6d4acc13bb23c5aa588a94aea9f420a5a Mon Sep 17 00:00:00 2001 From: lingniu Date: Wed, 1 Jul 2026 11:59:11 +0800 Subject: [PATCH] deploy: persist ingest archive paths --- deploy/portainer/docker-compose.yml | 6 ++++++ .../PortainerComposeResourceLimitsTest.java | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+) diff --git a/deploy/portainer/docker-compose.yml b/deploy/portainer/docker-compose.yml index 591c8849..d5b0fd8d 100644 --- a/deploy/portainer/docker-compose.yml +++ b/deploy/portainer/docker-compose.yml @@ -68,6 +68,7 @@ services: GB32960_PLATFORM_PWD_YUEJIN: ${GB32960_PLATFORM_PWD_YUEJIN:-} GB32960_PLATFORM_IP_YUEJIN: ${GB32960_PLATFORM_IP_YUEJIN:-} GB32960_TLS_ENABLED: ${GB32960_TLS_ENABLED:-false} + SINK_ARCHIVE_PATH: ${GB32960_ARCHIVE_PATH:-/data/archive} ports: - "${GB32960_HTTP_PORT:-20100}:20100" - "${GB32960_TCP_PORT:-32960}:32960" @@ -90,6 +91,7 @@ services: JT808_PORT: 808 KAFKA_CONSUMER_ENABLED: "false" KAFKA_NODE_ID: ${KAFKA_NODE_ID_JT808:-jt808-ingest-portainer} + SINK_ARCHIVE_PATH: ${JT808_ARCHIVE_PATH:-/data/archive} ports: - "${JT808_HTTP_PORT:-20400}:20400" - "${JT808_TCP_PORT:-808}:808" @@ -120,8 +122,11 @@ services: YUTONG_MQTT_USERNAME: ${YUTONG_MQTT_USERNAME:-} YUTONG_MQTT_PASSWORD: ${YUTONG_MQTT_PASSWORD:-} YUTONG_MQTT_CLEAN_SESSION: ${YUTONG_MQTT_CLEAN_SESSION:-false} + SINK_ARCHIVE_PATH: ${YUTONG_MQTT_ARCHIVE_PATH:-/data/archive} ports: - "${YUTONG_MQTT_HTTP_PORT:-20500}:20500" + volumes: + - yutong-mqtt-data:/data networks: - vehicle-ingest @@ -191,3 +196,4 @@ networks: volumes: gb32960-ingest-data: jt808-ingest-data: + yutong-mqtt-data: diff --git a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/PortainerComposeResourceLimitsTest.java b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/PortainerComposeResourceLimitsTest.java index 7d5084f8..049a6b06 100644 --- a/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/PortainerComposeResourceLimitsTest.java +++ b/modules/apps/vehicle-history-app/src/test/java/com/lingniu/ingest/historyapp/PortainerComposeResourceLimitsTest.java @@ -91,6 +91,25 @@ class PortainerComposeResourceLimitsTest { .doesNotContain("vehicle-history-archive:"); } + @Test + void portainerIngestAppsWriteColdArchiveToMountedDataVolume() throws IOException { + String compose = Files.readString(repositoryRoot().resolve("deploy/portainer/docker-compose.yml")); + String gb32960Service = serviceBlock(compose, "gb32960-ingest-app"); + String jt808Service = serviceBlock(compose, "jt808-ingest-app"); + String mqttService = serviceBlock(compose, "yutong-mqtt-app"); + + assertThat(gb32960Service) + .contains("SINK_ARCHIVE_PATH: ${GB32960_ARCHIVE_PATH:-/data/archive}") + .contains("- gb32960-ingest-data:/data"); + assertThat(jt808Service) + .contains("SINK_ARCHIVE_PATH: ${JT808_ARCHIVE_PATH:-/data/archive}") + .contains("- jt808-ingest-data:/data"); + assertThat(mqttService) + .contains("SINK_ARCHIVE_PATH: ${YUTONG_MQTT_ARCHIVE_PATH:-/data/archive}") + .contains("- yutong-mqtt-data:/data"); + assertThat(compose).contains("\n yutong-mqtt-data:\n"); + } + @Test void localLaunchctlHistoryRuntimeDoesNotRequireSharedArchiveRoot() throws IOException { Path launchctl = repositoryRoot().resolve("deploy/local/launchctl");