Make images compatible with Singularity
Singularity does not have /home inside the container, so the FEniCS docker images cannot be converted without loss of functionality. It is probably harmless to create the fenics user and put files inside $HOME in the docker container, but this will all be discarded when the container is converted to Singularity
Proof of concept Singularity images (with docker) can be found at https://github.com/TormodLandet/singularity-fenics-dev-env
Here FEniCS is installed to /opt and the whole of /opt is chmod a+rwX
recursively to allow building FEniCS inside Singularity (started with --writable
). The install location must be writable without sudo and not be inside $HOME
The fenics-build scripts with friends should be installed to some location outside $HOME as well
Comments (12)
-
-
I'll write some more detailed instructions on this.
It is possible to keep
/home/fenics
intact by specifying the-H $HOME:$HOME
flag tosingularity shell
orsingularity exec
.The
stable
image works perfectly as-is apart from an issue with singularity not having the right library path setup into /usr/local/lib (of all places!). SettingLD_LIBRARY_PATH
fixes it. I'm not quite sure why this is.SINGULARITYENV_LD_LIBRARY_PATH=/usr/local/lib singularity exec -e stable-current.img /bin/bash -l
As for compiling a development version with
dev-env
I also have this working. I don't compile into the container (this is not, in my view, the way singularity devs intended things to work) but into my mounted$HOME
directory. With the-H $HOME:$HOME
trick above you can use the scripts in/home/fenics
no problem.singularity exec -e -H $HOME:$HOME dev-env.img /bin/bash -l
For some reason
fenics.env.conf
is missingPYTHONPATH
so I need to fix this. -
All of the above were made with quay.io images. There is an open issue here on that:
https://github.com/singularityware/singularity/issues/749
It works if you specify
--size
. -
The below work nicely for me. Comments?
Stable:
# FIXME LD_LIBRARY_PATH SINGULARITYENV_LD_LIBRARY_PATH=/usr/local/lib \ SINGULARITY_SHELL="/bin/bash -i" \ singularity shell -e stable-current.img ipython3
Development
SINGULARITY_SHELL="/bin/bash -i" \ singularity shell -e -H $HOME:$HOME dev-env.img export PATH=$FENICS_HOME/bin:$PATH export FENICS_PREFIX=$HOME/fenics-install export FENICS_SRC_DIR=$HOME/fenics-install/src # FIXME PYTHONPATH export PYTHONPATH=$HOME/fenics-install/lib/python3.5/site-packages/ fenics-pull fenics-build source $FENICS_HOME/fenics.env.conf ipython3
-
New branch here:
https://bitbucket.org/fenics-project/docker/branch/jackhale/feature-singularity
Seems a light
Singularity
build file over the existingstable
is enough to get it working. Work in progress. -
No plans to support
dev
image in the same fashion asstable
? -
The enthusiasm of youth ;) Of course, but now I have to cook dinner!
-
See pull request #23
-
seeing an issue with the stable container, SINGULARITYENV_LD_LIBRARY_PATH set, the pull request above not integrated.
root@<<hostname>>:~# singularity pull docker://quay.io/fenicsproject/stable:latest <<hostname>>:/opt/singularity# singularity run /opt/singularity/images/fenics-convert.simg python3 /home/fenics/demo/documented/stokes-iterative/python/demo_stokes-iterative.py Python 3.5.2 (default, Sep 14 2017, 22:51:06) [GCC 5.4.0 20160609] on linux Type "help", "copyright", "credits" or "license" for more information. ...
quit() Connection to <<hostname>> closed by remote host. Connection to <<hostname>> closed.
At least the host sshd seems to die with one being spawned from the FEniCS container? - see screenshot:
Running fenics/python interactively from the container works and completes, the same issue as above being triggered when issuing a quit() on the python interpreter.
-
reporter @mike_ist : Please open a new issue
@jackhale : I will close this issue now and reopen a new one since time has passed and things have changed
-
reporter - changed status to resolved
Will open new, more specific issue
-
@mike_ist Please use the provided script
dockerfiles/build-singularity-images.sh
to build Singularity-compatible images from the Docker images hosted at quay.io. - Log in to comment
@chris_richardson may be able to contribute to this thread - he's made some Singularity images.