Commit 8215d7d4 authored by CAMPION Sebastien's avatar CAMPION Sebastien

Merge from jupyterhub

parent 7e28d952
Pipeline #61937 failed with stage
......@@ -10,12 +10,12 @@ import config
SIGNING_KEY_PATH = config.env.ALLGO_TOKEN_SIGNING_KEY_PATH
SIGNING_KEY_TYPE = config.env.ALLGO_TOKEN_SIGNING_KEY_TYPE
SIGNING_KEY_ALG = config.env.ALLGO_TOKEN_SIGNING_KEY_ALG
SIGNING_KEY_ALG = config.env.ALLGO_TOKEN_SIGNING_KEY_ALG
SIGNING_KEY = open(SIGNING_KEY_PATH).read()
ISSUER = config.env.ALLGO_TOKEN_ISSUER
ISSUER = config.env.ALLGO_TOKEN_ISSUER
TOKEN_EXPIRATION = config.env.ALLGO_TOKEN_EXPIRATION
TOKEN_TYPE = config.env.ALLGO_TOKEN_TYPE
TOKEN_TYPE = config.env.ALLGO_TOKEN_TYPE
def run_command(command):
......@@ -28,10 +28,11 @@ def key_id_encode(the_bytes):
result = []
for i in range(0, len(source), 4):
start = i
end = start+4
end = start + 4
result.append(str(source[start:end], 'utf-8'))
return ":".join(result)
def kid_from_crypto_key(private_key_path, key_type):
"""
python implementation of
......@@ -101,4 +102,3 @@ class Token(object):
headers=self.header)
return token
......@@ -4,13 +4,6 @@ from . import views
app_name = 'jwt'
urlpatterns = [
url(r'^jwt/auth$', views.jwt_auth, name="jwt_auth"), # REGISTRY_AUTH_TOKEN_REALM for docker registry
# hooks for registry pull/push for image manifests
url(r'^jwt/pre-(push|pull)$', views.pre_pushpull, name="pre_pushpull"),
url(r'^jwt/post-push$', views.post_push, name="post_push"),
# default catch-all route for docker registry urls (normally unused because
# the reverse-proxy is expected to route them directly to the registry)
url(r'^v2/', views.registry_notfound),
url(r'^jwt/auth', views.jwt_auth, name="jwt_auth"), # REGISTRY_AUTH_TOKEN_REALM for docker registry
url(r'^jupyter$', views.jupyter, name="jupyter"), # 302 redirect to jupyterhub + bearer + gitrepo
]
This diff is collapsed.
......@@ -41,10 +41,27 @@ services:
ALLGO_DEBUG: "True"
ALLGO_ALLOW_LOCAL_ACCOUNTS: "True"
ALLGO_JUPYTER_URL: "http://0.0.0.0:8000/hub/login"
ALLGO_TOKEN_SIGNING_KEY_PATH: "/certs/server.key"
ALLGO_HTTP_SERVER: "django"
ALLGO_EMAIL_BACKEND: "django.core.mail.backends.console.EmailBackend"
# JUPYTER HUB
######################################################################################################################
dev-jupyterhub:
container_name: dev-jupyterhub
build: jupyterhub
ports:
- "8000:8000"
volumes:
- "./certs:/certs"
- "./jupyterhub/jupyterhub_config.py:/srv/jupyterhub/jupyterhub_config.py"
environment:
JUPYTERHUB_LOG_LEVEL: "debug"
JUPYTERHUB_JWT_KEY: "/certs/server.key"
# REDIS
######################################################################################################################
......
jupyterhub_cookie_secret
jupyterhub.sqlite
FROM debian:jessie
ENV DEBIAN_FRONTEND noninteractive
RUN REPO=http://cdn-fastly.deb.debian.org && \
echo "deb $REPO/debian jessie main\ndeb $REPO/debian-security jessie/updates main" > /etc/apt/sources.list && \
apt-get -y update && \
apt-get -y upgrade && \
apt-get -y install wget locales git bzip2 &&\
/usr/sbin/update-locale LANG=C.UTF-8 && \
locale-gen C.UTF-8 && \
apt-get remove -y locales && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
ENV LANG C.UTF-8
# install Python + NodeJS with conda
RUN wget -q https://repo.continuum.io/miniconda/Miniconda3-4.2.12-Linux-x86_64.sh -O /tmp/miniconda.sh && \
echo 'd0c7c71cc5659e54ab51f2005a8d96f3 */tmp/miniconda.sh' | md5sum -c - && \
bash /tmp/miniconda.sh -f -b -p /opt/conda && \
/opt/conda/bin/conda install --yes -c conda-forge \
python=3.5 sqlalchemy tornado jinja2 traitlets requests pip pycurl \
nodejs configurable-http-proxy && \
/opt/conda/bin/pip install --upgrade pip && \
rm /tmp/miniconda.sh
ENV PATH=/opt/conda/bin:$PATH
ADD . /src/jupyterhub
WORKDIR /src/jupyterhub
RUN rm -rf $PWD ~/.cache ~/.npm
RUN pip install notebook==5.4.1
RUN pip install matplotlib
#RUN conda install matplotlib
#RUN conda install pandas
#RUN conda install -c anaconda numpy
#RUN conda install -c anaconda scipy
#RUN conda install scikit-learn
RUN pip install https://github.com/data-8/nbgitpuller/archive/28fe9b1af2ba64b346d59bd13c99581346bf349f.zip --upgrade
RUN jupyter serverextension enable --py nbgitpuller --sys-prefix
RUN pip install ipywidgets
RUN jupyter nbextension enable --py widgetsnbextension
RUN pip install https://github.com/scampion/jwtauthenticator/archive/master.zip --upgrade
RUN pip install allgo
RUN mkdir -p /srv/jupyterhub/
WORKDIR /srv/jupyterhub/
EXPOSE 8000
ENV PYTHONUNBUFFERED 1
CMD jupyterhub -f /srv/jupyterhub/jupyterhub_config.py
\ No newline at end of file
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment