To explore continuous deployment. To prepare for the forthcoming exam.
October 19th at 23.59
You have to design some kind of actual deployment step, which ensures that your production cave is updated. Either as a direct consequence of the pipeline, like a ssh command on the production server (proactive approach), OR, as part of a scheduled/regular update, like a cron job on the production server (reactive approach).
Requirements: A successfull run of the CI pipeline that ends in a new release of an update skycave image, should result in your production servers being updated.
Hand-in Submit a Word or PDF report containing:
Evaluation: I will award full 40 points for a report that concisely demonstrate your CD pipeline. Incorrect and/or ill explained aspects may subtract points.
The final exam is individual! So create your own private bitbucket/gitlab account and your own private docker hub account. And get the latest source code, and ensure your development environment supports building, testing, and execution of SkyCave, building and running docker images, and supports compose files in swarm mode.
A feature of SkyCave that will be used at the exam, is the ability to dynamically add new commands to the 'cmd' by updating the server only. To do that, the SkyCave daemon utilizes the Command Pattern.
Requirements:
cloud.cave.extension
package. Note that
Command classes must be in this package.
== Welcome to SkyCave, player Mikkel == Entering command loop, type "q" to quit, "h" for help. > exec PlusCommand 64 32 The result is: 96. > exec PlusCommand 999 777 The result is: 1776.
The Command you develop at the exam will be contacting a REST service, provided by me. Be sure you have a working knowledge of the UniRest HTTP client (or whatever you choose) framework, and can find code blocks to reuse from your quote service and subscription service implementations.
Requirements:
== Welcome to SkyCave, player Mikkel == Entering command loop, type "q" to quit, "h" for help. > exec QuoteCommand 34 To dare is to lose one's footing momentarily. Not to dare is to lose oneself. By: Søren Kierkegaard
Redo the 'docker-hello-spark' exercise from the grounds up.
You will at the exam be asked to create a Gradle based Java project with Java source code and build file that I provide, and asked to create a docker image, via a Dockerfile, as deployment unit.
Redo the 'swarm-quote' exercise from the grounds up.
You will at the exam be asked to create a swarm compose-file that includes SkyCave daemon and some new service(s).
Analyze SkyCave for potential treading issues. Our HTTP URI Tunnel ClientRequestHandler/ServerRequestHandler uses Spark-Java which again relies on Jetty, which handles incoming request in a thread pool, so high volume traffic poses a concurrency situation.
This is a purely optional exercise, quite implementation heavy, and SkyCave is not really coded for this (yet), so be prepared to 'hack' quite a bit. And, its outcome will not be of any importance for the rest of the course. It is mostly added as my own recipe for solving the issue that cmd-daemon communication is not encrypted, which is less-than-ideal.
The 'cmd' and 'daemon' use the FRDS.Broker pattern to communicate, defaulting to HTTP / URI tunneling. Actually, the Broker can be configured to run TLS, even though it is not stated in the ReadMe file. Thus - you can run cmd-daemon using a TLS connection.
The client side entails:
crh.setServer(hostname, port);
. The
FRDS.Broker actually overloads this method (rather
unelegantly, but still):
public void setServer(String hostname, int port, boolean useTLS)
Now, the client can talk HTTPS
As usual, the server is a bit more complex. The coding, however, is similar.
srh.setPortAndInvoker(port,
objMgr.getInvoker());
, and again you can instead use
the overloaded method
public void setPortAndInvoker(int port, Invoker invoker, boolean useTLS) {Again, a flag must be introduced to set the last parameter to true/false.
javax.net.ssl.keyStore javax.net.ssl.keyStorePasswordThe FRDS.Broker will use these to load the certificate.
task server(type: JavaExec) { group 'Secure Web Server' description 'Run a HTTPS enabled server' classpath sourceSets.main.runtimeClasspath main = 'example.Hello' // This is the trick - use default system props systemProperty("javax.net.ssl.keyStore", "/home/csdev/certificate.keystore") systemProperty("javax.net.ssl.keyStorePassword", "changeit") }
Morale: There is a reason I decided not to let the cmd-daemon communication be encrypted this time around.