From f108ed725f6c60a6e869540875e49ae8792c8115 Mon Sep 17 00:00:00 2001 From: Tim Geoghegan Date: Tue, 18 Jun 2024 16:45:11 -0700 Subject: [PATCH] crimes: run nc alongside janus --- compose.yaml | 26 +++++++++++++++++++++++--- 1 file changed, 23 insertions(+), 3 deletions(-) diff --git a/compose.yaml b/compose.yaml index b0bc029d..b3fd558e 100644 --- a/compose.yaml +++ b/compose.yaml @@ -158,7 +158,17 @@ services: janus_1_aggregator: <<: *janus_common - entrypoint: ["/janus_aggregator", "aggregator"] + entrypoint: + - /bin/sh + - -c + # Crimes: janus_2_aggregator's DAP API is localhost:9002 in the divviup-api aggregator object, + # but that address is only valid in the host network, outside of Docker Compose. But we need + # various parts of janus_1 to be able to reach janus_2_aggregator there. So we run nc(1) + # alongside the Janus processes so that it listens on localhost:9002 and forwards traffic to + # janus_2_aggregator:8080, which _does_ exist on the Docker Compose network. + - | + nc -p 9002 -lk -e nc janus_2_aggregator 8080 & \ + /janus_aggregator aggregator configs: - janus_1_aggregator.yaml ports: @@ -180,7 +190,12 @@ services: janus_1_aggregation_job_driver: <<: *janus_common - entrypoint: ["/janus_aggregator", "aggregation_job_driver"] + entrypoint: + - /bin/sh + - -c + - | + nc -p 9002 -lk -e nc janus_2_aggregator 8080 & \ + /janus_aggregator aggregation_job_driver configs: - janus_1_aggregation_job_driver.yaml environment: @@ -190,7 +205,12 @@ services: janus_1_collection_job_driver: <<: *janus_common - entrypoint: ["/janus_aggregator", "collection_job_driver"] + entrypoint: + - /bin/sh + - -c + - | + nc -p 9002 -lk -e nc janus_2_aggregator 8080 & \ + /janus_aggregator collection_job_driver configs: - janus_1_collection_job_driver.yaml environment: