Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
50 changes: 25 additions & 25 deletions develop/docker-compose/develop.docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ x-volumes: &x-volumes
- ./..:/etc/develop:ro

services:
temporal-left:
temporal-a:
image: temporalio/temporal:1.5.0
command:
- server
Expand All @@ -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:
Expand All @@ -36,7 +36,7 @@ services:
retries: 30
start_period: 5s

temporal-right:
temporal-b:
image: temporalio/temporal:1.5.0
command:
- server
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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:
Expand All @@ -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

Expand Down
20 changes: 10 additions & 10 deletions develop/docker-compose/develop.env
Original file line number Diff line number Diff line change
@@ -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
Expand Down
8 changes: 4 additions & 4 deletions develop/docker-compose/develop.prometheus.tmpl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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}"]
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
Original file line number Diff line number Diff line change
@@ -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
Expand Down
24 changes: 12 additions & 12 deletions develop/docker-compose/smoke-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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. 🚬"