The building is successful on my Ubuntu-based virtual machine, but when I tried to run some FEniCS code by: singularity exec my_fenics.simg python3 my_program.py
Can you post a minimal code that you tried testing? Also how do you test if the build is “successful” ?
Are you able to shell-in the container and run
python3 -c "from dolfin import *"
I’ve built a couple of containers in the past, most recently here. You can download the container using
The recipe files are available here in case if you wish to build locally. Note that the container has some additional libraries that you might not need, so, depending on your needs, you could tweak the recipe accordingly.
There doesn’t seem to be an installation issue, at least no major one. Could you open a python3 shell inside the container and test the following commands ?
Unfortunately, it went back to the original permission denied error . But this time there is some string error shown in the beginning. I tried p = Constant(1), but error was the same.
It seems to be file permissions issue that could have crept in when you built the container. Can you post the complete recipe file that you built your container from ? Also, can you try the other container that I posted above, and if you can reproduce this error there too ?
Sorry for the late reply.
Now, the thing is, directly pulling from your repo solves everything! But either this minimal recipe or the recipe from your repo cannot make my local building work(same permission denied error).
Because I do want to install more stuff inside the recipe, thus do you think it is my building command that leads to the problem?
I used sudo singularity build my_fenics.simg my_recipe.def
I see. Can you try building with the same recipe on SingularityHub ?
What happens if you do not run with super user privileges, i.e. without sudo ? As long as you have write-permissions to the directory you are building your image in, it should work. Also, just a check throw in
Or see if you can change the file permissions the directory in the image that you posted (it is usually not a good idea to do that). Do you get the same error ?
No, I meant building the container on the cloud. You can do so by linking your GitHub with SingularityHub and create a GitHub repository with your recipe in it, e.g. here. Check this for a more detailed set of instructions. It is convenient this way since you can debug any errors through the log file if the build fails at any point. And once built, pull the container via
Seems to be a problem with Singularity installation similar to as reported here. Which version of singularity are you running and on what version of Ubuntu? How did you install it ?
Shouldn’t have occured. mpi4py is installed and configured in the base docker layer that you are building upon. In any case pip-installing might not directly work for packages. As a workaround, what you could do is
python3 -m pip install <library>
Can you reproduce the first error with a simple Singularity container too ?