Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mvu24f #967

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
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
2 changes: 2 additions & 0 deletions jupyter-images/mvu24f/.condarc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
envs_dirs:
- /home/jovyan/additional-envs
43 changes: 43 additions & 0 deletions jupyter-images/mvu24f/Acknowledgements.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "c86cd54f-b73c-4781-b6eb-89c79d3d3b22",
"metadata": {},
"source": [
"## Acknowledgements\n",
"\n",
"Launching this JupyterHub server is the result of a collaboration between several research and academic institutions and their staff. For Jetstream2 and JupyterHub expertise, we thank Andrea Zonca (San Diego Supercomputing Center), Jeremy Fischer, Mike Lowe (Indiana University), the NSF Jetstream2 (`doi:10.1145/3437359.3465565`) team.\n",
"\n",
"This work employs the NSF Jetstream2 Cloud at Indiana University through allocation EES220002 from the Advanced Cyberinfrastructure Coordination Ecosystem: Services & Support (ACCESS) program, which is supported by National Science Foundation grants #2138259, #2138286, #2138307, #2137603, and #2138296.\n",
"\n",
"Unidata is one of the University Corporation for Atmospheric Research (UCAR)'s Community Programs (UCP), and is funded primarily by the National Science Foundation (AGS-2403649).\n",
"\n",
"## To Acknowledge This JupyterHub and the Unidata Science Gateway\n",
"\n",
"If you have benefited from the Unidata Science Gateway, please cite `doi:10.5065/688s-2w73`. Additional citation information can be found in this [Citation File Format file](https://raw.githubusercontent.com/Unidata/science-gateway/master/CITATION.cff).\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
53 changes: 53 additions & 0 deletions jupyter-images/mvu24f/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Heavily borrowed from docker-stacks/minimal-notebook/
# https://github.com/jupyter/docker-stacks/blob/main/minimal-notebook/Dockerfile

# Due to a linking issue with glibc, I'm basing this image off a previous
# semester's image

FROM unidata/mvu24s:2024Mar12_145946_8a22

ENV DEFAULT_ENV_NAME=mvu24f EDITOR=nano VISUAL=nano

LABEL maintainer="Unidata <[email protected]>"

USER root

RUN apt-get update && \
apt-get install -y --no-install-recommends vim nano curl zip unzip wget \
gcc cpp gfortran g++ openmpi-bin libopenmpi-dev git csh perl file \
make m4 ca-certificates libgl1 && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

USER $NB_UID

ADD environment.yml /tmp

# Rename the previous environment before updating it
RUN mamba rename -n mvu24s $DEFAULT_ENV_NAME && \
mamba install --quiet --yes \
'conda-forge::nb_conda_kernels' \
'conda-forge::jupyterlab-git' \
'conda-forge::ipywidgets' && \
mamba env update --name $DEFAULT_ENV_NAME -f /tmp/environment.yml && \
pip install --no-cache-dir nbgitpuller && \
mamba clean --all -f -y && \
jupyter lab clean -y && \
npm cache clean --force && \
rm -rf /home/$NB_USER/.cache/yarn && \
rm -rf /home/$NB_USER/.node-gyp && \
fix-permissions $CONDA_DIR && \
fix-permissions /home/$NB_USER

COPY additional_kernels.ipynb update_material.ipynb Acknowledgements.ipynb \
default_kernel.py .condarc /

ARG JUPYTER_SETTINGS_DIR=/opt/conda/share/jupyter/lab/settings/
COPY overrides.json $JUPYTER_SETTINGS_DIR

USER root

RUN chown -R ${NB_UID}:${NB_GID} /Build_WRF/WRF && \
ldconfig /Build_WRF/LIBRARIES/netcdf/lib

USER $NB_UID
3,587 changes: 3,587 additions & 0 deletions jupyter-images/mvu24f/Registry.EM_COMMON_edit

Large diffs are not rendered by default.

52 changes: 52 additions & 0 deletions jupyter-images/mvu24f/additional_kernels.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "a9d9cf3f-590d-40ef-8421-a9789a03bb07",
"metadata": {},
"source": [
"### Creating Additional Kernels\n",
"\n",
"You can also create additional kernels and have them be available via the kernel menu. Your kernel must contain the `nb_conda_kernels` and `ipykernel` packages for this to work. For example, if you wish to have a kernel with the `seaborn` package, you can create the following `environment.yml` from the terminal with the `pico` editor:\n",
"\n",
"```yaml\n",
" name: myenv\n",
" channels:\n",
" - conda-forge\n",
" dependencies:\n",
" - python=3\n",
" - seaborn\n",
" - nb_conda_kernels\n",
" - ipykernel\n",
"```\n",
"\n",
"followed by\n",
"\n",
"`mamba env update --name myenv -f environment.yml`\n",
"\n",
"at this point `myenv` will be available via the `Kernel → Change kernel...` menu."
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3 (ipykernel)",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.10.6"
}
},
"nbformat": 4,
"nbformat_minor": 5
}
28 changes: 28 additions & 0 deletions jupyter-images/mvu24f/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
#!/bin/bash

# Check if an image name is provided
if [ -z "$1" ]; then
echo "Error: No image name provided."
echo "Usage: $0 <image-name>"
exit 1
fi

IMAGE_NAME=$1

DATE_TAG=$(date "+%Y%b%d_%H%M%S")
RANDOM_HEX=$(openssl rand -hex 2)
TAG="${DATE_TAG}_${RANDOM_HEX}"

FULL_TAG="unidata/$IMAGE_NAME:$TAG"

echo "Building Docker image with tag: $FULL_TAG"

docker build --no-cache --pull --tag "$FULL_TAG" .

# Check if the build was successful
if [ $? -eq 0 ]; then
echo "Docker image built successfully: $FULL_TAG"
else
echo "Error: Docker build failed."
exit 1
fi
Loading