pangeo-gallery / default-binder

Default binder environment for pangeo gallery.
5 stars 5 forks source link

Auto layout jupyterlab workspace #5

Open TomAugspurger opened 4 years ago

TomAugspurger commented 4 years ago

In some setups (like dask-examples), we set up a jupyterlab workspace with the dask dashboard already open. Once a Client is created, the dashboard automatically lights up.

Do we want the same here?

I think it would involve copying a file like https://github.com/dask/dask-examples/blob/master/binder/jupyterlab-workspace.json and a start like https://github.com/dask/dask-examples/blob/master/binder/start.

@scottyhq this repo is using the pangeo/pangeo-notebook docker image. Can you confirm that if this repo had a binder/start, it wouldn't actually get executed? In order to do that we would need to change https://github.com/pangeo-data/pangeo-docker-images/tree/master/pangeo-notebook?

cc @cgentemann who raised this question in Gitter.

scottyhq commented 4 years ago

@TomAugspurger and @rabernat - It just occurred to me that it's pretty straightforward to add postBuild and start commands to any of the notebook images (what is hard is adding conda packages), but you can do this:

FROM pangeo/pangeo-notebook:2020.04.22

# Override start script (/srv/start)
COPY binder/start binder/jupyterlab-workspace.json /srv/

You have to change a few paths in the start scripts you pointed to. I just tried it out and this gets you most of the way there I think: https://github.com/scottyhq/pangeodev-binder/tree/master/binder

cgentemann commented 4 years ago

@TomAugspurger yes, this is basically what I would love. When running tutorials, having people have to copy the dask URL, then open up windows takes up a bit of time & results in a lot of confusion. So, having it automatically linked & some dask windows up already is ideal. Thanks.

TomAugspurger commented 4 years ago

I'm embarrassed I didn't think to just add those lines to the Dockerfile :)

So now the question is: where should this live? I don't think it's appropriate for the pange-notebook docker image, since those are used on hubs which will persist the user's layout from their last session.

It makes sense for binder since they don't have persistent users. So I think I'll add it here.

rabernat commented 3 years ago

After almost exactly a year, I am reviving this issue. 😁

It is not clear to me how to extend this binder environment. In my case, I wanted to add RISE to the environment. Here is my Dockerfile:

FROM pangeo/pangeo-notebook:2021.04.26
RUN mamba install -c conda-forge RISE

It didn't work. The mamba installation didn't go into the right location. There has to be some way to extend pangeo-notebook (rather than rebuilding everything on top of base-notebook). What can I try?

scottyhq commented 3 years ago

@rabernat this gets confusing b/c conda path initialization, so add a flag (-n notebook) to make sure things get installed into the correct environment:

FROM pangeo/pangeo-notebook:2021.04.26
RUN echo $(which mamba)
RUN mamba install -n notebook -c conda-forge rise

also for what it's worth the Docker build output just changed for new versions on a mac. I had to dig around a bit for a more informative output via : docker build . -t pangeo/rise:latest --progress=plain --no-cache

rabernat commented 3 years ago

Thanks @scottyhq! It worked!