Pre loading package on binder with start

Hello all, the doc of our open source solver is using binder to provide example notebooks.
Everything is working fine so far (with an apt.txt , an environment.yml to install the dependencies that change rarely and postBuild for releases which install the wheel of our library).
We have recently introduced nightly distributions and we would like the documentation for the master branch to use a binder using the nightlys.
My idea was to use start to dynamically download a zip from github (where the nightlys are stored) and install it.
Does that seem workable ?
And if yes would someone have an example of start script … mine is not working :frowning:
Thanks for your help

Yes, and yes.


:pray: and :pray:

Thanks my start file was already quite similar but I still have an issue.
Everything seems to go fine, each layer to be built … but I have this error:

2021-12-17T07:57:21Z [Normal] Container image "jupyterhub/" already present on machine
2021-12-17T07:57:22Z [Normal] Created container tc-init
2021-12-17T07:57:22Z [Normal] Started container tc-init
2021-12-17T07:57:22Z [Normal] Pulling image ""
2021-12-17T07:58:11Z [Normal] Successfully pulled image "" in 49.027263279s
2021-12-17T07:58:14Z [Normal] Created container notebook
2021-12-17T07:58:14Z [Normal] Started container notebook
Spawn failed: Server at didn't respond in 30 seconds
Launch attempt 3 failed, retrying...

How can I debug this? Did I miss something?


yep, this is a danger of hacking on start, as you won’t get any help from docker for it getting cached (even though it will re-run postBuild every change). Without seeing more of the start script, there won’t be much to see.

Another approach, if your system package is used only in a kernel, and not in the jupyter server, would be to write a tiny, demo-only config that installed stuff during startup. This is totally abuse of the config system, but heck, this is binder. You can also use some pip flags to limit the blast radius of a hot install in an otherwise working system.

# .binder/

import subprocess, sys, pathlib
error = none
    p = subprocess.Popen([
        sys.executable, "-m", "pip", "install", 
        "--upgrade", "--ignore-installed", "--no-deps", 
        "-r", ".binder/nightly-requirements.txt"
    ], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
except Exception as observed_error:
    error = observed_error
   with(".pip-install.log", "w+").open() as fd:

Being able to use more familiar error handling and logging than some of the “special” features on binder, might better allow local debugging.

1 Like

I just forked your repo to investigate your start file. Mistakenly I didn’t push to the branch and launched anyway. (In other words, just forked yours and did a new build with no changes.) My fork launched fine though? Did you resolve your issue? Or at least find the offending line(s)?
You can try it at

The repo is at scikit-decide/start at gal/binder · fomightez/scikit-decide · GitHub

1 Like

Hehe, Thanks for investigating … Yes I played a lot commenting lines … and I found the culprit !
The clone you are using is the one working :wink: and the line I would like to uncomment is line 27

# pip install --pre --find-links ./dist/ "scikit-decide[all]"

If is it uncommented I hit in the 30s non response time …

May be I should try to pre-install as much dependencies as possible (but I am always at risk that they might change) ?

Any other option?

Thank you all for your help.
I moved all I could move (dependencies) in environment.yml and finally it works :man_dancing:
I would nevertheless be interested by any feedback you can have !

Thank you

1 Like