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

forked but unchanged repo does not launch on mybinder.org #8

Open
mamueller opened this issue Dec 22, 2022 · 4 comments
Open

forked but unchanged repo does not launch on mybinder.org #8

mamueller opened this issue Dec 22, 2022 · 4 comments

Comments

@mamueller
Copy link

I wanted to to start from a minimal working example, forked the repo and put the url of my fork into the field that mybinder.org provides.
The container is built but fails to launch with the following error message:

Binder inaccessible
You can get a new Binder for this repo by clicking here.
and so on

If I launch the original example the problem does not occur since the container is already built.
If I build the docker image locally it works.

You should be able to reproduce the failure pretty easily.

My guess is that the way the notebook is started on the server is not compatible with the new version of jupyter that is installed by the Dockerfile which does not pin versions...

@Gjacquenot
Copy link

I confirm it is no longer working

It would be nice to know if:

  • it will be fixed
  • it is deprecated

@matthewfeickert
Copy link

matthewfeickert commented Jan 6, 2023

I'm seeing this behavior too for a project I'm working on that requires the Dockerfile approach as there are additional dependencies that are too costly to build from source at repo2docker build time.

I've created a minimal failing example with a writeup at https://github.com/matthewfeickert/failing-repo2docker-with-dockerfile and I'll also cross post this at jupyterhub/repo2docker#1231 as it seems this is where the problem lies. The following is my writeup pasted from the MFE repo:

Minimal Failing Example:

Minimal Failing Example

The Dockerfile in this repository under binder/ is a modified version of the example given in the binder-examples/minimal-dockerfile project.
The modifications are minor in that it adopts python:3.10-slim-bullseye as the base image and installs all Python packages in a NB_USER controlled virtual environment which is automatically activated as its bin/ directory is on $PATH.
The rest of it follows the Preparing your Dockerfile section of the Use a Dockerfile for your Binder repository tutorial website.
The Dockerfile builds successfully when repo2docker is run locally on the repository

# if you don't use pipx just pip install in your local virtual environment
$ pipx install jupyter-repo2docker
$ repo2docker --version
2022.10.0
$ repo2docker .

However, when launching the environment from the URL with the token presented the user is brought to a login screen shown below that notes "Token authentication is enabled".

repo2docker-password-notebook-launch

If the user tries to log in with the token in the URL they are not able to.

From the tutorial it seems that repo2docker is running the equivalent of

docker run -it --rm -p 8888:8888 my-image jupyter notebook --NotebookApp.default_url=/lab/ --ip=0.0.0.0 --port=8888

after it builds the image. For simplicity of naming, if we retag the image

docker tag <r2d-hash>:latest matthewfeickert/failing-repo2docker-with-dockerfile:latest

(or just build the image ourselves

docker build -f binder/Dockerfile -t matthewfeickert/failing-repo2docker-with-dockerfile:latest .

)

and then run it as repo2docker is

docker run -it --rm -p 8888:8888 matthewfeickert/failing-repo2docker-with-dockerfile:latest jupyter notebook --NotebookApp.default_url=/lab/ --ip=0.0.0.0 --port=8888

we get the same issue.
It seems the problems stems from --NotebookApp.default_url=/lab/ as if we run without this then we can run the classic Jupyter notebook environment fine

docker run -it --rm -p 8888:8888 matthewfeickert/failing-repo2docker-with-dockerfile:latest jupyter notebook --ip=0.0.0.0 --port=8888

classic-jupyter-tree

and if we run with jupyter lab things work fine

docker run -it --rm -p 8888:8888 matthewfeickert/failing-repo2docker-with-dockerfile:latest jupyter lab --ip=0.0.0.0 --port=8888

jupyter-lab-launcher

I understand from the tutorial that the --NotebookApp.default_url=/lab/ is required for Binder to act as a safeguard as

If you install the classic notebook interface but not JupyterLab, you must manually change your mybinder.org URLs from /lab to /tree as described in the user interface documentation.
Otherwise, you might get a 404: Not Found error when launching your project on binder.

but it seems there is some interaction problem here for repo2docker.

@Gjacquenot
Copy link

👋 I have found a working GitHub.com repository with Dockerfile here: https://github.com/Kitware/ipyvtklink .

I have forked the project and succeeded in building a working my binder instance: https://github.com/Gjacquenot/test_xdyn_notebook

Details are here

https://discourse.jupyter.org/t/build-completes-successfully-then-binder-inaccessible/17315/12?u=gjacquenot

@matthewfeickert
Copy link

I have forked the project and succeeded in building a working my binder instance: https://github.com/Gjacquenot/test_xdyn_notebook

Yes, but that's building FROM jupyter/base-notebook:python-3.9.7 which is a pretty custom designed environment that the repo2docker team have helped design. That's quite different from the advertised minimum working required environment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants