Orchestra is a toolkit to manage a fleet of Go binaries/services. A unique place where you can run, stop, aggregate logs and config your Go binaries.
You can find an application design/proposal document here
go get -u github.com/monzo/orchestra
You should have an orchestra.yml
file in your root directory and a service.yml
file in every service directory.
.
├── first-service
│ ├── main.go
│ └── service.yml <- Service file
├── second-service
│ ├── second.go
│ ├── main.go
│ └── service.yml <- Service file
└── orchestra.yml <- Main project file
You can specify a custom configuration file using the --config
flag or setting the ORCHESTRA_CONFIG
env variable.
By default orchestra will use go install
to install your binaries in GOPATH/bin
.
env:
ABC: "somethingGlobal"
before:
- "echo I am a global command before"
after:
- "echo I am a global after"
- start
--option [<service>...]
Starts every service
Options:
--attach, -a
Attach to services output after start
--logs, -l
Start logging after start
- stop
--option [<service>...]
Stops every service - restart
--option [<service>...]
Restarts every service
Options:
--attach, -a
Attach to services output after start
--logs, -l
Start logging after start
- logs
--option [<service>...]
Aggregates the output from the services - test
--option [<service>...]
Runsgo test ./...
for every service
Options:
-v
--verbose
Run tests in verbose mode
-r
--race
Run tests with race condition
- ps Displays the status of every service, process id and the ports in use.
A service name can be prefixed with ~
to run a command in exclusion mode.
For example orchestra start ~second-service
will start everything expect the second-service.
When using
-a
or--attach
with start/restart, the services will be spawned in the same ochestra's process group.
Every command can be configured separately with special environment variables or with before/after commands.
For example, in orchestra.yml
you can configure to echo AFTER START
before running orchestra start
command.
env:
ABC: "A global env variable"
before:
- "echo I am a global command before"
after:
- "echo I am a global after"
start:
env:
ABC: "Override in start"
after:
- "echo AFTER START"
You can use your service.yml
to override the environment variables in a specific service. Variables specified on a service will always have precedence over the global ones.
env:
ABC: "Override in service"
Orchestra supports bash autocomplete.
source $GOPATH/src/github.com/vinceprignano/orchestra/autocomplete/orchestra
Orchestra is licensed under the Apache License, Version 2.0.