0

I am trying to run the below docker command. This command is supposed to produce an output as shown below in screenshot but it throws an error as "Unknown flag - ip". Once this error is resolved, I would also like to port forward it to view the browser in my local environment as we don't any UI for remote server. However, I am encountering problem in getting this done successfully. Please note my docker version is 18.09.4, build d14af54

There are certain jupyter notebook examples that are stored in the below folder

/opt/nvidia/data/image/examples/brats

I would like to be able to view this jupyter notebook examples in my local environment. So, based on my understanding I felt that I had to do two steps

step 1) Execute the docker run command as shown below in code section

step 2) Port forward to local environment

However, I am getting an error after execution of step 1.

Actual output (error) of step 1

error - output

Expected output (success) of step 1

If step one had been successful, this below shown screenshot content should have been the actual output which will provide me details to port forward and login to the jupyter notebook

enter image description here

Once, I am able to execute the step 1 successfully, I should be able to port forward

Step 1 - Code

docker run --runtime=nvidia -it --rm -v /home/selva/demo:/mnt/demo -p 
8888:8888 -w /opt/nvidia/data/image/examples/brats $DOCKER_IMAGE 
jupyter notebook --ip 0.0.0.0 --allow-root --no-browser

Step 2 - Code

 ssh -L 8234:127.0.0.1:8888 localhost 

As our docker is running in a remote gpu, we don't have UI to view it. In order to access it locally in my desktop(http://localhost:8234), I do port forwarding.

Currently, neither am able to access the Jupyter notebook using 127.0.0.1:8888 or 127.0.0.1:8234. In both the scenarios, it fails

I would like to be able to fix the issue of step 1 and be able to execute step 2 (port forward) and see the Jupyter notebook in my local browser. Can you please help?

The Great
  • 7,215
  • 7
  • 40
  • 128
  • can you check that the env variable is correctly set ($DOCEKR_IMAGE)? Also try to change the command to this: sh -c "jupyter notebook --ip 0.0.0.0 --allow-root --no-browser". If you post the value of DOCKER_IMAGE I can have a look better at what this container requires. – Mihai May 05 '19 at 16:32
  • @Mihai - Somehow, I managed to get the step 1 right. But I am still facing issue with step 2 - Port forwarding. When I execute the step 2 - code, it works fine and prompts me for password. Once I key in, it allows me to login without any issues. However when I open the browser and key in localhost:8234, it throws an error that "Site can't be reached". Please note that I start docker daemon using rootless kit. Am not very familiar with docker. Hope the info that I shared is of use to you to understand the problem better – The Great May 06 '19 at 03:21
  • DOCKER_IMAGE = "nvcr.io/nvttea/medical/tlt-annotate:v0.1-py3 /bin/bash" In addition, another odd behavior that I see is when I try to reproduce the above task in my desktop, I am able to port forward it but when I key in the login token from URL shown above in screenshot, I get "invalid credentials" issue. Whereas when I do the above in my laptop, I am not even able to see the Jupyter Lab login screen, meaning I get "127.0.0.1 site couldn't be reached". Can you please help – The Great May 06 '19 at 03:43
  • Please note that I use 'Putty' client to port forward in my desktop whereas in my laptop I use ubuntu SSH. Not sure whether this is the issue. – The Great May 06 '19 at 03:52
  • Is port 8234 open? Just to understand better: You are trying to run this in local or on a server? I am asking because I see mixed messages. If you run this on a server you definitely can't reach localhost:8234. – Mihai May 06 '19 at 04:27
  • You posted: DOCKER_IMAGE = "nvcr.io/nvttea/medical/tlt-annotate:v0.1-py3 /bin/bash". You should change this to only be the image name. "/bin/bash" is part of the command and should not be there. It confuses me and will confuse anybody trying to help you ;) – Mihai May 06 '19 at 04:32
  • Apologies. It was a typo, copy paste issue (Docker Image is only the image name). Yes, I am trying to run/view this jupyter notebook in local environment – The Great May 06 '19 at 04:35
  • Based on your command you don't do any port forwarding to 8234. Do you also have problems with port 8888 (as per the command)? Also, if you login to the running container and run in there the URL coming in the output (the one with the token), does that work? – Mihai May 06 '19 at 05:24
  • No, it doesn't work. Doesn't this command (ssh -L 8234:127.0.0.1:8888 localhost) indicate port forwarding. Am I doing any mistake in this command? – The Great May 06 '19 at 06:06
  • Let us [continue this discussion in chat](https://chat.stackoverflow.com/rooms/192889/discussion-between-mihai-and-selva). – Mihai May 06 '19 at 06:56

0 Answers0