Technologies based on linux containers have become very popular among software developers. The main reason behind this success is the flexibility containers offer when it comes to deploy software.
This section contains basic information on the concept on containers, and tools to support the usage of Linux containers in scientific computing infrastructures.
On Linux Containers
Some links to appear (TBC)
At present the usage of containers is very limited in multiuser environments such as High Performance Computing mainframes, Linux Clusters or Grid infrastructures.
The main limitation is that execution of containers using Docker or LXC requires having root access privileges in the host system. A tool that supports the execution of containers in user space is udocker.
Detailed information on udocker, howtos & downloading page is in our github repository here.
A practical guide containing the instructions to work with a real scientific application in a Linux cluster is to be found in our subsection dedicated to udocker.
Mac OS does present many problems for scientific code developers. One needs to rely on the installation of complex packages (complex both, to install and to maintain) such as Fink or Darwin Libraries,... in order to have compilers or mathematical libraries available. Unfortunately such adapted libraries, often, do not comply with standards either.
Many problems have been detected, related with the usage of system reserved variables on GNU compilers, wrong compilation messages, or violations of the MPI standard in the MPI libraries available for Mac OS.
Thus the ideal situation would be having the well-known and standard Linux scientific utilities available under Mac OS.
Containers technology offers an elegant solution to this problem via the package "Docker for Mac", which is based on xhyve, a tool to run virtual machines on user space, based on a Hypervisor from BSD. But you do not need to know any of this. Just follow the instructions.
How to deploy a Centos7-based container on your Mac
This solution works under the following conditions:
If you meet all three conditions, follow these steps:
The icon will appear on the top bar of your Mac like this:
Note: if you are a member of the Mastercode collaboration follow this link from this point on for concrete instructions to download and run the Mastercode container.
A generic scientific computing container is docker.io/icampos/centosscicomp, which is available in the docker hub repository.
You may download it with the following command on the terminal:
It will use about 1GB of your disk space.
This container is based on Centos7, and has been enhanced with scientific computing tools (compilers, Math libraries, texlive, etc...). In the Dockerfile you can see what is actually installed.
For convenience there is a dummy user ("developer") created in the container.
and convince yourself that you are now on Linux.
you will see your home directory.
To close the container session, just type
on the terminal.
In the typical situation you will be working on your local files, and use the Linux software of the container for those task for which Mac OS software is not suitable: compiling with GNU compilers, running codes, etc...
In this respect:
Nothing will prevent you to launch it more than once, but you risk filesystem obfuscation within the container. In case of trouble just exit the container.
If you want to save them, you need to save the status of the container. See https://docs.docker.com/engine/reference/commandline/commit for detailed instructions on Docker software.
If being that sort of root you damage the container directories, just exit. Remember: changes are not saved.