Testing the RuneStone interactive Python courses server in docker

I’ve been working on setting up a Docker container environment allowing to test the RuneStone Interactive server.

RuneStone Interactive allows the publication of courses containing interactive Python examples, and while most of the content is static (the Python examples are run innside a Python interpreter implemented in JavaScript, hence locally in the JS VM of the Web browser), the tool also offers an environment allowing to monitor the progress of learners in a course, which is dynamic and is queried by the browser over AJAX APIs.

That’s the part which I wanted to be able to operate for test purposes. As it is a web2py application, it’s not exactly obvious to gather all dependencies and run locally. Well, in fact it is, but I want to understand the architecture of the tool to be able to understand the deployment constraints, so making a docker image will help in this purpose.

The result is the following :

Now, it’s easier to test the writing of a new course (yet another container above the latter one), and directly test for real.

Configuring the start of multiple docker container with Vagrant in a portable manner

I’ve mentioned earlier the work that our students did on migrating part of the elements of the Database MOOC lab VM to docker.

While docker seems quite cool, let’s face it, participants to the MOOCs aren’t all using Linux where docker can be available directly. Hence the need to use boot2docker, for instance on Windows.

Then we’re back quite close to the architecture of the Vagrang VM, which relies too on a VirtualBox VM to run a Linux machine (boot2docker does exactly that with a minimal Linux which runs docker).

If VirtualBox is to be kept around, then why not stick to Vagrant also, as it offers a docker provider. This docker provider for Vagrant helps configure basic parameters of docker containers in a Vagrantfile, and basically uses the vagrant up command instead of using docker build + docker run. If on Linux, it only triggers docker, and if not, then it’ll start boot2docker (or any other Linux box) in between.

This somehow offers a unified invocation command, which renders a bit more portable the documentation.

Now, there are some tricks when using this docker provider, in particular for debugging what’s happening inside the VM.

One nice feature is that you can debug on Linux what is to be executed on Windows, by explicitely requiring the start of the intermediary boot2docker VM even if it’s not really needed.

By using a custom secondary Vagrantfile for that VM, it is possible to tune some parameters of that VM (like its graphic memory to allow to start it with a GUI allowing to connect — another alternative is to “ssh -p 2222 docker@localhost” once you know that its password is ‘tcuser’).

I’ve committed an example of such a setup in the moocbdvm project’s Git, which duplicates the docker provisioning files that our students had already published in the dedicated GitHub repo.

Here’s an interesting reference post about Vagrant + docker and multiple containers, btw.

Student project contributions on using docker to build headless virtualised labs for MOOC participants

After having used Vagrant to create Virtual Machines (VMs) ready made for MOOC participants, I’ve been investigating the use of docker for a similar need.

In order to move on, I’ve applied a clever trick by proposing a project to students of ours (3rd year engineering school end-of-classes project of the ASR major).

The project was addressing several needs :

  • a functional need: being able to monitor what happens inside the VMs run on the participant’s side, so that MOOC labs aren’t performed in a black box;
  • a non functional need: investigate the potential benefits of docker, compared to Vagrant.

The students (François Monniot and Alexis Mousset) have worked very well, and we have a few apps in the result, that allow us to assemble a POC in order to complete our evaluation.

In following posts, I will describe some of these components and will present some ideas and maybe results on the technology’s potential. The impatient reader may directly browse their code on GitHub, starting from the dedicated site.

Debian docker containers using a modified baseimage-docker

I have been testing Docker for a few weeks now, and investigated the use of baseimage-docker, which provides support for supervising services with runit, and includes OpenSSH, among other things, based on an Ubuntu base system. Of couse, I’m interested in a Debian counterpart.

I had initially followed instructions provided by Steve Kemp which also prepared a Debian image including OpenSSH and runit, but it appears that baseimage-docker provides more tiny bits that avoid reinventing the wheel.

I’ve then forked the baseimage-docker to do a quick and dirty adaptation for Debian. There’s a sid variant (my ‘debian’ branch) and a wheezy one (my ‘wheezy’ branch, unsurprisingly). I haven’t used all features of baseimage-docker, so things might break for sure.

For the records, I’m playing with it as a base image to construct a docker-based container running the FusionForge test suite.

Did I warn you it’s quick and dirty and without any warranty ? Hoping that this is useful anyway.