nipy / mindboggle

Automated anatomical brain label/shape analysis software (+ website)
http://mindboggle.info
Other
146 stars 54 forks source link

Trouble setting environment variables #169

Closed g-a-t closed 5 years ago

g-a-t commented 5 years ago

Hi,

Installed Docker, trying to run the single command after setting environment variables. My variables:

HOST=/Users/gat/Desktop/ DOCK=/home/jovyan/work IMAGE=$DOCK/Users/gat/Desktop/Mindboggle/001.nii.gz ID=001

When I run the command docker run --rm -ti -v $HOST:$DOCK nipy/mindboggle $IMAGE --id $ID

I get the following error: /neurodocker/startup.sh: line 5: /home/jovyan/work/Users/gat/Desktop/Mindboggle/001.nii.gz: No such file or directory

I've read the other help entries but am still unclear about how to set up the environment variables. Thanks!

g-a-t commented 5 years ago

Additionally, when trying to access the jupyter notebook from within the container, I get the following error:

[I 17:32:01.775 NotebookApp] Writing notebook server cookie secret to /root/.local/share/jupyter/runtime/notebook_cookie_secret Traceback (most recent call last): File "/opt/miniconda-latest/envs/mb/bin/jupyter-notebook", line 11, in sys.exit(main()) File "/opt/miniconda-latest/envs/mb/lib/python3.6/site-packages/jupyter_core/application.py", line 266, in launch_instance return super(JupyterApp, cls).launch_instance(argv=argv, *kwargs) File "/opt/miniconda-latest/envs/mb/lib/python3.6/site-packages/traitlets/config/application.py", line 657, in launch_instance app.initialize(argv) File "", line 2, in initialize File "/opt/miniconda-latest/envs/mb/lib/python3.6/site-packages/traitlets/config/application.py", line 87, in catch_config_error return method(app, args, **kwargs) File "/opt/miniconda-latest/envs/mb/lib/python3.6/site-packages/notebook/notebookapp.py", line 1602, in initialize self.init_webapp() File "/opt/miniconda-latest/envs/mb/lib/python3.6/site-packages/notebook/notebookapp.py", line 1381, in init_webapp self.http_server.listen(port, self.ip) File "/opt/miniconda-latest/envs/mb/lib/python3.6/site-packages/tornado/tcpserver.py", line 143, in listen sockets = bind_sockets(port, address=address) File "/opt/miniconda-latest/envs/mb/lib/python3.6/site-packages/tornado/netutil.py", line 168, in bind_sockets sock.bind(sockaddr) OSError: [Errno 99] Cannot assign requested address

PeerHerholz commented 5 years ago

Hi @g-a-t,

coolio that you're planning to use mindboggle! Such questions are great for neurostars.org (make sure to include the mindboggle tag) , as more folks are able to find and benefit from it, especially in the long run.

Regarding your first question: you're almost there. I assume you're kinda familiar with docker? If not, let me know and I'll rephrase my answer to include more details. Anyhow, you're mounting /Users/gat/Desktop/ on your host to /home/jovyan/work within the container, but you're trying to set the image path including the host path. Hence, the path and therefore the image do not exist within the container. Try changing the IMAGE variable to IMAGE=$DOCK/Mindboggle/001.ni.gz. With that you're pointing to the image on your desktop via the mounting path.

Focusing your second question: it's kinda hard to exactly tell what's going wrong, as there's no information on how the command was run. Please make sure to include as much as information as possible (OS, docker & container version, command that was run, etc.) in future questions. This will help folks to help you. What I assume goes wrong is that you don't mount ports during the docker command, hence the respective port jupyter uses is not mounted and available. Therefore, please try to include via the -p flag, something along these lines docker run -it --rm -p 8888:8888 -v data/on/your/host:/home/jovyan/work nipy/mindboggle jupyter notebook.

Let us know how things go!

Cheers, Peer

PeerHerholz commented 5 years ago

Follow up: I just saw the other issue where @NPann pointed provided a solution to the OSError: [Errno 99] Cannot assign requested address problem. @binarybottle updated the instructions accordingly, with the new command being: jupyter notebook /opt/mindboggle/docs/mindboggle_tutorial.ipynb --ip=0.0.0.0 --allow-root.

binarybottle commented 5 years ago

Thank you for the clear directions, @PeerHerholz! @g-a-t -- did this help?

I am also able to run the jupyter notebook with the new command. I'll focus on issue #168 now...

binarybottle commented 5 years ago

Issue #168 has been resolved with the updated docker container, updated instructions, and a working command to launch the jupyter notebook: jupyter notebook /opt/mindboggle/docs/mindboggle_tutorial.ipynb --ip=0.0.0.0 --allow-root

Thanks again, @PeerHerholz! @g-a-t -- Please feel free to open this issue back up if you run into any trouble setting environment variables.