An ancillary project, orchestrator-ci-env, provides a MySQL replication environment with which one may evaluate/test orchestrator. Use cases:
- You want to check
orchestrator's behavior on a testing environment. - You want to test failover and master discovery.
- You want to develop changes to
orchestratorand require a reproducible environment.
You may do all of the above if you already have some staging environment with a MySQL replication topology, or a dbdeployer setup, but orchestrator-ci-env offers a Docker-based environment, reproducible and dependency-free.
orchestrator-ci-env is the same environment used in system CI and in Dockerfile.system.
Clone orchestrator-ci-env via SSH or HTTPS:
$ git clone git@github.com:openark/orchestrator-ci-env.gitor
$ git clone https://github.com/openark/orchestrator-ci-env.gitRequirement: Docker.
$ cd orchestrator-ci-env
$ script/dockThis will build and run an environment which conists of:
- A replication topology via DBDeployer, with heartbeat injection
- HAProxy
- Consul
- consul-template
Docker will expose these ports:
10111,10112,10113,10114: MySQL hosts in a replication topology. Initially,10111is the master.13306: exposed by HAProxy and routed to current MySQL topology master.
Assuming orchestrator is built into bin/orchestrator (./script/build if not):
$ bin/orchestrator --config=conf/orchestrator-ci-env.conf.json --debug httpconf/orchestrator-ci-env.conf.json is designed to work with orchestrator-ci-env.
You may choose to change the value of SQLite3DataFile, which is by default on /tmp.
While orchestrator is running (see above), open another terminal in orchestrator's repo path.
Run:
$ ./tests/system/test.shfor all tests, or
$ ./tests/system/test.sh <name-or-regex>for a specific test, e.g. ./tests/system/test.sh relocate-single
Destructive tests (e.g. a failover) require a full rebuild of the replication topology. The system tests CI runs both orchestrator and the ci-env together, and the tests can instruct the ci-env to rebuild replication. However, if you run ci-env on a local docker, your tests cannot instruct a replication rebuild. You will need to manually run ./script/deploy-replication on your ci-env container at the end of a destructive test.