Problem setting

Problem setting

We shall work with a specific example: creating a computing environment for the participants in a course on computational X, where X is any science or engineering subject such as chemistry, physics, quantum mechanics, fluid dynamics, oceanography, and so forth. The challenge with courses featuring heavy computations is two-fold:

  1. to minimize the amount of time the audience spends on installation issues and
  2. to minimize the teacher's hassle with all types of operating systems that might be present on the laptops in the audience.
An attractive solution to this minimization problem is to create a Vagrant machine, which is simply a file with a virtual ready-made computer that anyone in the audience can easily download and use on any Windows or Mac computer.

Another advantage is that all users of a Vagrant machine have exactly the same computing environment (unless they modify the machine). The teacher can then easily debug a user problem inside the teacher's own Vagrant machine. And anything that the teacher demonstrates on her computer works out of the box on the participants' computers.

Different types of Vagrant machines can be made for different types of courses or purposes. For example, a research project can set up a software environment for its project members, as a Vagrant machine, to ensure that the environment is conserved for the future, which is a key principle for replicable science. Users may have many Vagrant machines on their computers and switch between these computing environments.

Contents of the Vagrant machine

The Vagrant machine needs to have an operating system. Here we choose Ubuntu of two main reasons:

  1. software on Ubuntu can be trivially installed as Debian packages
  2. the Debian software repository is at the time of this writing the richest repository for pre-built mathematical software.
We remark that the user of the machine will mainly work with files and directories on the host system (Mac or Windows) and only use the Ubuntu system to run computations.

To be specific, the sample computing environment to be illustrated here consists of a Python-based ecosystem for scientific computing. Examples on basic software includes

Most of these packages are in Debian and trivially installed by a sudo apt-get install packagename command, but the Python packages are often more conveniently installed in their latest version by a pip install packagename command. A few Python packages must be installed directly from the source code, via downloading followed by the sudo python install command, if they do not exist in Debian, or if they are not supported by pip install, or if one needs to download the latest development version. The example will in detail illustrate the various cases.

Much more sophisticated packages than those listed above, for instance PETSc and FEniCS, may be very challenging to build from scratch, but as long as Debian versions are offered (which is the case with PETSc and FEniCS), installation on a Debian-based system like Ubuntu is still just a trivial apt-get install command.

In the Vagrant machine, we create two directories:

We also include two useful files: