Skip to content

Commit

Permalink
docker-ephemeral: Run federation-v0 services for backwards compat tes…
Browse files Browse the repository at this point in the history
…ting (#3719)

Also in the commit:

Run docker-compose in daemon mode so there is less noise in the terminal.
  • Loading branch information
akshaymankar authored Nov 28, 2023
1 parent c8eb0a7 commit e79c8b0
Show file tree
Hide file tree
Showing 45 changed files with 1,669 additions and 131 deletions.
19 changes: 0 additions & 19 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -40,25 +40,6 @@ services/nginz/src
services/.env
tools/api-simulations/mailboxes.json
tools/api-simulations/reports
brig-schema.yaml
brig.yaml
brig.integration-aws.yaml
cannon.yaml
cannon.integration-aws.yaml
cannon2.integration-aws.yaml
cargohold.yaml
cargohold.integration-aws.yaml
galley-schema.yaml
galley.yaml
galley.integration-aws.yaml
gundeck-schema.yaml
gundeck.yaml
gundeck.integration-aws.yaml
proxy.yaml
proxy.integration-aws.yaml
spar.yaml
spar.integration-aws.yaml
integration-aws.yaml
DOCKER_ID*
swagger-ui

Expand Down
1 change: 1 addition & 0 deletions changelog.d/5-internal/docker-mandarin
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deploy a backend with federation API V0 while setting up services for local testing
1 change: 1 addition & 0 deletions deploy/dockerephemeral/coredns-config/db.example.com
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ _wire-server-federator._tcp.b IN SRV 0 0 9443 localhost.
_wire-server-federator._tcp.d1 IN SRV 0 0 10443 localhost.
_wire-server-federator._tcp.d2 IN SRV 0 0 11443 localhost.
_wire-server-federator._tcp.d3 IN SRV 0 0 12443 localhost.
_wire-server-federator._tcp.v0 IN SRV 0 0 21443 localhost.
39 changes: 22 additions & 17 deletions deploy/dockerephemeral/docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,23 @@
version: '2'
networks:
demo_wire:
external: false

redis:
driver: bridge
ipam:
config:
- subnet: 172.20.0.0/24

coredns:
driver: bridge
ipam:
config:
- subnet: 172.20.1.0/24

demo_wire:
driver: bridge
ipam:
config:
- subnet: 172.20.2.0/24

services:
fake_dynamodb:
container_name: demo_wire_dynamodb
Expand Down Expand Up @@ -67,20 +76,6 @@ services:
networks:
- demo_wire

# activemq:
# image: rmohr/activemq:5.15.4
# ports:
# - "61613:61613"

# FIXME: replace redis image with one we build.
redis:
container_name: demo_wire_redis
image: redis:3.0.7-alpine
ports:
- "127.0.0.1:6379:6379"
networks:
- demo_wire

redis-cluster:
image: 'redis:6.0-alpine'
command: redis-cli --cluster create 172.20.0.31:6373 172.20.0.32:6374 172.20.0.33:6375 172.20.0.34:6376 172.20.0.35:6377 172.20.0.36:6378 --cluster-replicas 1 --cluster-yes
Expand Down Expand Up @@ -197,6 +192,12 @@ services:
environment:
- "CS_JVM_OPTIONS=-Xmx1024M -Xms1024M -Xmn200M"

healthcheck:
test: "nodetool status"
interval: 10s
start_period: 20s
timeout: 2s

# on nixos, you also may need to run
# sysctl -w vm.max_map_count=1048576
# or add that to your `configuration.nix`
Expand Down Expand Up @@ -247,6 +248,7 @@ services:
- ./:/scripts
networks:
- demo_wire

coredns:
image: docker.io/coredns/coredns:1.8.4
volumes:
Expand All @@ -258,6 +260,9 @@ services:
ports:
- "9053:53"
- "9053:53/udp"
networks:
coredns:
ipv4_address: 172.20.1.2

volumes:
redis-node-1-data:
Expand Down
269 changes: 269 additions & 0 deletions deploy/dockerephemeral/federation-v0.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,269 @@
version: '2.3'

networks:
demo_wire:
external: false

services:
brig_schema:
container_name: brig-schema-federation-v0
image: quay.io/wire/brig-schema:4.38.51
command: --host cassandra --keyspace brig_test_federation_v0 --replication-factor 1
depends_on:
cassandra:
condition: service_healthy
deploy:
restart_policy:
condition: on-failure
networks:
- demo_wire
brig:
container_name: brig-federation-v0
image: quay.io/wire/brig:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/brig/conf
networks:
- demo_wire
ports:
- '127.0.0.1:21082:8080'
healthcheck: &haskell_health_check
test: "curl --fail localhost:8080/i/status"
depends_on:
brig_schema:
condition: service_completed_successfully
aws_cli:
condition: service_completed_successfully
init_vhosts:
condition: service_completed_successfully

environment:
- AWS_REGION=eu-west-1
- AWS_ACCESS_KEY_ID=dummykey
- AWS_SECRET_ACCESS_KEY=dummysecret
- RABBITMQ_USERNAME=${RABBITMQ_USERNAME}
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}

