From 7b0290f3dcc7fd99aabd050746a2342d66a7a553 Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Tue, 1 Sep 2020 21:13:17 +0100 Subject: [PATCH 1/3] Adds a new buildscript for miniconda + jupyterhub --- miniconda-jupyterhub-4.8.3_install | 53 ++++++++++++++++++++++++++++++ 1 file changed, 53 insertions(+) create mode 100644 miniconda-jupyterhub-4.8.3_install diff --git a/miniconda-jupyterhub-4.8.3_install b/miniconda-jupyterhub-4.8.3_install new file mode 100644 index 00000000..8e83ba57 --- /dev/null +++ b/miniconda-jupyterhub-4.8.3_install @@ -0,0 +1,53 @@ +#!/usr/bin/env bash + +############################################### +# Installing miniconda and jupyterhub +# +# by Owain Kenway, 2018, David PS, 2020 +# +set -e + +for i in ${includes_dir:=$(dirname $0 2>/dev/null)/includes}/{module_maker,require}_inc.sh; do . $i; done + +require gcc-libs/4.9.2 + +NAME=${NAME:-miniconda-jhub} +VERSION=${VERSION:-4.8.3} +INSTALL_PREFIX=${INSTALL_PREFIX:-/shared/ucl/apps/$NAME/$VERSION/$COMPILER_TAG} +SHA256=${SHA256:-879457af6a0bf5b34b48c12de31d4df0ee2f06a8e68768e5758c3293b2daf688} + +SRC_ARCHIVE=${SRC_ARCHIVE:-https://repo.anaconda.com/miniconda/Miniconda3-py38_${VERSION}-Linux-x86_64.sh} + + +mkdir -p /dev/shm/$(whoami)/${NAME} + +temp_dir=$(mktemp -d -p /dev/shm/$(whoami)/${NAME}) + +cd $temp_dir + +wget $SRC_ARCHIVE +archive=$(basename "${SRC_ARCHIVE}") + +sha256sum -c <<< "$SHA256 $archive" + +bash "Miniconda3-py38_${VERSION}-Linux-x86_64.sh" -b -p ${INSTALL_PREFIX} -f + + +# Basic conda installation, now to install JupyterHub +# Load installed conda environment + + +# Install jupyterhub +oldpath=$PATH +PATH=$INSTALL_PREFIX/bin:$PATH +conda install -y -c conda-forge jupyterhub # installs jupyterhub and proxy +conda install -y jupyterlab notebook # needed if running the notebook servers locally +# Extensions - git for jupyterlab +conda install -y -c conda-forge jupyterlab-git +jupyter lab build + + +PATH=$oldpath + +cd +rm -rf $temp_dir From 445f0a231433e8043766af8cff8cf607529f3bce Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Tue, 1 Sep 2020 21:13:42 +0100 Subject: [PATCH 2/3] Adds VSCode to jupyterhub via a separate environment --- miniconda-jupyterhub-4.8.3_install | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/miniconda-jupyterhub-4.8.3_install b/miniconda-jupyterhub-4.8.3_install index 8e83ba57..d4a2d4e3 100644 --- a/miniconda-jupyterhub-4.8.3_install +++ b/miniconda-jupyterhub-4.8.3_install @@ -46,6 +46,17 @@ conda install -y jupyterlab notebook # needed if running the notebook servers l conda install -y -c conda-forge jupyterlab-git jupyter lab build +# Extensions - VS Code via jupyter-lab +conda install -y -c conda-forge jupyter-server-proxy jupyter-vscode-proxy # VS code interface +jupyter labextension install @jupyterlab/server-proxy # It's not being installed from conda? +jupyter lab build + +# creating it in its own environment: +conda create -n jhubcode -c conda-forge code-server -y +sed -i "2iCONDA_PREFIX=/shared/ucl/apps/miniconda-jhub/4.8.3/envs/jhubcode" /shared/ucl/apps/miniconda-jhub/4.8.3/envs/jhubcode/bin/code-server +sed -i 's|node|${CONDA_PREFIX}/bin/node|' /shared/ucl/apps/miniconda-jhub/4.8.3/envs/jhubcode/bin/code-server +ln -s /shared/ucl/apps/miniconda-jhub/4.8.3/envs/jhubcode/bin/code-server /shared/ucl/apps/miniconda-jhub/4.8.3/bin/code-server +code-server --install-extension ms-python.pythonnp PATH=$oldpath From bf98b302ebffbded742dceb117d8bf84bc05731e Mon Sep 17 00:00:00 2001 From: David Perez-Suarez Date: Wed, 2 Sep 2020 14:34:49 +0100 Subject: [PATCH 3/3] =?UTF-8?q?=F0=9F=93=A6=20Includes=20a=20list=20of=20p?= =?UTF-8?q?ackages=20that=20may=20be=20needed=20for=20teaching?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- miniconda-jupyterhub-4.8.3_install | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/miniconda-jupyterhub-4.8.3_install b/miniconda-jupyterhub-4.8.3_install index d4a2d4e3..79394dd5 100644 --- a/miniconda-jupyterhub-4.8.3_install +++ b/miniconda-jupyterhub-4.8.3_install @@ -58,6 +58,34 @@ sed -i 's|node|${CONDA_PREFIX}/bin/node|' /shared/ucl/apps/miniconda-jhub/4.8.3/ ln -s /shared/ucl/apps/miniconda-jhub/4.8.3/envs/jhubcode/bin/code-server /shared/ucl/apps/miniconda-jhub/4.8.3/bin/code-server code-server --install-extension ms-python.pythonnp +# package dependencies +packages=( + # Scientific stack + numpy numpydoc scipy pandas pandas-datareader pandasql + # python tooling + pip setuptools sphinx requests + # plotting + matplotlib bokeh plotly + # domain libraries + astropy biopython nltk proj4 scikit-image scikit-learn statsmodels sympy pytorch tensorflow pywavelets gdal + # Performance and distribution + cython dask dask-core dask-glm dask-ml numba + # Files and db + dill h5py hdf5 pytables pyyaml xarray xlsxwriter sqlalchemy sqlalchemy-utils + # tooling + flake8 isort memory_profiler python-language-server rope typing typing_extensions yapf tox + # testing + pytest pytest-arraydiff pytest-astropy pytest-asyncio pytest-cov pytest-doctestplus pytest-mock + pytest-pep8 pytest-runner pytest-timeout pytest-xdist mock + # conda related and notebooks + nb_conda_kernels + # Teaching + nbgrader +) + +conda install -y -c conda-forge "${packages[@]}" + + PATH=$oldpath cd