v0.14.0 |
Docker is an open platform that allows for the distribution and deployment of applications across different systems. In the context of MoFEM it allows for the distribution of pre-compiled libraries for the Docker platform that can then run on any system. The Docker platform works by using facilities provided by the Linux kernel to provide lightweight containers and thereby avoiding the need to run costly virtual machines. It’s through the use of containers that MoFEM is compiled and run.
This installation is suitable for Linux, macOS and some versions of Windows. In macOS, a lightweight Linux distribution is virtualized to run the Docker containers in.
Flow link https://youtu.be/I201ZaAnQG8. In tutorial we briefly explain what is following bellow.
First, install docker as per the instructions here: https://docs.docker.com/installation/#installation
Installation is at that point done; now you can run docker container and run some code. You have to start by pulling MoFEM image from Docker Hub
To run code a work container need to be started, container mount mofem build volume from container which has been created in the previous step
MoFEM docker container mount volumes as follows as follows:
In container new, we can run a linear elastic example and calculate the simple problem
In the above example, two processors are used to do calculations. A number of processors which can be used effectively depends on your hardware and set up of the docker container. For propose of this documentation, the program is executed in mofem_build volume, thus resulting file out.h5m can be accessed from other containers, however, is not visible from the host file system. The last command which creates VTK output file save results to the HOME directory of your host system.
Changes which you do in Docker container are temporary. If you restart the computer, or container content of the container is reset to initial state. If you like to keep changes in container or share volume of the container between another container you can do as follows:
Now we can run Docker container and attach the previously created volume to it
You can run several containers and link them to the same volume. All changes in the volume are permanent unless you delete the volume. You can also create several volumes and attach different names to it.
Run docker container in terminal, as above, and follow the tutorial in Attach to a running container Source code in VSCode, in Docker running docker container, is located in the root directory in /mofem_install/mofem-cephas
. Open this folder in VSCode to edit source.
We already build created Release version of users modules, which you can modify, compile and develop. However, for development purposes is useful to have compiled version which debugging information. You can configure the version of users modules with debugging information as follows,
Have above done, we can find directory /mofem_install/um-build-Debug-fifofez
. Now, for example, we can look into the tutorial SLC-1 oisson's equation, and follow instruction, cd directory, make code, partition mesh, and run the example.
Next, create VTK file in your home directory
and finally, open it in ParaView ParaView.
See video explaing this part of the installation: https://youtu.be/-54eMMRTqsQ
Pull MoFEM images and create mofem_volume
and run container as follows
As results in terminal window you will see something similar to following:
Copy address into web-browser:
You can start docker without starting volume, as a isolated system, as follows,
If you run docker on amd64, add option –platform linux/amd64.
Run JupyterHub JupterHyb
Docker JupyterHub is running as demon, and you can access it on local host, at port 8000 http:://localhost:8000. Login is "mofem", on first login you will be ask for password. "mofem" account is admin account, from it you can add users.
To build MoFEM the source code need to be downloaded. The best method to do it is to clone repository
You can clone specific branch, for example, development branch with most up to date bug fixes, new features, efficiency and functionality improvements
Now you can use docker container with the source from your host system as follows
Any problems with this installation, please contact us by mofem-group@googlegroups.com.