I am trying to setup a jupyter notebook workflow with fenicsx, using docker (so that I can run some code to solve PDEs with my friend). However, I am confused and having trouble to set these things up (we’re using linux distributions and have jupyter and docker working fine).
I have found some command on GitHub - FEniCS/dolfinx: Next generation FEniCS problem solving environment to run a standalone jupyter lab environment with fenicsx: docker run --init -ti -p 8888:8888 dolfinx/lab:latest.
That works fine. However I don’t know how to start back the session once I have closed it. Re-running the command will just start a fresh new session, and I cannot access to my work.
Then there is an in-depth guide on how to use Fenics with docker at FEniCS in Docker — FEniCS Containers 1.0 documentation. There is a section with Jupyter notebooks. I am guessing I can make some simple modifications in the commands for them to work. But I am not sure this is the recommended way to setup a workflow with fenicsx, jupyter and docker.
How do you people do it? Is there a guide I am missing?
I see, thanks for the reply. I have no luck so far. For example docker run --init -p 8888:8888 -v "$(pwd)":/root/shared dolfinx/lab:latest lets me access a jupyter notebook with dolfinx. However, saving the notebook file doesn’t make it appear on my host system, despite the -v argument (and I am running this command from a terminal opened in a dedicated directory I wish to share with the docker image).
I also tried
docker run --init -p 8888:8888 -v "$(pwd)":/root/shared dolfinx/lab:latest --name dolfinx_test0
But then I get the message: [W 2022-06-12 12:56:44.606 ServerApp] Unrecognized alias: 'name', it will have no effect.
And I can see that indeed, no docker image was created with the name I picked, by using docker ps -a.
dokken, I realize that this command creates a new docker container each time I run it. As a result, I am left with tens of containers, is this the usual way people use docker/jupyter/fenicsx? Or am I doing something wrong?
I have been now trying to open a Jupiter notebook to work with dolfinx via docker for a while. I followed the instructions here and thoroughly read the documentation at FEniCS Containers and tried different combinations.
I have tried this command both with the dolfinx/lab image (either with tag nightly or stable - I could not find it anywhere with the tag latests used here) or the image dokken92/dolfinx_custom:v0.5.0.
I also tried it avoiding naming the container/ without specifying the -w, -ti, --name and -v options.
The container is always running but I am unable to access any of the links provided in any possible combination I tried. The link opens a web age even saying
'404 : Not Found You are requesting a page that does not exist!’
or
‘Safari can’t find the server’
I further tried to run Jupiter from within the running container with
jupyter-notebook --allow-root
or
jupyter lab --allow-root
always obtaining the same error messages.
Also, it seems that I am not allowed to navigate to /root/shared from within the container.