diff --git a/Setup/README.md b/Setup/README.md index 867757f16989ac197086c3dc313d4aa32e41849e..77a3787db91b3a0bebc8e7cccf8184603703a6a1 100644 --- a/Setup/README.md +++ b/Setup/README.md @@ -1,23 +1,55 @@ # Setup and installation instructions -The setup constists of cloning this repository, installing `Fenics`, installing a few python modules that are not shipped with the standard distributions and hack away. +The setup constists of cloning this repository, installing `docker` and `Fenics`, +installing a few python modules that are not shipped with the standard +distributions and hack away. +This code assumes that you run Linux. It has not been tested on Windows. +It has been tested on `Debian Buster` and `Archlinux`. + +## Install docker +First, install `docker`, add yourelf to the `docker` group and run the +docker daemon. This may vary from distribution +to distribution. On Archlinux you can run + + sudo pacman -S docker + +Check the name of the package for your distribution and the documentation of your +package manager to see how to install docker in your case. +On `systemd`-based systems the daemon is started by running + + sudo systemctl start docker + +in the command line. + +Note: If you don't have admistrative rights on your system, ask your systemadmin +to perform these steps for you. The user that wants to run `docker` needs to +be in the docker group. If you have added yourself to the docker group, don't +forget to log out and back in again. A reboot might be required, so if in doubt, +do that. ## Manual how to set up latest fenix image in Docker Pull the latest `Fenics` Docker image docker pull quay.io/fenicsproject/stable:latest -This code as been tested on the latest docker version, which is as of October 2020 `Fenics 2019`. The above explains how to pull the latest `Fenics` docker image. Drastic changes to Fenics are envisioned for the next release, notably abandoning the mesh tool `mshr` which this code heavily relies on. Therefore, before even starting, check on the `Fenics` [website](https://fenicsproject.org/download/) if another version of has come out. -If yes, you are free to check whether or not this code still works under the latest version, but things might have broken. -In that case, the code needs to be adapted first. -Alternatively, look on [the release cite](https://quay.io/repository/fenicsproject/stable?tab=tags) for the latest 2019 tag and pull that image. -So assuming `2019.1.0` was the latest tag, you would run +This code as been tested on the latest docker version, which is as of October 2020 `Fenics 2019`. The above explains how to pull the latest `Fenics` docker image. Drastic changes to Fenics are envisioned for the next release, notably abandoning the mesh tool `mshr` which this code heavily relies on. Therefore, before even starting, check on the `Fenics` [website](https://fenicsproject.org/download/) if another version of `Fenics` has come out. +If yes, you are free to check whether or not this code still works under the latest version, but things might have broken. +In that case, the code needs to be adapted first. +Alternatively, look on [the release cite](https://quay.io/repository/fenicsproject/stable?tab=tags) for the latest 2019 tag and pull the 2019 image. +So assuming `2019.1.0` was the latest tag for the 2019 version, you would run docker pull quay.io/fenicsproject/stable:2019.1.0 + ## Create docker container named LDD-TPR with graphical display, share folder `pwd` +Move into the folder in which you cloned this directory and run - docker run --dns=129.69.252.252 -it --env HOST_UID=$(id -u $USER) --env HOST_GID=$(id -g $USER) --env DISPLAY=unix$DISPLAY --device /dev/dri --volume /tmp/.X11-unix:/tmp/.X11-unix:rw --volume $(pwd):/home/fenics/shared --name LDD-TPR-fenics2019 quay.io/fenicsproject/stable:latest /bin/bash + docker run --dns=129.69.252.252 -it --env HOST_UID=$(id -u $USER) --env HOST_GID=$(id -g $USER) --env DISPLAY=unix$DISPLAY --device /dev/dri --volume /tmp/.X11-unix:/tmp/.X11-unix:rw --volume $(pwd):/home/fenics/shared --name LDD-TPR-fenics2019 quay.io/fenicsproject/stable:latest /bin/bash +This will setup your current folder as shared directory for the `Fenics` docker +image. +Note: If you pulled a version of docker with a fixed tag, you need to adapt +the line `quay.io/fenicsproject/stable:latest` in the above to +`quay.io/fenicsproject/stable:2019.1.0`. If you want the container do be automatically deleted after exiting add `--rm` option. @@ -31,7 +63,29 @@ If you have trouble with internet connection inside the container use docker start LDD-TPR & docker exec -ti -u fenics LDD-TPR /bin/bash -l +you should see a message like the following +``` +# FEniCS stable version image + +Welcome to FEniCS/stable! +This image provides a full-featured and optimized build of the stable +release of FEniCS. + +To help you get started this image contains a number of demo +programs. Explore the demos by entering the 'demo' directory, for +example: + + cd ~/demo/python/documented/poisson + python3 demo_poisson.py +``` +Tip: This command should be stored as a script or alias to not have to remember it. +You should see a welcome message greeting you + +It is good practice to update the system in your `docker image` so run + + sudo apt-get update && sudo apt-get upgrade + ## Usefull docker commands List all docker container @@ -68,14 +122,14 @@ Remove image **Solution** -1. If the package is not found first `apt-get update` and then try again. If there is no connection +1. If the package is not found first `apt-get update` and then try again. If there is no connection check your dns settings. 2. In the container, execute once the script `Rechtesetup/setpermissions.sh` to gain write access in `/home/fenics/shared` - + cd /home/fenics/shared/Rechtesetup & sudo ./setpermissions.sh -## Nützliche FEniCS Links +## Nützliche FEniCS Links - Forum, viele Fragen wurden evtl. schon gestellt, bzw. können ggf. gestellt werden: @@ -91,6 +145,3 @@ check your dns settings. - Fenics git wenn man wirklich mal in die source files schauen möchte: https://bitbucket.org/fenics-project/ - - -