diff --git a/Makefile b/Makefile index 98eb9ba..371815e 100644 --- a/Makefile +++ b/Makefile @@ -150,19 +150,19 @@ DEVELOP_ENV_FILE = develop/docker-compose/develop.env DOCKER_COMPOSE_FILE ?= ./develop/docker-compose/develop.docker-compose.yaml DOCKER_COMPOSE = docker compose --file $(DOCKER_COMPOSE_FILE) --env-file $(DEVELOP_ENV_FILE) -PROXY_LEFT_CONFIG_TMPL = develop/docker-compose/develop.proxy-left.tmpl.yaml -PROXY_RIGHT_CONFIG_TMPL = develop/docker-compose/develop.proxy-right.tmpl.yaml +PROXY_A_CONFIG_TMPL = develop/docker-compose/develop.proxy-a.tmpl.yaml +PROXY_B_CONFIG_TMPL = develop/docker-compose/develop.proxy-b.tmpl.yaml PROMETHEUS_CONFIG_TMPL = develop/docker-compose/develop.prometheus.tmpl.yaml -PROXY_LEFT_CONFIG = develop/docker-compose/tmp/develop.proxy-left.yaml -PROXY_RIGHT_CONFIG = develop/docker-compose/tmp/develop.proxy-right.yaml +PROXY_A_CONFIG = develop/docker-compose/tmp/develop.proxy-a.yaml +PROXY_B_CONFIG = develop/docker-compose/tmp/develop.proxy-b.yaml PROMETHEUS_CONFIG = develop/docker-compose/tmp/develop.prometheus.yaml .PHONY: generate-configs generate-configs: mkdir -p develop/docker-compose/tmp set -a && . $(DEVELOP_ENV_FILE) && set +a && \ - envsubst < $(PROXY_LEFT_CONFIG_TMPL) > $(PROXY_LEFT_CONFIG) && \ - envsubst < $(PROXY_RIGHT_CONFIG_TMPL) > $(PROXY_RIGHT_CONFIG) && \ + envsubst < $(PROXY_A_CONFIG_TMPL) > $(PROXY_A_CONFIG) && \ + envsubst < $(PROXY_B_CONFIG_TMPL) > $(PROXY_B_CONFIG) && \ envsubst < $(PROMETHEUS_CONFIG_TMPL) > $(PROMETHEUS_CONFIG) .PHONY: show-dependencies-ports diff --git a/develop/docker-compose/develop.docker-compose.yaml b/develop/docker-compose/develop.docker-compose.yaml index 488ac80..ecd96d2 100644 --- a/develop/docker-compose/develop.docker-compose.yaml +++ b/develop/docker-compose/develop.docker-compose.yaml @@ -2,7 +2,7 @@ x-volumes: &x-volumes - ./..:/etc/develop:ro services: - temporal-left: + temporal-a: image: temporalio/temporal:1.5.0 command: - server @@ -18,8 +18,8 @@ services: - --log-level - warn ports: - - "${TEMPORAL_LEFT_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}" - - "${TEMPORAL_LEFT_UI_EXTERNAL_PORT}:${TEMPORAL_UI_INTERNAL_PORT}" + - "${TEMPORAL_A_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}" + - "${TEMPORAL_A_UI_EXTERNAL_PORT}:${TEMPORAL_UI_INTERNAL_PORT}" networks: - develop healthcheck: @@ -36,7 +36,7 @@ services: retries: 30 start_period: 5s - temporal-right: + temporal-b: image: temporalio/temporal:1.5.0 command: - server @@ -52,8 +52,8 @@ services: - --log-level - warn ports: - - "${TEMPORAL_RIGHT_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}" - - "${TEMPORAL_RIGHT_UI_EXTERNAL_PORT}:${TEMPORAL_UI_INTERNAL_PORT}" + - "${TEMPORAL_B_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}" + - "${TEMPORAL_B_UI_EXTERNAL_PORT}:${TEMPORAL_UI_INTERNAL_PORT}" networks: - develop healthcheck: @@ -70,20 +70,20 @@ services: retries: 30 start_period: 5s - proxy-right: + proxy-b: build: context: ../.. dockerfile: Dockerfile environment: - CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-right.yaml + CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-b.yaml volumes: *x-volumes ports: - - "${PROXY_RIGHT_EXTERNAL_PORT}:${PROXY_RIGHT_INTERNAL_PORT}" - - "${PROXY_RIGHT_METRICS_EXTERNAL_PORT}:${PROXY_METRICS_INTERNAL_PORT}" + - "${PROXY_B_EXTERNAL_PORT}:${PROXY_B_INTERNAL_PORT}" + - "${PROXY_B_METRICS_EXTERNAL_PORT}:${PROXY_METRICS_INTERNAL_PORT}" networks: - develop depends_on: - temporal-right: + temporal-b: condition: service_healthy healthcheck: # TODO: Replace with healthcheck endpoint. test: @@ -94,22 +94,22 @@ services: retries: 30 start_period: 10s - proxy-left: + proxy-a: build: context: ../.. dockerfile: Dockerfile environment: - CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-left.yaml + CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-a.yaml volumes: *x-volumes ports: - - "${PROXY_LEFT_EXTERNAL_PORT}:${PROXY_LEFT_INTERNAL_PORT}" - - "${PROXY_LEFT_METRICS_EXTERNAL_PORT}:${PROXY_METRICS_INTERNAL_PORT}" + - "${PROXY_A_EXTERNAL_PORT}:${PROXY_A_INTERNAL_PORT}" + - "${PROXY_A_METRICS_EXTERNAL_PORT}:${PROXY_METRICS_INTERNAL_PORT}" networks: - develop depends_on: - temporal-left: + temporal-a: condition: service_healthy - proxy-right: + proxy-b: condition: service_healthy healthcheck: # TODO: Replace with healthcheck endpoint. test: @@ -130,9 +130,9 @@ services: networks: - develop depends_on: - proxy-left: + proxy-a: condition: service_healthy - proxy-right: + proxy-b: condition: service_healthy smoke-test: @@ -141,16 +141,16 @@ services: networks: - develop depends_on: - proxy-left: + proxy-a: condition: service_healthy - proxy-right: + proxy-b: condition: service_healthy volumes: *x-volumes environment: - TEMPORAL_LEFT_INBOUND: "temporal-left:${TEMPORAL_INTERNAL_PORT}" - TEMPORAL_RIGHT_INBOUND: "temporal-right:${TEMPORAL_INTERNAL_PORT}" - PROXY_LEFT_OUTBOUND: "proxy-left:${PROXY_LEFT_INTERNAL_PORT}" - PROXY_RIGHT_OUTBOUND: "proxy-right:${PROXY_RIGHT_INTERNAL_PORT}" + TEMPORAL_A_INBOUND: "temporal-a:${TEMPORAL_INTERNAL_PORT}" + TEMPORAL_B_INBOUND: "temporal-b:${TEMPORAL_INTERNAL_PORT}" + PROXY_A_OUTBOUND: "proxy-a:${PROXY_A_INTERNAL_PORT}" + PROXY_B_OUTBOUND: "proxy-b:${PROXY_B_INTERNAL_PORT}" command: - /etc/develop/docker-compose/smoke-test.sh diff --git a/develop/docker-compose/develop.env b/develop/docker-compose/develop.env index 74043ec..f6d45e6 100644 --- a/develop/docker-compose/develop.env +++ b/develop/docker-compose/develop.env @@ -1,19 +1,19 @@ # External Ports (exposed via localhost) -TEMPORAL_LEFT_EXTERNAL_PORT=4000 -TEMPORAL_RIGHT_EXTERNAL_PORT=5000 -PROXY_LEFT_EXTERNAL_PORT=4001 -PROXY_RIGHT_EXTERNAL_PORT=5001 -PROXY_LEFT_METRICS_EXTERNAL_PORT=4091 -PROXY_RIGHT_METRICS_EXTERNAL_PORT=5091 +TEMPORAL_A_EXTERNAL_PORT=4000 +TEMPORAL_B_EXTERNAL_PORT=5000 +PROXY_A_EXTERNAL_PORT=4001 +PROXY_B_EXTERNAL_PORT=5001 +PROXY_A_METRICS_EXTERNAL_PORT=4091 +PROXY_B_METRICS_EXTERNAL_PORT=5091 PROMETHEUS_EXTERNAL_PORT=9090 -TEMPORAL_LEFT_UI_EXTERNAL_PORT=4233 -TEMPORAL_RIGHT_UI_EXTERNAL_PORT=5233 +TEMPORAL_A_UI_EXTERNAL_PORT=4233 +TEMPORAL_B_UI_EXTERNAL_PORT=5233 # Internal Ports (exposed on containers in docker network) TEMPORAL_INTERNAL_PORT=7233 TEMPORAL_UI_INTERNAL_PORT=8233 -PROXY_LEFT_INTERNAL_PORT=6233 -PROXY_RIGHT_INTERNAL_PORT=6333 +PROXY_A_INTERNAL_PORT=6233 +PROXY_B_INTERNAL_PORT=6333 PROXY_MUX_INTERNAL_PORT=6334 PROXY_PPROF_INTERNAL_PORT=6060 PROXY_METRICS_INTERNAL_PORT=9091 diff --git a/develop/docker-compose/develop.prometheus.tmpl.yaml b/develop/docker-compose/develop.prometheus.tmpl.yaml index 6d2ce1f..b4a5789 100644 --- a/develop/docker-compose/develop.prometheus.tmpl.yaml +++ b/develop/docker-compose/develop.prometheus.tmpl.yaml @@ -2,10 +2,10 @@ global: scrape_interval: 15s scrape_configs: - - job_name: proxy-left + - job_name: proxy-a static_configs: - - targets: ["proxy-left:${PROXY_METRICS_INTERNAL_PORT}"] + - targets: ["proxy-a:${PROXY_METRICS_INTERNAL_PORT}"] - - job_name: proxy-right + - job_name: proxy-b static_configs: - - targets: ["proxy-right:${PROXY_METRICS_INTERNAL_PORT}"] + - targets: ["proxy-b:${PROXY_METRICS_INTERNAL_PORT}"] diff --git a/develop/docker-compose/develop.proxy-left.tmpl.yaml b/develop/docker-compose/develop.proxy-a.tmpl.yaml similarity index 62% rename from develop/docker-compose/develop.proxy-left.tmpl.yaml rename to develop/docker-compose/develop.proxy-a.tmpl.yaml index 4178cdf..798c654 100644 --- a/develop/docker-compose/develop.proxy-left.tmpl.yaml +++ b/develop/docker-compose/develop.proxy-a.tmpl.yaml @@ -1,16 +1,16 @@ clusterConnections: - - name: "cluster-left" + - name: "cluster-a" local: connectionType: "tcp" tcpClient: - address: "temporal-left:${TEMPORAL_INTERNAL_PORT}" + address: "temporal-a:${TEMPORAL_INTERNAL_PORT}" tcpServer: - address: "0.0.0.0:${PROXY_LEFT_INTERNAL_PORT}" + address: "0.0.0.0:${PROXY_A_INTERNAL_PORT}" remote: connectionType: "mux-client" muxCount: 1 muxAddressInfo: - address: "proxy-right:${PROXY_MUX_INTERNAL_PORT}" + address: "proxy-b:${PROXY_MUX_INTERNAL_PORT}" profiling: pprofAddress: "0.0.0.0:${PROXY_PPROF_INTERNAL_PORT}" metrics: diff --git a/develop/docker-compose/develop.proxy-right.tmpl.yaml b/develop/docker-compose/develop.proxy-b.tmpl.yaml similarity index 72% rename from develop/docker-compose/develop.proxy-right.tmpl.yaml rename to develop/docker-compose/develop.proxy-b.tmpl.yaml index 1d34ad3..b656295 100644 --- a/develop/docker-compose/develop.proxy-right.tmpl.yaml +++ b/develop/docker-compose/develop.proxy-b.tmpl.yaml @@ -1,11 +1,11 @@ clusterConnections: - - name: "cluster-right" + - name: "cluster-b" local: connectionType: "tcp" tcpClient: - address: "temporal-right:${TEMPORAL_INTERNAL_PORT}" + address: "temporal-b:${TEMPORAL_INTERNAL_PORT}" tcpServer: - address: "0.0.0.0:${PROXY_RIGHT_INTERNAL_PORT}" + address: "0.0.0.0:${PROXY_B_INTERNAL_PORT}" remote: connectionType: "mux-server" muxCount: 1 diff --git a/develop/docker-compose/smoke-test.sh b/develop/docker-compose/smoke-test.sh index f94ef21..e1a1152 100755 --- a/develop/docker-compose/smoke-test.sh +++ b/develop/docker-compose/smoke-test.sh @@ -4,22 +4,22 @@ set -e sleep 20 # TODO: remove after addition of reliable s2s-proxy healthcheck endpoint. # connectivity (also covered by docker-compose healthcheck) -temporal operator cluster health --address "$TEMPORAL_LEFT_INBOUND" -temporal operator cluster health --address "$TEMPORAL_RIGHT_INBOUND" +temporal operator cluster health --address "$TEMPORAL_A_INBOUND" +temporal operator cluster health --address "$TEMPORAL_B_INBOUND" -# cross-server proxy-left routes to temporal-right -NS_L="smoketest-left-$$" -temporal operator namespace create "$NS_L" --retention 24h --address "$TEMPORAL_RIGHT_INBOUND" -temporal operator namespace describe "$NS_L" --address "$PROXY_LEFT_OUTBOUND" +# cross-server proxy-a routes to temporal-b +NS_A="smoketest-a-$$" +temporal operator namespace create "$NS_A" --retention 24h --address "$TEMPORAL_B_INBOUND" +temporal operator namespace describe "$NS_A" --address "$PROXY_A_OUTBOUND" -# cross-server proxy-right routes to temporal-left -NS_R="smoketest-right-$$" -temporal operator namespace create "$NS_R" --retention 24h --address "$TEMPORAL_LEFT_INBOUND" -temporal operator namespace describe "$NS_R" --address "$PROXY_RIGHT_OUTBOUND" +# cross-server proxy-b routes to temporal-a +NS_B="smoketest-b-$$" +temporal operator namespace create "$NS_B" --retention 24h --address "$TEMPORAL_A_INBOUND" +temporal operator namespace describe "$NS_B" --address "$PROXY_B_OUTBOUND" # outbound route is routed through each proxy # TODO: for strong validation - after migrating off of temporal cli dev server, we can override and check the cluster name (currently both are named 'active') -temporal operator cluster describe --address "$PROXY_LEFT_OUTBOUND" -temporal operator cluster describe --address "$PROXY_RIGHT_OUTBOUND" +temporal operator cluster describe --address "$PROXY_A_OUTBOUND" +temporal operator cluster describe --address "$PROXY_B_OUTBOUND" echo "smoke tests succeeded. 🚬"