From 24637191f05148098639e4a7860291974815aa03 Mon Sep 17 00:00:00 2001 From: Julien Chastang Date: Tue, 28 May 2024 15:01:47 -0600 Subject: [PATCH] soars summer 2024 --- jupyter-images/soars-summer-2024/Dockerfile | 37 ++++++++++++ jupyter-images/soars-summer-2024/secrets.yaml | 59 +++++++++++++++++++ 2 files changed, 96 insertions(+) create mode 100644 jupyter-images/soars-summer-2024/Dockerfile create mode 100644 jupyter-images/soars-summer-2024/secrets.yaml diff --git a/jupyter-images/soars-summer-2024/Dockerfile b/jupyter-images/soars-summer-2024/Dockerfile new file mode 100644 index 00000000..347cbff6 --- /dev/null +++ b/jupyter-images/soars-summer-2024/Dockerfile @@ -0,0 +1,37 @@ +# Heavily borrowed from docker-stacks/scipy-notebook/ +# https://github.com/jupyter/docker-stacks/blob/main/scipy-notebook/Dockerfile + +ARG BASE_CONTAINER=jupyter/scipy-notebook:latest +FROM $BASE_CONTAINER + +LABEL maintainer="Unidata " + +USER root + +# Fix: https://github.com/hadolint/hadolint/wiki/DL4006 +# Fix: https://github.com/koalaman/shellcheck/wiki/SC3014 +SHELL ["/bin/bash", "-o", "pipefail", "-c"] + +ENV DEBIAN_FRONTEND noninteractive +RUN apt-get update --yes && \ + apt-get upgrade --yes && \ + apt-get install --yes --no-install-recommends \ + bzip2 wget curl && \ + apt-get install -y python3.10 python3.10-distutils && \ + curl -sS https://bootstrap.pypa.io/get-pip.py | python3.10 && \ + ln -sfn /usr/bin/python3.10 /usr/bin/python3 && \ + ln -sfn /usr/bin/python3 /usr/bin/python && \ + ln -sfn /usr/bin/pip3 /usr/bin/pip && \ + pip install --no-cache-dir jupyterhub==3.0.0 && \ + pip install --no-cache-dir --upgrade jupyterlab notebook jupyter_server jupyterlab-git && \ + python3 -m pip install jupyterlab-github ipydrawio[all] jupyter_ai nbdime && \ + apt-get clean && rm -rf /var/lib/apt/lists/* && \ + echo "en_US.UTF-8 UTF-8" > /etc/locale.gen && \ + fix-permissions "${HOME}" && \ + locale-gen + +USER $NB_UID + +COPY Acknowledgements.ipynb / + +USER $NB_UID diff --git a/jupyter-images/soars-summer-2024/secrets.yaml b/jupyter-images/soars-summer-2024/secrets.yaml new file mode 100644 index 00000000..dc0b3fff --- /dev/null +++ b/jupyter-images/soars-summer-2024/secrets.yaml @@ -0,0 +1,59 @@ +hub: + cookieSecret: "xxx" + + config: + Authenticator: + admin_users: + - admin + allowed_users: + - user + GitHubOAuthenticator: + client_id: "xxx" + client_secret: "xxx" + oauth_callback_url: "https://soars.unidata.ucar.edu:443/oauth_callback" + JupyterHub: + authenticator_class: github + +proxy: + secretToken: "xxx" + +ingress: + enabled: true + annotations: + kubernetes.io/ingress.class: "nginx" + cert-manager.io/issuer: "incommon" + nginx.ingress.kubernetes.io/proxy-body-size: 300m + hosts: + - soars.unidata.ucar.edu + tls: + - hosts: + - soars.unidata.ucar.edu + secretName: cert-secret + +singleuser: + extraEnv: + NBGITPULLER_DEPTH: "0" + storage: + capacity: 5Gi + startTimeout: 600 + memory: + guarantee: 4G + limit: 4G + cpu: + guarantee: 1 + limit: 2 + defaultUrl: "/lab" + image: + name: "unidata/soars-summer-2023" + tag: "2023May20_195258_cd799d49" + lifecycleHooks: + postStart: + exec: + command: + - "sh" + - "-c" + - > + cp -t /home/jovyan /Acknowledgements.ipynb; + dir="/home/jovyan/.ssh"; [ -d $dir ] && \ + { chmod 700 $dir && chmod -f 600 $dir/* && \ + chmod -f 644 $dir/*.pub; } || true