Iteration 4: Orchestration. Docker Swarm

Learning objective

Deploying systems having multiple services deployed using Docker Swarm.

Deadline

October 12th at 23.59

Exercise 'swarm-quote'

Initialize your Docker installation to run in 'swarm' mode, and create a docker compose file that starts a SkyCave Daemon, and a QuoteService based upon 'henrikbaerbak/quote:msdo_1_0_1'. All other services can be the default test double variants.

Exercise 'swarm-db' (*) [M 60]

Now, to start your SkyCave backtier, you need to start two containers: the daemon and the Redis db; and you need to bind them together using a docker network. Manual procedures are not DevOps... We instead need infrastructure-as-code!

Initialize your Docker installation to run in 'swarm' mode, and create a docker compose file that allows starting, updating, and stopping a full SkyCave server side system, on a named network.

Requirements:

Hand-in:

Evaluation: I will evaluate along two learning goals. I will use the grade sheet to evaluate your submission. As compose files are pretty complex and involve quite a learning curve, I will then multiply the total by three to get your final score.

Learning Goal Assessment parameters
Analyzability The compose file is easy to analyze (read, understand, reason correctly about). The compose file contains a preamble outlining how to use it (stack deploy command, image build instruction, etc.)
Correctness I will (as best possible) evaluate correctness of the composefile from your screenshots, the file contents, and potential execution. The screenshots must be detailed and comprehensive enough that I can convince myself that everything works correctly.

Exercise 'swarm-db-quote'

Create a compose file 'swarm-db-quote.yml' that starts a SkyCave daemon, a 'henrikbaerbak/quote:msdo_1_0_1' quote service, and a Redis, correctly configured.

Next, add Docker visualizer support.

Exercise 'update-swarm-db'

Do a) deploy swarm-db stack b) make some trivial modification of skycave daemon source code and resulting container c) update the swarm-db by redeploying. What happens?

Exercise 'real-swarm-db' [M 20]

Create a swarm consisting of at least two (virtual) machines, one with larger disk space allocated to host the db, and one node running the Docker visualizer.

Requirements:

Hand-in:

Evaluation: I will evaluate analyzability and correctness, with (0,4,7,10) points for each learning goal.

Learning Goal Assessment parameters
Analyzability The compose file is easy to analyze (read, understand, reason correctly about). The compose file contains a preamble outlining how to use it (build instruction, stack deploy command, etc.)
Correctness I will (as best possible) evaluate correctness of the composefile from your screenshots, the file contents, and potential execution. The screenshots must be detailed and comprehensive enough that I can convince myself that everything works correctly.

Exercise 'operations-swarm' [M 20]

Production Checkpoint! Update your production environment, so your production server(s) are configured as a docker swarm and deploys the SkyCave system using a composefile. (No need for multiple VMs, it is just fine just to run swarm mode on your single cloud VM.)

Requirements:

Hand-in: Submit screenshot(s) with shells on your production server that shows

  1. The IP address of your server ('ifconfig eth0' or 'ifconfig ens32').
  2. Output of 'docker stack ps' showing deployed services.
  3. Evidence that Redis stores data on the production/host machine (volume mounts, directory contents, ...)

Evaluation: I will review your output and award 20 points if provided artefacts convince me that your production system is swarm based.. I may log into your production server using your Cmd, DIG a room, and ask you to find that room in the database at any time during the course.

Exercise 'portainer'

Play around with https://www.portainer.io/, a web ui for container management. Hm, it used to be 'free' but seems to have become 'free trial' now.