-
Notifications
You must be signed in to change notification settings - Fork 8
Add development docker-compose environment #196
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -32,6 +32,7 @@ go.work.sum | |
| *.key | ||
| build/ | ||
| bins/ | ||
| **/tmp/ | ||
|
|
||
| # Claude Code settings | ||
| .claude/ | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,138 @@ | ||
| x-volumes: &x-volumes | ||
| - ./..:/etc/develop:ro | ||
|
|
||
| services: | ||
| temporal-left: | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. can we use temporal-a and temporal-b instead of left/right? a, b is normally we used to name clusters. same for proxy naming.
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I agree, A/B is a better naming than right/left, and will scale out better. There's nothing special about the existing right/left naming.
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agreed. There's a mismatch in the package between a/b and left/right - I saw left/right was used most-recently, so copied that. I'll add consolidation of naming semantics as a follow-up PR. |
||
| image: temporalio/temporal:1.5.0 | ||
| command: | ||
| - server | ||
| - start-dev | ||
| - --port | ||
| - "${TEMPORAL_INTERNAL_PORT}" | ||
| - --ip | ||
| - "0.0.0.0" | ||
| - --headless | ||
| - --namespace | ||
| - default | ||
| - --log-level | ||
| - warn | ||
| ports: | ||
| - "${TEMPORAL_LEFT_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}" | ||
| networks: | ||
| - develop | ||
| healthcheck: | ||
| test: | ||
| - CMD | ||
| - temporal | ||
| - operator | ||
| - cluster | ||
| - health | ||
| - --address | ||
| - "localhost:${TEMPORAL_INTERNAL_PORT}" | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 30 | ||
| start_period: 5s | ||
|
|
||
| temporal-right: | ||
| image: temporalio/temporal:1.5.0 | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. For proper testing, will need to use a full temporal server setup - I don't believe cli development tool is sufficient, because I believe the server version is pinned. |
||
| command: | ||
| - server | ||
| - start-dev | ||
| - --port | ||
| - "${TEMPORAL_INTERNAL_PORT}" | ||
| - --ip | ||
| - "0.0.0.0" | ||
| - --headless | ||
| - --namespace | ||
| - default | ||
| - --log-level | ||
| - warn | ||
| ports: | ||
| - "${TEMPORAL_RIGHT_EXTERNAL_PORT}:${TEMPORAL_INTERNAL_PORT}" | ||
| networks: | ||
| - develop | ||
| healthcheck: | ||
| test: | ||
| - CMD | ||
| - temporal | ||
| - operator | ||
| - cluster | ||
| - health | ||
| - --address | ||
| - "localhost:${TEMPORAL_INTERNAL_PORT}" | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 30 | ||
| start_period: 5s | ||
|
|
||
| proxy-right: | ||
| build: | ||
| context: ../.. | ||
| dockerfile: Dockerfile | ||
| environment: | ||
| CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-right.yaml | ||
| volumes: *x-volumes | ||
| ports: | ||
| - "${PROXY_RIGHT_EXTERNAL_PORT}:${PROXY_RIGHT_INTERNAL_PORT}" | ||
| networks: | ||
| - develop | ||
| depends_on: | ||
| temporal-right: | ||
| condition: service_healthy | ||
| healthcheck: # TODO: Replace with healthcheck endpoint. | ||
| test: | ||
| - CMD-SHELL | ||
| - "wget -q -O /dev/null -T 3 http://localhost:6060/debug/pprof/ || exit 1" | ||
|
Comment on lines
+83
to
+86
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. As a followup - I'll add a more robust |
||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 30 | ||
| start_period: 10s | ||
|
|
||
| proxy-left: | ||
| build: | ||
| context: ../.. | ||
| dockerfile: Dockerfile | ||
| environment: | ||
| CONFIG_YML: /etc/develop/docker-compose/tmp/develop.proxy-left.yaml | ||
| volumes: *x-volumes | ||
| ports: | ||
| - "${PROXY_LEFT_EXTERNAL_PORT}:${PROXY_LEFT_INTERNAL_PORT}" | ||
| networks: | ||
| - develop | ||
| depends_on: | ||
| temporal-left: | ||
| condition: service_healthy | ||
| proxy-right: | ||
| condition: service_healthy | ||
| healthcheck: # TODO: Replace with healthcheck endpoint. | ||
| test: | ||
| - CMD-SHELL | ||
| - "wget -q -O /dev/null -T 3 http://localhost:6060/debug/pprof/ || exit 1" | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 30 | ||
| start_period: 10s | ||
|
|
||
| smoke-test: | ||
| image: temporalio/temporal:1.5.0 | ||
| entrypoint: /bin/sh | ||
| networks: | ||
| - develop | ||
| depends_on: | ||
| proxy-left: | ||
| condition: service_healthy | ||
| proxy-right: | ||
| 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}" | ||
| command: | ||
| - /etc/develop/docker-compose/smoke-test.sh | ||
|
|
||
| networks: | ||
| develop: | ||
| driver: bridge | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| # 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 | ||
|
|
||
| # Internal Ports (exposed on containers in docker network) | ||
| TEMPORAL_INTERNAL_PORT=7233 | ||
| PROXY_LEFT_INTERNAL_PORT=6233 | ||
| PROXY_RIGHT_INTERNAL_PORT=6333 | ||
| PROXY_MUX_INTERNAL_PORT=6334 |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| clusterConnections: | ||
| - name: "cluster-left" | ||
| local: | ||
| connectionType: "tcp" | ||
| tcpClient: | ||
| address: "temporal-left:${TEMPORAL_INTERNAL_PORT}" | ||
| tcpServer: | ||
| address: "0.0.0.0:${PROXY_LEFT_INTERNAL_PORT}" | ||
| remote: | ||
| connectionType: "mux-client" | ||
| muxCount: 1 | ||
| muxAddressInfo: | ||
| address: "proxy-right:${PROXY_MUX_INTERNAL_PORT}" | ||
| profiling: | ||
| pprofAddress: "0.0.0.0:6060" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| clusterConnections: | ||
| - name: "cluster-right" | ||
| local: | ||
| connectionType: "tcp" | ||
| tcpClient: | ||
| address: "temporal-right:${TEMPORAL_INTERNAL_PORT}" | ||
| tcpServer: | ||
| address: "0.0.0.0:${PROXY_RIGHT_INTERNAL_PORT}" | ||
| remote: | ||
| connectionType: "mux-server" | ||
| muxCount: 1 | ||
| muxAddressInfo: | ||
| address: "0.0.0.0:${PROXY_MUX_INTERNAL_PORT}" | ||
| profiling: | ||
| pprofAddress: "0.0.0.0:6060" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,25 @@ | ||
| #!/bin/sh | ||
| 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" | ||
|
|
||
| # 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-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" | ||
|
|
||
| # 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" | ||
|
|
||
| echo "smoke tests succeeded. 🚬" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I followed existing semantics of some examples calling these "
proxyLeft" and"proxyRight" - I'm not sure if this is our preferred semantic, especially when we introduce more than 2 proxy nodes.