binder-control
CLI for launching and managing binder server processes
binder-control
is the main module for launching/managing all server-side Binder components. At
it's core, it's a fairly thin wrapper around the PM2
process manager that also manages optional background services (a database, a logging stack,...)
using Docker Compose.
Services
binder-control
provides built-in options for deploying the end-to-end system with either a local
version of Kubernetes (using Vagrant with VirtualBox), or with a small, preconfigured Kubernetes
cluster running on GCE.
Database
binder-control start-service db
The db
service will launch a Docker container running Mongo DB (with other launch details
specified in the binder-control
configuration file).
Logging
binder-control start-service logging
The logging
service launches three Docker containers running the ELK stack (Elasticsearch,
Logstash and Kibana) for collecting and indexing log messages generated by other Binder components.
If you would like to use your own logging infrastructure (i.e. use an Elasticsearch cluster for
higher logging throughput), check out binder-logging
for details on how to swap out the logging
service with your existing infrastructure.
Kubernetes
binder-control start-service kubernetes
The kubernetes
service, launched with the command binder-control start-service kubernetes
,
will spin up a virtual machine running Kubernetes, and will insert a kubectl
binary onto your
path that can interface with this VM. This service depends on VirtualBox and Vagrant
(installation instructions here and
here respectively), which must be preinstalled
separately.
This Kubernetes VM will only be accessible on the local machine, and will not be accessible through
the binder-web
interface -- it should only be used for testing binder-deploy-kubernetes
during
development.
prerequisites
- PM2:
npm install pm2 -g
- (optional, for background services only) Docker: https://docs.docker.com/linux/step_one/
- (optional, for background services only) Docker Compose: https://docs.docker.com/engine/installation/linux/ubuntulinux/
- (optional, for Kubernetes service only) Vagrant: https://www.vagrantup.com/downloads.html
- (optional, for Kubernetes service only) VirtualBox: https://www.virtualbox.org/wiki/Downloads
install
binder-control
is designed to be installed globally and used from the command line.
npm install binder-control -g
starting
If you want to use the provided logging stack, DB infrastructure, or Kubernetes test VM, the very
first step is to launch these services using Docker Compose:
binder-control start-service (db|logging|kubernetes)
Once the services are all up and running, you can spin up the actual Binder servers...
with a single command, using default options:
binder-control start-all
or individually, with custom configuration files
binder-control (build|deploy-kubernetes) start --api-key=<key> --config=/path/to/config
managing
All services and servers launched by binder-control
are managed by the PM2 process manager.
To check on the status of all binder-control
managed processes, see restart counts and uptime
information:
pm2 list
To see any console output or logging information:
pm2 logs <process name>
stopping
To stop background services, use the stop-service
command
binder-control stop-service (db|logging|kubernetes)
To stop Binder servers, use the server name as the subcommand
binder-control (build|deploy-kubernetes) stop