Skip to content

Commit

Permalink
crimes: run nc alongside janus
Browse files Browse the repository at this point in the history
  • Loading branch information
tgeoghegan committed Jun 19, 2024
1 parent 5565b87 commit f108ed7
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand Down

0 comments on commit f108ed7

Please sign in to comment.