Skip to content

Commit 68a891c

Browse files
authored
Rename Docker develop environment from left/right to a/b semantic (#200)
1 parent 2a2eee6 commit 68a891c

7 files changed

Lines changed: 64 additions & 64 deletions

File tree

Makefile

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -150,19 +150,19 @@ DEVELOP_ENV_FILE = develop/docker-compose/develop.env
150150
DOCKER_COMPOSE_FILE ?= ./develop/docker-compose/develop.docker-compose.yaml
151151
DOCKER_COMPOSE = docker compose --file $(DOCKER_COMPOSE_FILE) --env-file $(DEVELOP_ENV_FILE)
152152

153-
PROXY_LEFT_CONFIG_TMPL = develop/docker-compose/develop.proxy-left.tmpl.yaml
154-
PROXY_RIGHT_CONFIG_TMPL = develop/docker-compose/develop.proxy-right.tmpl.yaml
153+
PROXY_A_CONFIG_TMPL = develop/docker-compose/develop.proxy-a.tmpl.yaml
154+
PROXY_B_CONFIG_TMPL = develop/docker-compose/develop.proxy-b.tmpl.yaml
155155
PROMETHEUS_CONFIG_TMPL = develop/docker-compose/develop.prometheus.tmpl.yaml
156-
PROXY_LEFT_CONFIG = develop/docker-compose/tmp/develop.proxy-left.yaml
157-
PROXY_RIGHT_CONFIG = develop/docker-compose/tmp/develop.proxy-right.yaml
156+
PROXY_A_CONFIG = develop/docker-compose/tmp/develop.proxy-a.yaml
157+
PROXY_B_CONFIG = develop/docker-compose/tmp/develop.proxy-b.yaml
158158
PROMETHEUS_CONFIG = develop/docker-compose/tmp/develop.prometheus.yaml
159159

160160
.PHONY: generate-configs
161161
generate-configs:
162162
mkdir -p develop/docker-compose/tmp
163163
set -a && . $(DEVELOP_ENV_FILE) && set +a && \
164-
envsubst < $(PROXY_LEFT_CONFIG_TMPL) > $(PROXY_LEFT_CONFIG) && \
165-
envsubst < $(PROXY_RIGHT_CONFIG_TMPL) > $(PROXY_RIGHT_CONFIG) && \
164+
envsubst < $(PROXY_A_CONFIG_TMPL) > $(PROXY_A_CONFIG) && \
165+
envsubst < $(PROXY_B_CONFIG_TMPL) > $(PROXY_B_CONFIG) && \
166166
envsubst < $(PROMETHEUS_CONFIG_TMPL) > $(PROMETHEUS_CONFIG)
167167

168168
.PHONY: show-dependencies-ports

develop/docker-compose/develop.docker-compose.yaml

Lines changed: 25 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ x-volumes: &x-volumes
22
- ./..:/etc/develop:ro
33

44
services:
5-
temporal-left:
5+
temporal-a:
66
image: temporalio/temporal:1.5.0
77
command:
88
- server
@@ -18,8 +18,8 @@ services:
1818
- --log-level
1919
- warn
2020
ports:
21-
- "${TEMPORAL_LEFT_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}"
22-
- "${TEMPORAL_LEFT_UI_EXTERNAL_PORT}:${TEMPORAL_UI_INTERNAL_PORT}"
21+
- "${TEMPORAL_A_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}"
22+
- "${TEMPORAL_A_UI_EXTERNAL_PORT}:${TEMPORAL_UI_INTERNAL_PORT}"
2323
networks:
2424
- develop
2525
healthcheck:
@@ -36,7 +36,7 @@ services:
3636
retries: 30
3737
start_period: 5s
3838

39-
temporal-right:
39+
temporal-b:
4040
image: temporalio/temporal:1.5.0
4141
command:
4242
- server
@@ -52,8 +52,8 @@ services:
5252
- --log-level
5353
- warn
5454
ports:
55-
- "${TEMPORAL_RIGHT_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}"
56-
- "${TEMPORAL_RIGHT_UI_EXTERNAL_PORT}:${TEMPORAL_UI_INTERNAL_PORT}"
55+
- "${TEMPORAL_B_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}"
56+
- "${TEMPORAL_B_UI_EXTERNAL_PORT}:${TEMPORAL_UI_INTERNAL_PORT}"
5757
networks:
5858
- develop
5959
healthcheck:
@@ -70,20 +70,20 @@ services:
7070
retries: 30
7171
start_period: 5s
7272

73-
proxy-right:
73+
proxy-b:
7474
build:
7575
context: ../..
7676
dockerfile: Dockerfile
7777
environment:
78-
CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-right.yaml
78+
CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-b.yaml
7979
volumes: *x-volumes
8080
ports:
81-
- "${PROXY_RIGHT_EXTERNAL_PORT}:${PROXY_RIGHT_INTERNAL_PORT}"
82-
- "${PROXY_RIGHT_METRICS_EXTERNAL_PORT}:${PROXY_METRICS_INTERNAL_PORT}"
81+
- "${PROXY_B_EXTERNAL_PORT}:${PROXY_B_INTERNAL_PORT}"
82+
- "${PROXY_B_METRICS_EXTERNAL_PORT}:${PROXY_METRICS_INTERNAL_PORT}"
8383
networks:
8484
- develop
8585
depends_on:
86-
temporal-right:
86+
temporal-b:
8787
condition: service_healthy
8888
healthcheck: # TODO: Replace with healthcheck endpoint.
8989
test:
@@ -94,22 +94,22 @@ services:
9494
retries: 30
9595
start_period: 10s
9696

97-
proxy-left:
97+
proxy-a:
9898
build:
9999
context: ../..
100100
dockerfile: Dockerfile
101101
environment:
102-
CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-left.yaml
102+
CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-a.yaml
103103
volumes: *x-volumes
104104
ports:
105-
- "${PROXY_LEFT_EXTERNAL_PORT}:${PROXY_LEFT_INTERNAL_PORT}"
106-
- "${PROXY_LEFT_METRICS_EXTERNAL_PORT}:${PROXY_METRICS_INTERNAL_PORT}"
105+
- "${PROXY_A_EXTERNAL_PORT}:${PROXY_A_INTERNAL_PORT}"
106+
- "${PROXY_A_METRICS_EXTERNAL_PORT}:${PROXY_METRICS_INTERNAL_PORT}"
107107
networks:
108108
- develop
109109
depends_on:
110-
temporal-left:
110+
temporal-a:
111111
condition: service_healthy
112-
proxy-right:
112+
proxy-b:
113113
condition: service_healthy
114114
healthcheck: # TODO: Replace with healthcheck endpoint.
115115
test:
@@ -130,9 +130,9 @@ services:
130130
networks:
131131
- develop
132132
depends_on:
133-
proxy-left:
133+
proxy-a:
134134
condition: service_healthy
135-
proxy-right:
135+
proxy-b:
136136
condition: service_healthy
137137

138138
smoke-test:
@@ -141,16 +141,16 @@ services:
141141
networks:
142142
- develop
143143
depends_on:
144-
proxy-left:
144+
proxy-a:
145145
condition: service_healthy
146-
proxy-right:
146+
proxy-b:
147147
condition: service_healthy
148148
volumes: *x-volumes
149149
environment:
150-
TEMPORAL_LEFT_INBOUND: "temporal-left:${TEMPORAL_INTERNAL_PORT}"
151-
TEMPORAL_RIGHT_INBOUND: "temporal-right:${TEMPORAL_INTERNAL_PORT}"
152-
PROXY_LEFT_OUTBOUND: "proxy-left:${PROXY_LEFT_INTERNAL_PORT}"
153-
PROXY_RIGHT_OUTBOUND: "proxy-right:${PROXY_RIGHT_INTERNAL_PORT}"
150+
TEMPORAL_A_INBOUND: "temporal-a:${TEMPORAL_INTERNAL_PORT}"
151+
TEMPORAL_B_INBOUND: "temporal-b:${TEMPORAL_INTERNAL_PORT}"
152+
PROXY_A_OUTBOUND: "proxy-a:${PROXY_A_INTERNAL_PORT}"
153+
PROXY_B_OUTBOUND: "proxy-b:${PROXY_B_INTERNAL_PORT}"
154154
command:
155155
- /etc/develop/docker-compose/smoke-test.sh
156156

develop/docker-compose/develop.env

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
11
# External Ports (exposed via localhost)
2-
TEMPORAL_LEFT_EXTERNAL_PORT=4000
3-
TEMPORAL_RIGHT_EXTERNAL_PORT=5000
4-
PROXY_LEFT_EXTERNAL_PORT=4001
5-
PROXY_RIGHT_EXTERNAL_PORT=5001
6-
PROXY_LEFT_METRICS_EXTERNAL_PORT=4091
7-
PROXY_RIGHT_METRICS_EXTERNAL_PORT=5091
2+
TEMPORAL_A_EXTERNAL_PORT=4000
3+
TEMPORAL_B_EXTERNAL_PORT=5000
4+
PROXY_A_EXTERNAL_PORT=4001
5+
PROXY_B_EXTERNAL_PORT=5001
6+
PROXY_A_METRICS_EXTERNAL_PORT=4091
7+
PROXY_B_METRICS_EXTERNAL_PORT=5091
88
PROMETHEUS_EXTERNAL_PORT=9090
9-
TEMPORAL_LEFT_UI_EXTERNAL_PORT=4233
10-
TEMPORAL_RIGHT_UI_EXTERNAL_PORT=5233
9+
TEMPORAL_A_UI_EXTERNAL_PORT=4233
10+
TEMPORAL_B_UI_EXTERNAL_PORT=5233
1111

1212
# Internal Ports (exposed on containers in docker network)
1313
TEMPORAL_INTERNAL_PORT=7233
1414
TEMPORAL_UI_INTERNAL_PORT=8233
15-
PROXY_LEFT_INTERNAL_PORT=6233
16-
PROXY_RIGHT_INTERNAL_PORT=6333
15+
PROXY_A_INTERNAL_PORT=6233
16+
PROXY_B_INTERNAL_PORT=6333
1717
PROXY_MUX_INTERNAL_PORT=6334
1818
PROXY_PPROF_INTERNAL_PORT=6060
1919
PROXY_METRICS_INTERNAL_PORT=9091

develop/docker-compose/develop.prometheus.tmpl.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@ global:
22
scrape_interval: 15s
33

44
scrape_configs:
5-
- job_name: proxy-left
5+
- job_name: proxy-a
66
static_configs:
7-
- targets: ["proxy-left:${PROXY_METRICS_INTERNAL_PORT}"]
7+
- targets: ["proxy-a:${PROXY_METRICS_INTERNAL_PORT}"]
88

9-
- job_name: proxy-right
9+
- job_name: proxy-b
1010
static_configs:
11-
- targets: ["proxy-right:${PROXY_METRICS_INTERNAL_PORT}"]
11+
- targets: ["proxy-b:${PROXY_METRICS_INTERNAL_PORT}"]

develop/docker-compose/develop.proxy-left.tmpl.yaml renamed to develop/docker-compose/develop.proxy-a.tmpl.yaml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
clusterConnections:
2-
- name: "cluster-left"
2+
- name: "cluster-a"
33
local:
44
connectionType: "tcp"
55
tcpClient:
6-
address: "temporal-left:${TEMPORAL_INTERNAL_PORT}"
6+
address: "temporal-a:${TEMPORAL_INTERNAL_PORT}"
77
tcpServer:
8-
address: "0.0.0.0:${PROXY_LEFT_INTERNAL_PORT}"
8+
address: "0.0.0.0:${PROXY_A_INTERNAL_PORT}"
99
remote:
1010
connectionType: "mux-client"
1111
muxCount: 1
1212
muxAddressInfo:
13-
address: "proxy-right:${PROXY_MUX_INTERNAL_PORT}"
13+
address: "proxy-b:${PROXY_MUX_INTERNAL_PORT}"
1414
profiling:
1515
pprofAddress: "0.0.0.0:${PROXY_PPROF_INTERNAL_PORT}"
1616
metrics:

develop/docker-compose/develop.proxy-right.tmpl.yaml renamed to develop/docker-compose/develop.proxy-b.tmpl.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
clusterConnections:
2-
- name: "cluster-right"
2+
- name: "cluster-b"
33
local:
44
connectionType: "tcp"
55
tcpClient:
6-
address: "temporal-right:${TEMPORAL_INTERNAL_PORT}"
6+
address: "temporal-b:${TEMPORAL_INTERNAL_PORT}"
77
tcpServer:
8-
address: "0.0.0.0:${PROXY_RIGHT_INTERNAL_PORT}"
8+
address: "0.0.0.0:${PROXY_B_INTERNAL_PORT}"
99
remote:
1010
connectionType: "mux-server"
1111
muxCount: 1

develop/docker-compose/smoke-test.sh

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,22 @@ set -e
44
sleep 20 # TODO: remove after addition of reliable s2s-proxy healthcheck endpoint.
55

66
# connectivity (also covered by docker-compose healthcheck)
7-
temporal operator cluster health --address "$TEMPORAL_LEFT_INBOUND"
8-
temporal operator cluster health --address "$TEMPORAL_RIGHT_INBOUND"
7+
temporal operator cluster health --address "$TEMPORAL_A_INBOUND"
8+
temporal operator cluster health --address "$TEMPORAL_B_INBOUND"
99

10-
# cross-server proxy-left routes to temporal-right
11-
NS_L="smoketest-left-$$"
12-
temporal operator namespace create "$NS_L" --retention 24h --address "$TEMPORAL_RIGHT_INBOUND"
13-
temporal operator namespace describe "$NS_L" --address "$PROXY_LEFT_OUTBOUND"
10+
# cross-server proxy-a routes to temporal-b
11+
NS_A="smoketest-a-$$"
12+
temporal operator namespace create "$NS_A" --retention 24h --address "$TEMPORAL_B_INBOUND"
13+
temporal operator namespace describe "$NS_A" --address "$PROXY_A_OUTBOUND"
1414

15-
# cross-server proxy-right routes to temporal-left
16-
NS_R="smoketest-right-$$"
17-
temporal operator namespace create "$NS_R" --retention 24h --address "$TEMPORAL_LEFT_INBOUND"
18-
temporal operator namespace describe "$NS_R" --address "$PROXY_RIGHT_OUTBOUND"
15+
# cross-server proxy-b routes to temporal-a
16+
NS_B="smoketest-b-$$"
17+
temporal operator namespace create "$NS_B" --retention 24h --address "$TEMPORAL_A_INBOUND"
18+
temporal operator namespace describe "$NS_B" --address "$PROXY_B_OUTBOUND"
1919

2020
# outbound route is routed through each proxy
2121
# 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')
22-
temporal operator cluster describe --address "$PROXY_LEFT_OUTBOUND"
23-
temporal operator cluster describe --address "$PROXY_RIGHT_OUTBOUND"
22+
temporal operator cluster describe --address "$PROXY_A_OUTBOUND"
23+
temporal operator cluster describe --address "$PROXY_B_OUTBOUND"
2424

2525
echo "smoke tests succeeded. 🚬"

0 commit comments

Comments
 (0)