Skip to content

thehivecorporation/docker-commander

Repository files navigation

docker-commander

Build Status

A GUI to supervise Docker Swarm.

desktop_full_screen mobile

Some info

Running Tests

Mock tests

# With npm
npm test

# Without npm
go test `go list ./... | grep -v tests`

Integration tests

Requires some config like an ETCD local installation, Swarm Manager and Swarm Agents. Can be easily achieved via ansible playbooks included.

# With npm
npm run test-integration

# Without npm
go test ./tests/integration/...

Running the app

Docker Commander uses Go in backend and React in front. React is managed by NPM so you need it installed and npm scripts to run Browserify:

git clone https://github.com/sayden/docker-commander.git
cd docker-commander
npm install   #will trigger npm run browserify
go run main.go

Open localhost:8000 to show the mocked server. You can then tweak config/config.go to fit your needs.

Architecture

alt text

Requirements

Requirements file for the MVP project can be found on REQUIREMENTS.md

Gin Gonic Server

Discovery clients

Maintains state of the app and connected Swarm agents in cluster. Currently there is implementation for ETCD and Consul and their hosts must be written in config/config.go file

NOTE: Consul client API needs hosts without 'http://' prefix as it already uses it

  • Watch 2 events:
    • New Agent in cluster: Emits new-agent event in server
    • Agent down in cluster: Emits kill-agent event in server

REST Client

Will be used by server to make REST connections to Swarm Agents and Manager and return JSON info "as is" back to front via web-socket.

Socket API

An API via socket layer to communicate real-time with front. Because it's bi-directional it is described as follows:

Client->Server

  • cluster: Returns a json with the entire cluster state. Mainly used when a client has just connected to the app
  • agent:containers: Replicates GET /containers/json. Needs image IP and optional parameters like in Docker API
  • agent:images: Replicates GET /images/json

Server->Client

  • new-agent: When a new Swarm Agent has joined the cluster
  • kill-agent: When an already existing Swarm Agent has left the cluster

Front (React+Redux)

Front is done using React + Redux + Material-Ui. The following actions are defined in Redux store actions file

About

A mobile friendly GUI to supervise Docker and Docker Swarm

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages