Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Future issue with jupyter notebook 5.5 regarding hostname in docker ? #642

Closed
tomjorquera opened this issue May 25, 2018 · 5 comments
Closed
Labels
tag:Documentation Related to user, developer, and maintainer documentation tag:Upstream A problem with one of the upstream packages installed in the docker images

Comments

@tomjorquera
Copy link
Contributor

By toying with upgrading jupyter to version 5.5 inside a container, I stumbled upon the following issue:
jupyter/notebook#3605

Apparently, jupyter-notebook behavior regarding the url has been changed in 5.5, and it will now try to display the host name instead of localhost. Inside docker, it means that the url that now appears will be something like https://8bc26195e104:8888/?... (which does not work when copy-pasted into the browser, host must be changed manually to localhost)

Feels like it's a somewhat significant issue for the project.

Maybe a workaround would be to propose an option to jupyter-nb to disable name resolution ?

@tomjorquera tomjorquera changed the title Future issue with jupyter notebook 5.5 reguarding hostname in docker ? Future issue with jupyter notebook 5.5 regarding hostname in docker ? May 25, 2018
@parente
Copy link
Member

parente commented May 26, 2018

I agree this can be a confusion. In fact, the localhost link printed by Jupyter only ever directly worked if a user was running the docker container on a local machine. When running a container on a remote server, like a VM in the cloud, Jupyter Notebook still prints the URL as localhost because it is blissfully unaware that it is running in a container on another machine, as it should be.

Docker does allow a user to specify the fully qualified domain name of the container with docker run --hostname my.host.name command. I'm pretty sure this will impact what the notebook server will print when it starts. I'm not sure how useful it is in practice.

@parente
Copy link
Member

parente commented Jun 14, 2018

I took a crack at updating the quick start steps to describe what hostname should be used to access the docker image when a container launches. Additional PRs against the docs are welcome.

I'm inclined to close this issue, as it's already being tracked upstream in jupyter/notebook and I don't have a good solution at the moment other than to continue to refine the instructions as people find specific fault with them.

@parente parente added tag:Documentation Related to user, developer, and maintainer documentation tag:Upstream A problem with one of the upstream packages installed in the docker images labels Jun 14, 2018
@minrk
Copy link
Member

minrk commented Jun 14, 2018

The ip and port output from the notebook should generally be ignored when run in containers, since it's ~never right and never can be by default. Only in the very specific case of local docker where the forwarded and exposed ports match can it ever be correct. I'm not sure what the best solution is other than allowing override (jupyter/notebook#3668) which doesn't change the fact that the default will be wrong.

@parente
Copy link
Member

parente commented Jun 25, 2018

Closing this issue as the docs have been updated and we don't have any ideas at the moment on how to make the docker behavior clearer. If anyone has a suggested improvement, we'll be happy to take a PR.

@parente parente closed this as completed Jun 25, 2018
aardk pushed a commit to aardk/jupyter-casa that referenced this issue Jun 26, 2018
the docker ID as the host name. This will likely confuse users.

jupyter/docker-stacks#642

In future versions of jupyter there will be an option to overide
the hostname. For now fall back to notebook 5.4.

In singularity we continue to use version 5.5
aardk pushed a commit to aardk/jupyter-casa that referenced this issue Jun 26, 2018
the docker ID as the host name. This will likely confuse users.

jupyter/docker-stacks#642

In future versions of jupyter there will be an option to overide
the hostname. For now fall back to notebook 5.4.

In singularity we continue to use version 5.5
@mshytikov
Copy link

mshytikov commented Sep 11, 2018

Faced the same issue and it took me a while to figure out the way.

As was mentioned above allowing override solution did work for me.

In my case to keep 'copy-paste url' experience as it was before,
the workaround is to have the jupyter_notebook_config.py in a root of my project. With the following config:

c.NotebookApp.custom_display_url = 'http://localhost:8888' 

Which shows url like: http://localhost:8888/?token=92e6a3a...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
tag:Documentation Related to user, developer, and maintainer documentation tag:Upstream A problem with one of the upstream packages installed in the docker images
Projects
None yet
Development

No branches or pull requests

4 participants