Skip to content
This repository has been archived by the owner on Sep 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request vitessio#5994 from keeferrourke/master
Browse files Browse the repository at this point in the history
Refactor vtcompose for improved testability
  • Loading branch information
sougou authored Mar 31, 2020
2 parents 5072744 + b85e930 commit 1735698
Show file tree
Hide file tree
Showing 3 changed files with 570 additions and 108 deletions.
318 changes: 318 additions & 0 deletions examples/compose/vtcompose/docker-compose.test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,318 @@
# This file was generated by running `go run vtcompose/vtcompose.go` with no arguments.

services:
consul1:
command: agent -server -bootstrap-expect 3 -ui -disable-host-node-id -client 0.0.0.0
hostname: consul1
image: consul:latest
ports:
- 8400:8400
- 8500:8500
- 8600:8600
consul2:
command: agent -server -retry-join consul1 -disable-host-node-id
depends_on:
- consul1
expose:
- "8400"
- "8500"
- "8600"
hostname: consul2
image: consul:latest
consul3:
command: agent -server -retry-join consul1 -disable-host-node-id
depends_on:
- consul1
expose:
- "8400"
- "8500"
- "8600"
hostname: consul3
image: consul:latest
schemaload_test_keyspace:
command:
- sh
- -c
- /script/schemaload.sh
depends_on:
vttablet101:
condition: service_healthy
vttablet201:
condition: service_healthy
environment:
- TOPOLOGY_FLAGS=-topo_implementation consul -topo_global_server_address consul1:8500
-topo_global_root vitess/global
- WEB_PORT=8080
- GRPC_PORT=15999
- CELL=test
- KEYSPACE=test_keyspace
- TARGETTAB=test-0000000101
- SLEEPTIME=15
- VSCHEMA_FILE=test_keyspace_vschema.json
- SCHEMA_FILES=test_keyspace_schema_file.sql
- POST_LOAD_FILE=
- EXTERNAL_DB=0
image: vitess/base
volumes:
- .:/script
schemaload_unsharded_keyspace:
command:
- sh
- -c
- /script/schemaload.sh
depends_on:
vttablet301:
condition: service_healthy
environment:
- TOPOLOGY_FLAGS=-topo_implementation consul -topo_global_server_address consul1:8500
-topo_global_root vitess/global
- WEB_PORT=8080
- GRPC_PORT=15999
- CELL=test
- KEYSPACE=unsharded_keyspace
- TARGETTAB=test-0000000301
- SLEEPTIME=15
- VSCHEMA_FILE=unsharded_keyspace_vschema.json
- SCHEMA_FILES=unsharded_keyspace_schema_file.sql
- POST_LOAD_FILE=
- EXTERNAL_DB=0
image: vitess/base
volumes:
- .:/script
vtctld:
command:
- sh
- -c
- ' $$VTROOT/bin/vtctld -topo_implementation consul -topo_global_server_address
consul1:8500 -topo_global_root vitess/global -cell test -workflow_manager_init
-workflow_manager_use_election -service_map ''grpc-vtctl'' -backup_storage_implementation
file -file_backup_storage_root $$VTDATAROOT/backups -logtostderr=true -port
8080 -grpc_port 15999 -pid_file $$VTDATAROOT/tmp/vtctld.pid '
depends_on:
- consul1
- consul2
- consul3
image: vitess/base
ports:
- 15000:8080
- "15999"
volumes:
- .:/script
vtgate:
command:
- sh
- -c
- '/script/run-forever.sh $$VTROOT/bin/vtgate -topo_implementation consul -topo_global_server_address
consul1:8500 -topo_global_root vitess/global -logtostderr=true -port 8080 -grpc_port
15999 -mysql_server_port 15306 -mysql_auth_server_impl none -cell test -cells_to_watch
test -tablet_types_to_wait MASTER,REPLICA,RDONLY -gateway_implementation discoverygateway
-service_map ''grpc-vtgateservice'' -pid_file $$VTDATAROOT/tmp/vtgate.pid -normalize_queries=true '
depends_on:
- vtctld
image: vitess/base
ports:
- 15099:8080
- "15999"
- 15306:15306
volumes:
- .:/script
vttablet101:
command:
- sh
- -c
- /script/vttablet-up.sh 101
depends_on:
- vtctld
environment:
- TOPOLOGY_FLAGS=-topo_implementation consul -topo_global_server_address consul1:8500
-topo_global_root vitess/global
- WEB_PORT=8080
- GRPC_PORT=15999
- CELL=test
- KEYSPACE=test_keyspace
- SHARD=-80
- ROLE=master
- VTHOST=vttablet101
- EXTERNAL_DB=0
- DB_PORT=
- DB_HOST=
- DB_USER=
- DB_PASS=
- DB_CHARSET=
healthcheck:
interval: 30s
retries: 15
test:
- CMD-SHELL
- curl localhost:8080/debug/health
timeout: 10s
image: vitess/base
ports:
- 15101:8080
- "15999"
- "3306"
volumes:
- .:/script
vttablet102:
command:
- sh
- -c
- /script/vttablet-up.sh 102
depends_on:
- vtctld
environment:
- TOPOLOGY_FLAGS=-topo_implementation consul -topo_global_server_address consul1:8500
-topo_global_root vitess/global
- WEB_PORT=8080
- GRPC_PORT=15999
- CELL=test
- KEYSPACE=test_keyspace
- SHARD=-80
- ROLE=replica
- VTHOST=vttablet102
- EXTERNAL_DB=0
- DB_PORT=
- DB_HOST=
- DB_USER=
- DB_PASS=
- DB_CHARSET=
healthcheck:
interval: 30s
retries: 15
test:
- CMD-SHELL
- curl localhost:8080/debug/health
timeout: 10s
image: vitess/base
ports:
- 15102:8080
- "15999"
- "3306"
volumes:
- .:/script
vttablet201:
command:
- sh
- -c
- /script/vttablet-up.sh 201
depends_on:
- vtctld
environment:
- TOPOLOGY_FLAGS=-topo_implementation consul -topo_global_server_address consul1:8500
-topo_global_root vitess/global
- WEB_PORT=8080
- GRPC_PORT=15999
- CELL=test
- KEYSPACE=test_keyspace
- SHARD=80-
- ROLE=master
- VTHOST=vttablet201
- EXTERNAL_DB=0
- DB_PORT=
- DB_HOST=
- DB_USER=
- DB_PASS=
- DB_CHARSET=
healthcheck:
interval: 30s
retries: 15
test:
- CMD-SHELL
- curl localhost:8080/debug/health
timeout: 10s
image: vitess/base
ports:
- 15201:8080
- "15999"
- "3306"
volumes:
- .:/script
vttablet202:
command:
- sh
- -c
- /script/vttablet-up.sh 202
depends_on:
- vtctld
environment:
- TOPOLOGY_FLAGS=-topo_implementation consul -topo_global_server_address consul1:8500
-topo_global_root vitess/global
- WEB_PORT=8080
- GRPC_PORT=15999
- CELL=test
- KEYSPACE=test_keyspace
- SHARD=80-
- ROLE=replica
- VTHOST=vttablet202
- EXTERNAL_DB=0
- DB_PORT=
- DB_HOST=
- DB_USER=
- DB_PASS=
- DB_CHARSET=
healthcheck:
interval: 30s
retries: 15
test:
- CMD-SHELL
- curl localhost:8080/debug/health
timeout: 10s
image: vitess/base
ports:
- 15202:8080
- "15999"
- "3306"
volumes:
- .:/script
vttablet301:
command:
- sh
- -c
- /script/vttablet-up.sh 301
depends_on:
- vtctld
environment:
- TOPOLOGY_FLAGS=-topo_implementation consul -topo_global_server_address consul1:8500
-topo_global_root vitess/global
- WEB_PORT=8080
- GRPC_PORT=15999
- CELL=test
- KEYSPACE=unsharded_keyspace
- SHARD=-
- ROLE=master
- VTHOST=vttablet301
- EXTERNAL_DB=0
- DB_PORT=
- DB_HOST=
- DB_USER=
- DB_PASS=
- DB_CHARSET=
healthcheck:
interval: 30s
retries: 15
test:
- CMD-SHELL
- curl localhost:8080/debug/health
timeout: 10s
image: vitess/base
ports:
- 15301:8080
- "15999"
- "3306"
volumes:
- .:/script
vtwork:
command:
- sh
- -c
- '$$VTROOT/bin/vtworker -topo_implementation consul -topo_global_server_address
consul1:8500 -topo_global_root vitess/global -cell test -logtostderr=true -service_map
''grpc-vtworker'' -port 8080 -grpc_port 15999 -use_v3_resharding_mode=true -pid_file
$$VTDATAROOT/tmp/vtwork.pid '
depends_on:
- vtctld
image: vitess/base
ports:
- 15100:8080
- "15999"
version: "2.1"
Loading

0 comments on commit 1735698

Please sign in to comment.