Skip to content

Commit

Permalink
Add dask powered Xarray example and dask labview (#2)
Browse files Browse the repository at this point in the history
* Add configs for labview plugin

* Add dask config with nbserverproxy link

* Default to lab

* Add xarray example with dask backend

* Rename file

* Use v2.0.0 for binder
  • Loading branch information
willirath authored Jun 18, 2019
1 parent 5d4b68c commit a84e396
Show file tree
Hide file tree
Showing 9 changed files with 550 additions and 5 deletions.
10 changes: 10 additions & 0 deletions .dask/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
distributed:
logging:
bokeh: critical

dashboard:
link: /user/{JUPYTERHUB_USER}/proxy/{port}/status

admin:
tick:
limit: 5s
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Python Intro 201804 [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/geomar-tm/python-intro-201804/v1.3.2)
# Python Intro 201804 [![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/geomar-tm/python-intro-201804/v2.0.0?urlpath=lab)

This course was held in April / May 2018.

Expand Down Expand Up @@ -58,7 +58,7 @@ jupyter lab
```

> _**Note** that if Jupyter fails with a message "could not assign address", you need to explicitly choose the IP address for the jupyter server:_
>
>
> ```bash
> jupyter lab --ip=127.0.0.1
> ```
Expand Down
3 changes: 3 additions & 0 deletions Welcome.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

Welcome To The Python Intro
===========================
1 change: 1 addition & 0 deletions binder/apt.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
graphviz
25 changes: 22 additions & 3 deletions binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,38 @@ channels:
- conda-forge
dependencies:
- python=3
- basemap
- basemap
- bokeh=1.1.0
- cartopy
- cf_units
- cmocean
- dask
- dask-image=0.2.0
- dask-ml=0.13.0
- dask=1.2
- gsw
- haversine
- hdf5
- matplotlib<3
- nbserverproxy
- netCDF4
- nodejs=8.9
- nomkl
- notebook<5.7.5
- numba
- numpy
- pandas
- seaborn
- pip
- py-xgboost
- pyarrow==0.12.0
- python-graphviz
- requests
- scipy
- seaborn
- seawater
- tornado=5
- xarray
- pip:
- dask_xgboost
- mimesis
- jupyterlab==1.0.0a8
- dask-labextension==0.4.0a1
94 changes: 94 additions & 0 deletions binder/jupyterlab-workspace.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"data": {
"file-browser-filebrowser:cwd": {
"path": ""
},
"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.5,
0.5
],
"children": [
{
"type": "tab-area",
"currentIndex": 0,
"widgets": [
"markdownviewer-widget:Welcome.md"
]
},
{
"type": "split-area",
"orientation": "vertical",
"sizes": [
0.67,
0.33
],
"children": [
{
"type": "tab-area",
"currentIndex": 0,
"widgets": [
"dask-dashboard-launcher:individual-task-stream"
]
},
{
"type": "tab-area",
"currentIndex": 0,
"widgets": [
"dask-dashboard-launcher:individual-progress"
]
}
]
}
]
},
"mode": "multiple-document",
"current": "markdownviewer-widget:Welcome.md"
},
"left": {
"collapsed": false,
"current": "filebrowser",
"widgets": [
"filebrowser",
"running-sessions",
"dask-dashboard-launcher",
"command-palette",
"tab-manager"
]
},
"right": {
"collapsed": true,
"widgets": []
}
},
"markdownviewer-widget:Welcome.md": {
"data": {
"path": "Welcome.md",
"factory": "Markdown Preview"
}
},
"dask-dashboard-launcher": {
"url": "DASK_DASHBOARD_URL",
"cluster": ""
}
},
"metadata": {
"id": "/lab"
}
}
4 changes: 4 additions & 0 deletions binder/postBuild
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/bash

# Install the JupyterLab dask-labextension
jupyter labextension install [email protected]
9 changes: 9 additions & 0 deletions binder/start
Original file line number Diff line number Diff line change
@@ -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

# Temporary workspace workaround
cp binder/jupyterlab-workspace.json /home/jovyan/.jupyter/lab/workspaces/lab-a511.jupyterlab-workspace

exec "$@"

Large diffs are not rendered by default.

0 comments on commit a84e396

Please sign in to comment.