Docker is a lightweight virtualization software that allows to ship applications with all their dependencies in a simple way. It is outside of the scope of this manual to explain all possible applications of Docker, and we refer to the introduction (https://www.docker.com/what-_docker) and installation and quickstart guides (https://www.docker.com/products/docker) on the Docker website for more detailed descriptions of how to set up and use the docker engine. More importantly Docker provides a marketplace for exchanging prepared docker images (called Docker Hub). After setting up the docker engine downloading a precompiled ASPECT image from Docker Hub is as simple as typing in a terminal:
Note that the transfer size of the compressed image containing ASPECT and all its dependencies is about 900 MB. When extracted the image requires about 3.2 GB of disk space.
Although it is possible to use the downloaded ASPECT docker image in a number of different ways, we recommend the following workflow:
Make sure your parameter file specifies a model output directory other than the input directory, e.g. /home/dealii/aspect/model_output. When you have started the container run the aspect model inside the container. Note that there are two ASPECT executables in the work directory of the container: aspect and aspect-release. For a discussion of the different versions see Section 4.3, in essence: You should run aspect first to check your model for errors, then run aspect-release for a faster model run.
To sum up, the steps you will want to execute are:
Within the container, simply run your model by executing:
Commands that copy the model output to the current directory could be:
To remove all finished containers use the following command:
Alternatively only remove a particular container:
You are all set. Repeat steps 1-4 of this process as necessary when updating your model parameters.
The above given workflow does not include advice on how to modify ASPECT inside the container. We recommend a slightly different workflow for advanced users that want to modify parts of ASPECT. The ASPECT docker container itself is build on top of a deal.II container that contains all dependencies for compiling ASPECT. Therefore it is possible to run the deal.II container, mount an ASPECT source directory from your host system and compile it inside of the container. An example workflow could look as following (assuming you navigated in a terminal into the modified ASPECT source folder):
Inside of the container you now find a read-only ASPECT directory that contains your modified source code. You can compile and run a model inside the container, e.g. in the following way:
To avoid repeated recompilations of the ASPECT source folder we recommend to reuse the so prepared container instead of starting new containers based on the deal.II image. This can be achieved by the following commands outside of the container:
For more information on the differences between using images and containers, and how to attach additional terminals to a running container, we refer to the docker documentation (e.g. https://docs.docker.com/engine/getstarted/step_two/).
5Note that it is possible to mount a directory as writeable into the container. However, this is often associated with file permission conflicts between the host system and the container. Therefore, we recommend this slightly more cumbersome, but also more reliable workflow.