Developers have multiple ways to build and test orchestrator.
- Using GitHub's CI, no development environment needed
- Using Docker
- Build locally on dev machine
orchestrator's' CI Build will:
- build
- test (unit, integration)
- upload an artifact: an
orchestratorbinary compatible with Linuxamd64
The artifact is attached in the build's output, and valid for a couple months per GitHub Actions policy.
This way, a developer only needs to git checkout/commit/push and does not require any development environment on their computer. Once CI completes (successfully), the developer may download the binary artifact to test on a Linux environment.
Requirements: a docker installation.
orchestrator provides various docker builds. For developers:
- run
script/dock alpineto build and runorchestratorservice - run
script/dock testto buildorchestrator, run unit tests, integration tests, documentation tests - run
script/dock pkgto buildorchestratorand create distribution packages (.deb/.rpm/.tgz) - run
script/dock systemto build and launch a full CI environment which includes a MySQL topology, HAProxy, Consul, consul-template andorchestratorrunning as a service.
Requirements:
godevelopment setup (at this timego1.12or above required)gitgcc(required to buildSQLiteas part of theorchestratorbinary)- Linux, BSD or MacOS
Run:
git clone git@github.com:openark/orchestrator.git
cd orchestrator
Build via:
./script/build
This takes care of GOPATH and various other considerations.
Alternatively, if you like and if your Go environment is setup, you may run:
go build -o bin/orchestrator -i go/cmd/orchestrator/main.go
Find artifacts under bin/ directory and e.g. run:
bin/orchestrator --debug http
If running with SQLite backend, no DB setup is needed. The rest of this section assumes you have a MySQL backend.
For orchestrator to detect your replication topologies, it must also have an account on each and every topology. At this stage this has to be the
same account (same user, same password) for all topologies. On each of your masters, issue the following:
CREATE USER 'orc_user'@'%' IDENTIFIED BY 'orc_password';
GRANT SUPER, PROCESS, REPLICATION SLAVE, RELOAD ON *.* TO 'orc_user'@'%';
Replace % with a specific hostname/127.0.0.1/subnet. Choose your password wisely. Edit orchestrator.conf.json to match:
"MySQLTopologyUser": "orc_user",
"MySQLTopologyPassword": "orc_password",