Skip to content
This repository has been archived by the owner on Apr 29, 2021. It is now read-only.

Commit

Permalink
Merge pull request #76 from NERSC/20-03
Browse files Browse the repository at this point in the history
20 03
  • Loading branch information
rcthomas authored Jul 1, 2020
2 parents 30420bf + 5fc3c46 commit 554e40c
Show file tree
Hide file tree
Showing 18 changed files with 444 additions and 100 deletions.
52 changes: 29 additions & 23 deletions jupyter-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04
LABEL maintainer="Rollin Thomas <[email protected]>"

# Base Ubuntu packages
Expand Down Expand Up @@ -29,41 +29,47 @@ RUN \
# Python 3 Miniconda and dependencies for JupyterHub we can get via conda

RUN \
curl -s -o /tmp/miniconda3.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
curl -s -o /tmp/miniconda3.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash /tmp/miniconda3.sh -b -p /opt/anaconda3 && \
rm -rf /tmp/miniconda3.sh && \
echo "python 3.7.3" >> /opt/anaconda3/conda-meta/pinned && \
/opt/anaconda3/bin/conda update --yes conda && \
/opt/anaconda3/bin/conda install --yes \
alembic \
cryptography \
decorator \
entrypoints \
jinja2 \
mako \
markupsafe \
nodejs \
oauthlib \
pamela \
psycopg2 \
pyopenssl \
python-dateutil \
python-editor \
sqlalchemy \
tornado \
traitlets
alembic \
attrs \
certipy \
cryptography \
decorator \
entrypoints \
jinja2 \
jsonschema \
mako \
markupsafe \
more-itertools \
nodejs \
oauthlib \
pamela \
psycopg2 \
pyopenssl \
pyrsistent \
python-dateutil \
python-editor \
ruamel.yaml \
ruamel.yaml.clib \
sqlalchemy \
tornado \
traitlets \
zipp

# Install JupyterHub

ENV PATH=/opt/anaconda3/bin:$PATH
WORKDIR /tmp
RUN \
npm install -g configurable-http-proxy && \
# git clone https://github.com/jupyterhub/jupyterhub.git && \
git clone https://github.com/rcthomas/jupyterhub.git && \
git clone https://github.com/jupyterhub/jupyterhub.git && \
cd jupyterhub && \
# git checkout tags/1.0.0 && \
git checkout auth-state-to-spawner && \
git checkout tags/1.1.0 && \
/opt/anaconda3/bin/python setup.py js && \
/opt/anaconda3/bin/pip --no-cache-dir install . && \
cp examples/cull-idle/cull_idle_servers.py /opt/anaconda3/bin/. && \
Expand Down
18 changes: 16 additions & 2 deletions jupyter-base/build.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,21 @@
#!/bin/bash

imcmd=""
for command in docker podman; do
if [ $(command -v $command) ]; then
imcmd=$command
break
fi
done
if [ -n "$imcmd" ]; then
echo "Using $imcmd"
else
echo "No image command defined"
exit 1
fi

branch=$(git symbolic-ref --short HEAD)

docker build \
--no-cache \
$imcmd build \
"$@" \
--tag registry.spin.nersc.gov/das/jupyter-base-$branch:latest .
6 changes: 3 additions & 3 deletions jupyter-nersc/app-monitoring/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:16.04
FROM ubuntu:18.04
LABEL maintainer="Rollin Thomas <[email protected]>"

# Base Ubuntu packages
Expand All @@ -25,10 +25,10 @@ RUN \
# Python 3 Miniconda

RUN \
curl -s -o /tmp/miniconda3.sh https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
curl -s -o /tmp/miniconda3.sh https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh && \
bash /tmp/miniconda3.sh -f -b -p /opt/anaconda3 && \
rm -rf /tmp/miniconda3.sh && \
# /opt/anaconda3/bin/conda update --yes conda && \
/opt/anaconda3/bin/conda update --yes conda && \
/opt/anaconda3/bin/pip install --no-cache-dir \
pika

Expand Down
1 change: 1 addition & 0 deletions jupyter-nersc/app-notebooks/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ RUN \
ldap-utils \
libnss-ldapd \
libpam-ldap \
libxrender-dev \
nscd \
openssh-server \
supervisor \
Expand Down
2 changes: 1 addition & 1 deletion jupyter-nersc/web-announcement/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ FROM registry.spin.nersc.gov/das/jupyter-base-${branch}:latest
LABEL maintainer="Rollin Thomas <[email protected]>"

RUN \
pip install git+https://github.com/rcthomas/jupyterhub-announcement.git@0.3.1
pip install git+https://github.com/rcthomas/jupyterhub-announcement.git@0.4.1

WORKDIR /srv

Expand Down
18 changes: 18 additions & 0 deletions jupyter-nersc/web-announcement/announcement_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@
# AnnouncementQueue(LoggingConfigurable) configuration
#------------------------------------------------------------------------------

## Number of days to retain announcements.
#
# Announcements that have been in the queue for this many days are purged from
# the queue.
#c.AnnouncementQueue.lifetime_days = 7.0

## File path where announcements persist as JSON.
#
# For a persistent announcement queue, this parameter must be set to a non-empty
Expand All @@ -70,3 +76,15 @@
#c.AnnouncementQueue.persist_path = ''
c.AnnouncementQueue.persist_path = 'announcements.json'

#------------------------------------------------------------------------------
# SSLContext(Configurable) configuration
#------------------------------------------------------------------------------

## SSL CA, use with keyfile and certfile
#c.SSLContext.cafile = ''

## SSL cert, use with keyfile
#c.SSLContext.certfile = ''

## SSL key, use with certfile
#c.SSLContext.keyfile = ''
7 changes: 4 additions & 3 deletions jupyter-nersc/web-jupyterhub/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ WORKDIR /srv
# Authenticator and spawner

RUN \
pip install git+https://github.com/nersc/sshapiauthenticator.git && \
pip install git+https://github.com/jupyterhub/batchspawner.git@4747946 && \
pip install git+https://github.com/jupyterhub/wrapspawner.git && \
pip install git+https://github.com/nersc/sshapiauthenticator.git && \
pip install git+https://github.com/jupyterhub/batchspawner.git@v1.0.0-rc0 && \
pip install git+https://github.com/jupyterhub/wrapspawner.git && \
pip install git+https://github.com/nersc/sshspawner.git

# Customized templates
Expand All @@ -22,6 +22,7 @@ ENV PYTHONPATH=/srv
ADD nerscspawner.py .
ADD nerscslurmspawner.py .
ADD iris.py .
ADD spinproxy.py .

# Hub scripts

Expand Down
16 changes: 15 additions & 1 deletion jupyter-nersc/web-jupyterhub/build.sh
Original file line number Diff line number Diff line change
@@ -1,8 +1,22 @@
#!/bin/bash

imcmd=""
for command in docker podman; do
if [ $(command -v $command) ]; then
imcmd=$command
break
fi
done
if [ -n "$imcmd" ]; then
echo "Using $imcmd"
else
echo "No image command defined"
exit 1
fi

branch=$(git symbolic-ref --short HEAD)

docker build \
$imcmd build \
--build-arg branch=$branch \
"$@" \
--tag registry.spin.nersc.gov/das/web-jupyterhub.jupyter-nersc-$branch:latest .
1 change: 1 addition & 0 deletions jupyter-nersc/web-jupyterhub/iris.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ async def query_user(self, name):
query {{
systemInfo {{
users(name: "{}") {{
uid
baseRepos {{
computeAllocation {{
repoName
Expand Down
Loading

0 comments on commit 554e40c

Please sign in to comment.