Sunday, September 27, 2015

Jupyter - an educational tool - for demonstrating or teaching about Docker

On Friday I did an N-th presentation and demo of Docker at work as part of an OpenStack training.

Whilst the slides were in Powerpoint-* the demo was conducted principally using Jupyter, the multi-language notebook tool derived from IPython.

* -  this time, but I plan to use Jupyter/RISE for an integrated presentation/demo next time.

As I'd presented Jupyter at a Meetup of our local Grenoble Python User Group on Thursday, and I'm preparing to present at Pyconfr in Pau on October 17th (French) I was eager to really apply Jupyter for some educational use.

Note: I've also submitted a proposal for Confoo in Montreal next February ... you can vote for that talk here (but you'll need to register)

I was also keen to test new formats for presenting.
On Thursday I'd successfully mixed presentation with demo - using the excellent Jupyter/RISE extension from Damian Avila - allowing me to execute code within the presentation slides themselves in the browser.
I find this very powerful and it's something I felt I really needed for my Docker demos.

So this time I didn't have time to redo my slideset, but I did have time - a morning - to put together a demo environment.

When I have more time I'll extend that work to be a much more comprehensive demo.  I've quite a lot of ideas for that around basic Docker capabilities but also other tools such as Machine, Compose, Swarm ... and more ... but more on that in a later post ...

Here's a screenshot of just one part of the demo.
We can see text describing what's happening (this is entered as Markdown), followed by the input cell where we enter real commands, followed by the output from the command.

So this allows to demonstrate and document live coding and later publish the result -as the above Jupyter notebook posted on github.

Here's the notebook showing the demo steps, presented as a narrative thanks to the notebook format.  You can view directly the notebook rendered on github here:


or if you want to run the notebook in a suitable environment you can download the raw notebook here:

To use that notebook you'll need to have Docker installed and Jupyter.
I don't intend to describe the intricacies of installing Docker and Jupyter on various systems, there are many articles available on this.  I do just provide an overview below.

This was the first post on using Jupyter to demo Docker, there will be many more to follow as I evangelize both tools at work and in conferences.

Setup Notes

For Docker you'll need to install directly on a Linux machine or if on Windows or Mac OSX you'll need to use a virtualized Linux.  You can use the Docker Toolbox (basically a combination of Kitematic GUI, VirtualBox and a linux image).

My demo was performed on a Windows machine.
I personally prefer to have more control over my virtual machines, and so I use Vagrant to install my virtual machine running under VirtualBox.
The Vagrantfile I used is available here.

I also used Jupyter to run/record the demo.
The best way to run Jupyter on either Windows or Linux is to install the Anaconda distribution, available from Continuum Analytics here.

You can find out more about the Jupyter project here, or try it out online here

No comments:

[Conference -] Developing Micro-services on Kubernetes

In April I had the chance to present at , first in Warsaw on Apr 24th, and then in Wroclaw ("wroslof" was my best at...