Closed jeromekelleher closed 3 years ago
Need to update the docker image
The Dockerfile seems to build, but it gets stuck on
Launching server...
Launch attempt 1 failed, retrying...
Launch attempt 2 failed, retrying...
Maybe if we use a simpler Dockerfile it'll work a bit better.
The new docker file is much quicker to build and the server now starts really quickly. However, we now get a 404 in the Jupyter hub, at a url like https://hub.gke2.mybinder.org/user/tskit-dev-msprime-sklo4llj/tree/docs/ancestry.md
Anyone want to dig into this?
The "tree" is empty (and readonly). My guess is that because your docker image is installing the msprime wheel, the image doesn't include the git repository. Compare this with pointing mybinder.org at any repository without it's own Docker file (e.g https://mybinder.org/v2/gh/tskit-dev/tskit/main).
All the Binder links in the docs do is point mybinder.org at the msprime repository. Mybinder uses repo2docker
to build the docker image it runs. There are several ways to configure a repository for repo2docker. For a Python package, the simplest thing is to have a pip requirements.txt
file at the top-level, or if that's insufficiently flexible, include a conda environment.yml
file (which has higher precedence). For maximum configurability, one can instead have a Dockerfile
at the top-level, which has the highest precedence.
Presumably the Dockerfile could be fixed to work fine with mybinder, but I have no expertise to offer here. So given @agladstein is using the Dockerfile
separately to mybinder, the simplest thing we could do is rename/move the Dockerfile
and add a small environment.yml
. Something like this:
name: name-is-ignored
dependencies:
- python=3.9
- pip
- pip:
# Pin specific pypi dependencies (not necessary, but probably desired).
#- -r requirements/development.txt
# Install from current directory.
- .
Such a setup is working fine in https://github.com/popsim-consortium/demes-python and https://github.com/grahamgower/demesdraw.
Oh, and I just found this which explains how to get jupyter-book myst markdown files to open nicely in binder.
That sounds like a good plan, thanks @grahamgower. @agladstein, what will happen if we move the Docker image into directory? Can we update the config on Docker Hub to point to a custom location? I think it would be good to keep the default Docker image minimal, as you say in #1569 and we can make the Binder links work with more python specific stuff.
I'm not sure about pointing Docker Hub to a directory, I would think that it should be doable. I'll try to take a look at this this weekend.
Any thoughts on what we should do here @agladstein?
Sorry for being slow. I forgot to check last weekend.
Looks like it should work. Here is what I see in the build configuration on DockerHub
Looks to me, like you'd just have to change the Dockerfile location to the directory. We can try a test in a branch if you like. But I think we'd have to test from tskit-dev/msprime and not a fork.
OK, great. How about I create a directory called containers
and rename the current Dockerfile to containers/docker-minimal
?
I'm not too worried if the Docker build is broken for a few days while we sort it out.
Looks like we need to update the config to point to main
rather than master as well.
that sounds good. Can you ping me here when the change is made on main? Then I'll try to get DockerHub to work with it.
I've moved the file @agladstein - also, we need to update it so that it's more minimal. Is there a minimal Python 3.7 (say) image we could use instead? (See #1569)
OK, I've added an environment.yml and the Binder server is starting up, but we're now just looking at a markdown file. Do you know how to get it to convert automatically to a jupyter notebook @grahamgower?
This is seeming like more work that it's worth, tbh
OK, I've added an environment.yml and the Binder server is starting up, but we're now just looking at a markdown file. Do you know how to get it to convert automatically to a jupyter notebook @grahamgower?
This is seeming like more work that it's worth, tbh
Something like #1635. But the notebooks based on markdown have artefacts that make them non-ideal. Not sure if there's a sane approach to hiding cells, etc. that looks good in jupyter-book and in the corresponding notebook.
Currently Binder links don't work. See JupyterBook docs on the subject here: https://jupyterbook.org/interactive/launchbuttons.html