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
orchestrator
binary 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 alpine
to build and runorchestrator
service - run
script/dock test
to buildorchestrator
, run unit tests, integration tests, documentation tests - run
script/dock pkg
to buildorchestrator
and create distribution packages (.deb/.rpm/.tgz
) - run
script/dock system
to build and launch a full CI environment which includes a MySQL topology, HAProxy, Consul, consul-template andorchestrator
running as a service.
Requirements:
go
development setup (at this timego1.12
or above required)git
gcc
(required to buildSQLite
as part of theorchestrator
binary)- Linux, BSD or MacOS
Run:
git clone [email protected]: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",