From f1068b851ffb8064ecb023810ffe716a2b81f0c8 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Thu, 1 Oct 2020 17:02:57 -0600 Subject: [PATCH 1/2] Use nbgitpuller --- .binder/apt.txt | 1 + .binder/environment.yml | 33 +++++++++ .binder/jupyterlab-workspace.json | 115 ++++++++++++++++++++++++++++++ .binder/postBuild | 12 ++++ .binder/start | 9 +++ 5 files changed, 170 insertions(+) create mode 100644 .binder/apt.txt create mode 100644 .binder/environment.yml create mode 100644 .binder/jupyterlab-workspace.json create mode 100755 .binder/postBuild create mode 100644 .binder/start diff --git a/.binder/apt.txt b/.binder/apt.txt new file mode 100644 index 00000000..4d956093 --- /dev/null +++ b/.binder/apt.txt @@ -0,0 +1 @@ +graphviz diff --git a/.binder/environment.yml b/.binder/environment.yml new file mode 100644 index 00000000..759f2e69 --- /dev/null +++ b/.binder/environment.yml @@ -0,0 +1,33 @@ +name: xarray +channels: + - conda-forge +dependencies: + - bokeh>=2.0.0 + - cartopy + - cf_xarray + - dask + - dask-labextension + - distributed + - fsspec + - gcsfs + - geoviews + - gsw + - hvplot + - ipywidgets>=7.5 + - jupyter-server-proxy + - jupyterlab>=2.0.0 + - matplotlib!=3.3.1 + - nbgitpuller + - netcdf4 + - nodejs + - notebook + - numpy>=1.18.1 + - pandas + - pip + - pydap + - python-graphviz + - python=3.8 + - scipy>=1.3.0 + - zarr + - pip: + - expectexception diff --git a/.binder/jupyterlab-workspace.json b/.binder/jupyterlab-workspace.json new file mode 100644 index 00000000..d499b299 --- /dev/null +++ b/.binder/jupyterlab-workspace.json @@ -0,0 +1,115 @@ +{ + "data": { + "file-browser-filebrowser:cwd": { + "path": "scipy-tutorial" + }, + "dask-dashboard-launcher:individual-progress": { + "data": { + "route": "individual-progress", + "label": "Progress" + } + }, + "dask-dashboard-launcher:individual-task-stream": { + "data": { + "route": "individual-task-stream", + "label": "Task Stream" + } + }, + "layout-restorer:data": { + "main": { + "dock": { + "type": "split-area", + "orientation": "horizontal", + "sizes": [ + 0.736625105372905, + 0.263374894627095 + ], + "children": [ + { + "type": "tab-area", + "currentIndex": 0, + "widgets": [ + "notebook:scipy-tutorial/00_overview.ipynb" + ] + }, + { + "type": "split-area", + "orientation": "vertical", + "sizes": [ + 0.5, + 0.5 + ], + "children": [ + { + "type": "tab-area", + "currentIndex": 0, + "widgets": [ + "dask-dashboard-launcher:individual-progress" + ] + }, + { + "type": "tab-area", + "currentIndex": 1, + "widgets": [ + "dask-dashboard-launcher:individual-task-stream" + ] + } + ] + } + ] + }, + "mode": "multiple-document", + "current": "notebook:scipy-tutorial/00_overview.ipynb" + }, + "left": { + "collapsed": false, + "current": "filebrowser", + "widgets": [ + "filebrowser", + "running-sessions", + "dask-dashboard-launcher", + "command-palette", + "jp-property-inspector", + "tab-manager", + "extensionmanager.main-view" + ] + }, + "right": { + "collapsed": true, + "widgets": [] + } + }, + "notebook:00_overview.ipynb": { + "data": { + "path": "scipy-tutorial/00_overview.ipynb", + "factory": "Notebook" + } + }, + "notebook:scipy-tutorial/00_overview.ipynb": { + "data": { + "path": "scipy-tutorial/00_overview.ipynb", + "factory": "Notebook" + } + }, + "dask-dashboard-launcher": { + "url": "DASK_DASHBOARD_URL", + "cluster": "" + }, + "@jupyterlab/settingeditor-extension:plugin": { + "sizes": [ + 0.18606224627875506, + 0.8139377537212449 + ], + "container": { + "plugin": "@jupyterlab/terminal-extension:plugin", + "sizes": [ + 0.5, + 0.5 + ] + } + } + }, + "metadata": { + "id": "/lab" + } +} diff --git a/.binder/postBuild b/.binder/postBuild new file mode 100755 index 00000000..f59c00ff --- /dev/null +++ b/.binder/postBuild @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +# Install the JupyterLab dask-labextension +jupyter labextension install dask-labextension +jupyter labextension install @jupyter-widgets/jupyterlab-manager +jupyter labextension install @bokeh/jupyter_bokeh +jupyter labextension install @pyviz/jupyterlab_pyviz + +export DASK_TICK_MAXIMUM_DELAY=5s +export DASK_DISTRIBUTED__DIAGNOSTICS_LINK={JUPYTERHUB_SERVICE_PREFIX}proxy/{port}/status + +#EOF diff --git a/.binder/start b/.binder/start new file mode 100644 index 00000000..7b1fff22 --- /dev/null +++ b/.binder/start @@ -0,0 +1,9 @@ +#!/bin/bash + +# Replace DASK_DASHBOARD_URL with the proxy location +sed -i -e "s|DASK_DASHBOARD_URL|/user/${JUPYTERHUB_USER}/proxy/8787|g" .binder/jupyterlab-workspace.json + +# Import the workspace +jupyter lab workspaces import .binder/jupyterlab-workspace.json + +exec "$@" From d7f15c0988c0010f040d876c3b1c252f5e9568a2 Mon Sep 17 00:00:00 2001 From: Anderson Banihirwe Date: Fri, 2 Oct 2020 06:23:32 -0600 Subject: [PATCH 2/2] Add TOC extension --- .binder/postBuild | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.binder/postBuild b/.binder/postBuild index f59c00ff..2e5d882a 100755 --- a/.binder/postBuild +++ b/.binder/postBuild @@ -5,6 +5,8 @@ jupyter labextension install dask-labextension jupyter labextension install @jupyter-widgets/jupyterlab-manager jupyter labextension install @bokeh/jupyter_bokeh jupyter labextension install @pyviz/jupyterlab_pyviz +jupyter labextension install @jupyterlab/toc + export DASK_TICK_MAXIMUM_DELAY=5s export DASK_DISTRIBUTED__DIAGNOSTICS_LINK={JUPYTERHUB_SERVICE_PREFIX}proxy/{port}/status