Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
"affiliation": "Netherlands eScience Center",
"name": "Kalverla, Peter",
"orcid": "0000-0002-5025-7862"
},
{
"affiliation": "Netherlands eScience Center",
"name": "Camphuijsen, Jaro",
"orcid": "0000-0002-8928-7831"
}
],
"description": "This software specifies the Jupyter Lab environment set up for the Horizon 2020 project \"European Climate Prediction\" (EUCP).",
Expand Down
8 changes: 7 additions & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# YAML 1.2
---
abstract: "This software specifies the Jupyter Lab environment set up for the Horizon 2020 project \"European Climate Prediction\" (EUCP)."
authors:
authors:
-
affiliation: "Netherlands eScience Center"
family-names: Rol
Expand All @@ -12,6 +12,12 @@ authors:
family-names: Kalverla
given-names: Peter
orcid: "https://orcid.org/0000-0002-5025-7862"
-
affiliation: "Netherlands eScience Center"
family-names: Camphuijsen
given-names: Jaro
orcid: "https://orcid.org/0000-0002-8928-7831"

cff-version: "1.1.0"
date-released: 2020-05-20
doi: "10.5281/zenodo.3835951"
Expand Down
87 changes: 37 additions & 50 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,9 @@
# Docker notebook for climate analysis - European Climate Prediction project

FROM jupyter/datascience-notebook:1386e2046833

FROM jupyter/datascience-notebook:3b1f4f5e6cc1

LABEL maintainer="EUCP-NLESC <e.rol@esciencecenter.nl>"


ENV PCRASTER_DIR=/usr/local/pcraster

USER root

RUN apt-get update \
Expand Down Expand Up @@ -36,71 +32,62 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

RUN mkdir -p $PCRASTER_DIR \
&& chown $NB_UID $PCRASTER_DIR \
&& fix-permissions $PCRASTER_DIR


USER $NB_UID

# Notes:
# - grads is not available under Conda
# - installing ncl under Conda messes up the notebook; for example, the R kernel disappears from the menu
# - Downgrade Matplotlib to 2.2 for Iris
# - pyngl and pynio have incompatible dependencies with some other packages
RUN conda install --quiet --yes --channel esmvalgroup --channel conda-forge --channel pcmdi/label/nightly --override-channels \
'python=3.7.6' \
# - cfunits is not cf-units: cf(dm/-python/-lplot) uses cfunits, iris uses cf-units (imported as cf_units)

RUN conda install --quiet --yes --channel esmvalgroup --channel pcmdi/label/nightly --channel ncas \
# Ensure backwards compatibility:
'boost=1.72.0'\
'cartopy=0.17.0' \
'cartopy=0.18.0' \
'cdms2=3.1.3' \
# 'cdo=1.5.3' \
'cftime=1.1.1.2' \
'cf-plot=3.0.20' \
'cf-python=3.1.0' \
'cfdm=1.7.11' \
'cmor=2019.05.16.master.numpy' \
'dask=2.2.0' \
'eofs=1.4.0' \
'esmpy=8.0.0' \
'gdal=3.0.4' \
'h5py=2.10.0' \
'esmvalcore=2.0.0b9' \
'esmvaltool-python=2.0.0b4' \
'imod=0.9.0' \
'ipyleaflet=0.12.4' \
'ipywidgets=7.5.1' \
'iris=2.4.0' \
'ipyleaflet=0.12.6' \
'iris-sample-data=2.2.0' \
'iris=2.4.0' \
'matplotlib=3.2.1' \
'metpy=0.12.1' \
'nc-time-axis=1.2.0' \
'nco=4.9.1' \
'netcdf4=1.5.3' \
'nco=4.9.2' \
'pcraster=4.3.0' \
'pyproj=2.6.0' \
'rasterio=1.1.3' \
'python-cdo=1.5.3' \
'python=3.7.6' \
'xarray=0.15.1' \
'zarr=2.4.0' \
# 'esmvalcore' \
&& conda clean --all -f -y \
&& fix-permissions $CONDA_DIR \
&& fix-permissions /home/$NB_USER

# For some reason, Conda's cdo does not appear to include the Python
# interface, so it's installed through pip
# The installation of cf-plot will install matplotlib 3.1, which is technically
# different than 2.2; the latter is used by Iris.
# Note: cfunits is not cf-units: cf(dm/-python/-lplot) uses cfunits,
# Iris uses cf-units (imported as cf_units)
RUN pip install \
cdo==1.5.3 \
cfdm==1.7.7 \
cf-python==3.0.1 \
cf-plot==3.0.5 \
cfunits==3.1.1 \
MetPy==0.11.1
flake8 \
black \
yapf \
autopep8 \
isort \
flake8-nb \
jupyterlab_code_formatter==1.3.1


RUN pip install jupyterlab_thredds
RUN jupyter labextension install @jupyter-widgets/jupyterlab-manager
RUN jupyter labextension install jupyter-leaflet
#RUN jupyter labextension install @ewatercycle/jupyterlab_thredds


ENV PATH=${PATH}:${PCRASTER_DIR}/bin
ENV PYTHONPATH=${PYTHONPATH}:${PCRASTER_DIR}/python
# set path explicitly, because otherwise cfunits can't be imported
ENV UDUNITS2_XML_PATH=/opt/conda/share/udunits/udunits2.xml
RUN jupyter labextension install jupyterlab-flake8
RUN jupyter labextension install @ryantam626/jupyterlab_code_formatter@1.3.1
RUN jupyter serverextension enable --py jupyterlab_code_formatter

# Try to enable thredds browser extension (see https://github.com/eWaterCycle/jupyterlab_thredds)
# This doesn't actually seem to work in the notebook, so I'm disabling it for now.
# RUN pip install jupyterlab_thredds && jupyter labextension install @ewatercycle/jupyterlab_thredds

# These paths are set in the conda 'base' env, but that isn't activated by default on a local build.
# to test: import cfunits in notebook, esmvaltool -h in a shell.
# ENV UDUNITS2_XML_PATH=/opt/conda/share/udunits/udunits2.xml
# ENV PROJ_LIB=/opt/conda/share/proj
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,21 @@
![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/eucp/notebook)

# EUCP Jupyterlab environment specification

Dockerfile for the EUCP project - based on the Jupyter datascience notebook\
[View on dockerhub](https://hub.docker.com/repository/docker/eucp/notebook/general)

## Branches

- master: for regular development and updates. Merging via approved pull requests. Linked to 'latest' tag on dockerhub.
- feature branches: make a separate branch for each PR/feature that you want to add.

## Releases

- We'll configure the login environment such that you can select which release you want to use for your compute environment.

## Update process

1. Checkout, build and run the docker image locally
1. Make desired changes to the environment
1. Build and run updated docker image locally for testing
Expand All @@ -28,10 +32,24 @@ Dockerfile for the EUCP project - based on the Jupyter datascience notebook\
## Changelog

May 20, 2020:

- Inherit from newer jupyter/datascience-notebook
- Updated jupyter hub & jupyter lab versions
- Added explicit dependency of matplotlib
- Removed some packages as they are now part of base- or scipy-nb
- Removed some packages as they were installed as dependencies of others
- Moved all pip-installs to conda
- Add esmvalcore and esmvaltool-python
- Upgrade several packages to newer versions
- Disable not-working jupyter-thredds plugin

May 19, 2020:

- Pin versions to current environment configuration
- Add `package_list_for_change_diffs.txt` for keeping track of environment changes.

May 18, 2020:

- Start changelog
- Enable autobuild on dockerhub
- Create master and stable branches
Loading