galley_schema:
container_name: galley-schema-federation-v0
image: quay.io/wire/galley-schema:4.38.51
command: --host cassandra --keyspace galley_test_federation_v0 --replication-factor 1
depends_on:
cassandra:
condition: service_healthy
deploy:
restart_policy:
condition: on-failure
networks:
- demo_wire

galley:
container_name: galley-federation-v0
image: quay.io/wire/galley:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/galley/conf
networks:
- demo_wire
ports:
- '127.0.0.1:21085:8080'
healthcheck: *haskell_health_check
depends_on:
galley_schema:
condition: service_completed_successfully
aws_cli:
condition: service_completed_successfully
init_vhosts:
condition: service_completed_successfully

environment:
- AWS_REGION=eu-west-1
- AWS_ACCESS_KEY_ID=dummykey
- AWS_SECRET_ACCESS_KEY=dummysecret
- RABBITMQ_USERNAME=${RABBITMQ_USERNAME}
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}

cargohold:
container_name: cargohold-federation-v0
image: quay.io/wire/cargohold:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/cargohold/conf
networks:
- demo_wire
ports:
- '127.0.0.1:21084:8080'
healthcheck: *haskell_health_check
depends_on:
aws_cli:
condition: service_completed_successfully

environment:
- AWS_REGION=eu-west-1
- AWS_ACCESS_KEY_ID=dummykey
- AWS_SECRET_ACCESS_KEY=dummysecret

gundeck_schema:
container_name: gundeck-schema-federation-v0
image: quay.io/wire/gundeck-schema:4.38.51
command: --host cassandra --keyspace gundeck_test_federation_v0 --replication-factor 1
depends_on:
cassandra:
condition: service_healthy
deploy:
restart_policy:
condition: on-failure
networks:
- demo_wire

gundeck:
container_name: gundeck-federation-v0
image: quay.io/wire/gundeck:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/gundeck/conf
networks:
- demo_wire
ports:
- '127.0.0.1:21086:8080'
healthcheck: *haskell_health_check
depends_on:
gundeck_schema:
condition: service_completed_successfully
aws_cli:
condition: service_completed_successfully
redis:
condition: service_started

environment:
- AWS_REGION=eu-west-1
- AWS_ACCESS_KEY_ID=dummykey
- AWS_SECRET_ACCESS_KEY=dummysecret

spar_schema:
container_name: spar-schema-federation-v0
image: quay.io/wire/spar-schema:4.38.51
command: --host cassandra --keyspace spar_test_federation_v0 --replication-factor 1
depends_on:
cassandra:
condition: service_healthy
deploy:
restart_policy:
condition: on-failure
networks:
- demo_wire

spar:
container_name: spar-federation-v0
image: quay.io/wire/spar:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/spar/conf
networks:
- demo_wire
ports:
- '127.0.0.1:21088:8080'
healthcheck: *haskell_health_check
depends_on:
spar_schema:
condition: service_completed_successfully

cannon:
container_name: cannon-federation-v0
image: quay.io/wire/cannon:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/cannon/conf
networks:
- demo_wire
ports:
- '127.0.0.1:21083:8080'
healthcheck: *haskell_health_check

federator:
container_name: federator-federation-v0
image: quay.io/wire/federator:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/federator/conf
networks:
- demo_wire
- coredns
ports:
- '127.0.0.1:21097:8080'
- '127.0.0.1:21098:8081'
healthcheck: *haskell_health_check
depends_on:
coredns-federation:
condition: service_started

background_worker:
container_name: background-worker-federation-v0
image: quay.io/wire/background-worker:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/background-worker/conf
networks:
- demo_wire
ports:
- '127.0.0.1:21089:8080'
depends_on:
init_vhosts:
condition: service_completed_successfully
environment:
- RABBITMQ_USERNAME=${RABBITMQ_USERNAME}
- RABBITMQ_PASSWORD=${RABBITMQ_PASSWORD}

proxy:
container_name: proxy-federation-v0
image: quay.io/wire/proxy:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/proxy/conf
networks:
- demo_wire
ports:
- '127.0.0.1:21087:8080'
healthcheck: *haskell_health_check

nginz:
container_name: nginz-federation-v0
image: quay.io/wire/nginz:4.38.0-mandarin.14
volumes:
- ./federation-v0:/etc/wire/
networks:
- demo_wire
ports:
- '127.0.0.1:21080:8080'
- '127.0.0.1:21443:8443'
depends_on:
brig:
condition: service_healthy
galley:
condition: service_healthy
gundeck:
condition: service_healthy
cargohold:
condition: service_healthy
cannon:
condition: service_healthy
spar:
condition: service_healthy
federator:
condition: service_healthy
proxy:
condition: service_healthy

# We have to run a separate redis instance for each version of wire-server we
# want. This is because gundeck just assumes the whole redis is for itself
redis:
container_name: redis-federation-v0
image: redis:6.0-alpine
networks:
- demo_wire

# This coredns serves slightly different SRV records, so federator running in
# a docker container can talk to federator running on the host.
coredns-federation:
image: docker.io/coredns/coredns:1.8.4
volumes:
- ./federation-v0/coredns-config:/coredns-config
entrypoint:
- /coredns
- -conf
- /coredns-config/Corefile
networks:
coredns:
ipv4_address: 172.20.1.3

Loading

0 comments on commit e79c8b0

Please sign in to comment.