I just managed to set up julia in binder using jupyterlab! Very exciting. Now I want to keep my environment and my content in separate repositories to speed up initial startup time. There are excellent instructions here:
https://discourse.jupyter.org/t/tip-speed-up-binder-launches-by-pulling-github-content-in-a-binder-link-with-nbgitpuller/922
However, nbgitpuller uses jupyter (classic) by default, and I definitely want to run jupyterlab. This appears to be easy: it’s specifically mentioned in nbgitpuller’s documentation:
https://jupyterhub.github.io/nbgitpuller/topic/url-options.html
but they give no useful instructions on how to implement it! My postBuild looks like this:
jupyter serverextension enable --py nbgitpuller --sys-prefix
I suppose this needs to be tweaked. I tried
jupyter lab serverextension enable --py nbgitpuller --sys-prefix
but that doesn’t work.
Because you are using MyBinder, you want to use the highlighted option at the top of the page you reference https://jupyterhub.github.io/nbgitpuller/topic/url-options.html#options-in-an-nbgitpuller-url to make the launch URL:
" If you just want to generate an nbgitpuller link, we highly recommend just using the link generator"
Because the link generator page has a lot of options, it can be a bit much to find what you seek the first time.
Because you are using MyBinder, from the the link generator page you want to click the ‘Binder
’ tab in the upper right side, just above the form. From there, you fill out the form with your information. To open in JupyterLab upon launch, you want to pay close attention to the bottom of the form. From under ‘Application to Open
’ you want to toggle ‘JupyterLab
’ as your selection. Then the URL generated should launch JupyterLab when the notebook is retrieved from the content source.
I don’t believe you need anything in postBuild
concerning nbgitpuller for this to work. I would remove your attempted edit. That is as long as you are specifying nbgitpuller somewhere in a requirements.txt
or environment.yml
configuration file.
If you get stuck making the URL, you’ll need to share the repo and the content URLs to get more specific guidance.
2 Likes
Excellent advice. The link generator works, even without postBuilder and just “nbgitpuller” in my requirements.txt.
1 Like