Skip to content

Commit

Permalink
build singleuser-py3.11 with dev branch of zen extension
Browse files Browse the repository at this point in the history
  • Loading branch information
garciagenrique committed Oct 21, 2024
1 parent 5533fd2 commit 4996f2a
Showing 1 changed file with 71 additions and 78 deletions.
149 changes: 71 additions & 78 deletions vre-singleuser-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,90 +1,83 @@
FROM ghcr.io/vre-hub/vre-singleuser-py311:sha-5bd80fc
FROM quay.io/jupyter/scipy-notebook:python-3.11.8
LABEL author="Image based on the work by Muhammad Aditya Hilmy - ESCAPE WP2 2020"
LABEL maintainer="VRE Team @ CERN 23/24 - E. Garcia, G. Guerrieri"
LABEL org.opencontainers.image.source https://github.com/vre-hub/environments
ARG BUILD_DATE
LABEL org.label-schema.build-date=$BUILD_DATE

# RUN python -m pip install --upgrade pip

# USER $NB_UID

# RUN conda install -y -n base mamba \
# && mamba install -y -c conda-forge python-gfal2 \
# nodejs \
# jupyterlab">4,<5" \
# notebook"<7" \
# jupyterhub \
# jsonschema>4 \
# jupyterlab_server \
# jupyter_server \
# traitlets \
# nbformat \
# ipykernel \
# PyJWT \
# ipywidgets \
# && conda clean --all -f -y

# # Install jupyterlab extensions
# RUN python -m pip install rucio-jupyterlab==1.0.0 \
# && jupyter server extension enable --py rucio_jupyterlab --sys-prefix

# RUN python -m pip install swanoauthrenew==1.0.1 \
# && jupyter server extension enable --py swanoauthrenew --sys-prefix

# RUN python -m pip install reana-jupyterlab \
# && jupyter server extension enable --py reana_jupyterlab --sys-prefix

# RUN git clone https://github.com/vre-hub/zenodo-jupyterlab-extension.git \
# && cd zenodo-jupyterlab-extension \
# && python -m pip install . \
# && jupyter server extension enable --py zenodo_jupyterlab.server --sys-prefix \
# && cd .. \
# && rm -rf zenodo-jupyterlab-extension
RUN python -m pip install --upgrade pip

USER $NB_UID

RUN conda install -y -n base mamba \
&& mamba install -y -c conda-forge python-gfal2 \
nodejs \
jupyterlab">4,<5" \
notebook"<7" \
jupyterhub \
jsonschema>4 \
jupyterlab_server \
jupyter_server \
traitlets \
nbformat \
ipykernel \
PyJWT \
ipywidgets \
&& conda clean --all -f -y

# Install jupyterlab extensions
RUN python -m pip install rucio-jupyterlab==1.0.0 \
&& jupyter server extension enable --py rucio_jupyterlab --sys-prefix

RUN python -m pip install swanoauthrenew==1.0.1 \
&& jupyter server extension enable --py swanoauthrenew --sys-prefix

RUN python -m pip install reana-jupyterlab \
&& jupyter server extension enable --py reana_jupyterlab --sys-prefix

RUN git clone https://github.com/vre-hub/zenodo-jupyterlab-extension.git \
&& cd zenodo-jupyterlab-extension \
&& git checkout dev \
&& python -m pip install . \
&& jupyter server extension enable --py zenodo_jupyterlab.server --sys-prefix \
&& cd .. \
&& rm -rf zenodo-jupyterlab-extension

# # Custom version of reana-client due to the jsonschema problem
# RUN python -m pip install git+https://github.com/mdonadoni/reana-client.git@vre-summer-24

# USER root

# RUN apt update -y \
# && apt install -y build-essential curl voms-clients-java software-properties-common \
# && apt clean -y \
# && rm /opt/conda/bin/voms-proxy-init \
# && ln -s /usr/bin/voms-proxy-init /opt/conda/bin/voms-proxy-init

# # ESCAPE grid-security and VOMS setup
# RUN wget -q -O - https://dist.eugridpma.info/distribution/igtf/current/GPG-KEY-EUGridPMA-RPM-3 | apt-key add -

# RUN apt update \
# && add-apt-repository 'deb http://repository.egi.eu/sw/production/cas/1/current egi-igtf core' \
# && apt -y install ca-policy-egi-core

# RUN mkdir -p /etc/vomses \
# && wget https://indigo-iam.github.io/escape-docs/voms-config/voms-escape.cloud.cnaf.infn.it.vomses -O /etc/vomses/voms-escape.cloud.cnaf.infn.it.vomses \
# && mkdir -p /etc/grid-security/vomsdir/escape \
# && wget https://indigo-iam.github.io/escape-docs/voms-config/voms-escape.cloud.cnaf.infn.it.lsc -O /etc/grid-security/vomsdir/escape/voms-escape.cloud.cnaf.infn.it.lsc

# # Setup merged CERN CA file on Ubuntu based images.
# # This file is contained in the `CERN-bundle.pem` file downloaded using
# RUN mkdir /certs \
# && touch /certs/rucio_ca.pem \
# && curl -fsSL 'https://cafiles.cern.ch/cafiles/certificates/CERN%20Root%20Certification%20Authority%202.crt' | openssl x509 -inform DER -out /tmp/cernrootca2.crt \
# && curl -fsSL 'https://cafiles.cern.ch/cafiles/certificates/CERN%20Grid%20Certification%20Authority(1).crt' -o /tmp/cerngridca.crt \
# && curl -fsSL 'https://cafiles.cern.ch/cafiles/certificates/CERN%20Certification%20Authority.crt' -o /tmp/cernca.crt \
# && cat /tmp/cernrootca2.crt >> /certs/rucio_ca.pem \
# && cat /tmp/cerngridca.crt >> /certs/rucio_ca.pem \
# && cat /tmp/cernca.crt >> /certs/rucio_ca.pem \
# && rm /tmp/*.crt \
# && update-ca-certificates
# Custom version of reana-client due to the jsonschema problem
RUN python -m pip install git+https://github.com/mdonadoni/reana-client.git@vre-summer-24

USER root

RUN echo '"atlas" "voms-atlas-auth.app.cern.ch" "443" "/DC=ch/DC=cern/OU=computers/CN=atlas-auth.web.cern.ch" "atlas" "24"' > /etc/vomses/atlas-voms-atlas-auth.app.cern.ch \
&& mkdir -p /etc/grid-security/vomsdir/atlas

COPY voms-atlas-auth.app.cern.ch.lsc /etc/grid-security/vomsdir/atlas/voms-atlas-auth.app.cern.ch.lsc
COPY voms-atlas-auth.cern.ch.lsc /etc/grid-security/vomsdir/atlas/voms-atlas-auth.cern.ch.lsc
RUN apt update -y \
&& apt install -y build-essential curl voms-clients-java software-properties-common \
&& apt clean -y \
&& rm /opt/conda/bin/voms-proxy-init \
&& ln -s /usr/bin/voms-proxy-init /opt/conda/bin/voms-proxy-init

# ESCAPE grid-security and VOMS setup
RUN wget -q -O - https://dist.eugridpma.info/distribution/igtf/current/GPG-KEY-EUGridPMA-RPM-3 | apt-key add -

RUN apt update \
&& add-apt-repository 'deb http://repository.egi.eu/sw/production/cas/1/current egi-igtf core' \
&& apt -y install ca-policy-egi-core

RUN mkdir -p /etc/vomses \
&& wget https://indigo-iam.github.io/escape-docs/voms-config/voms-escape.cloud.cnaf.infn.it.vomses -O /etc/vomses/voms-escape.cloud.cnaf.infn.it.vomses \
&& mkdir -p /etc/grid-security/vomsdir/escape \
&& wget https://indigo-iam.github.io/escape-docs/voms-config/voms-escape.cloud.cnaf.infn.it.lsc -O /etc/grid-security/vomsdir/escape/voms-escape.cloud.cnaf.infn.it.lsc

# Setup merged CERN CA file on Ubuntu based images.
# This file is contained in the `CERN-bundle.pem` file downloaded using
RUN mkdir /certs \
&& touch /certs/rucio_ca.pem \
&& curl -fsSL 'https://cafiles.cern.ch/cafiles/certificates/CERN%20Root%20Certification%20Authority%202.crt' | openssl x509 -inform DER -out /tmp/cernrootca2.crt \
&& curl -fsSL 'https://cafiles.cern.ch/cafiles/certificates/CERN%20Grid%20Certification%20Authority(1).crt' -o /tmp/cerngridca.crt \
&& curl -fsSL 'https://cafiles.cern.ch/cafiles/certificates/CERN%20Certification%20Authority.crt' -o /tmp/cernca.crt \
&& cat /tmp/cernrootca2.crt >> /certs/rucio_ca.pem \
&& cat /tmp/cerngridca.crt >> /certs/rucio_ca.pem \
&& cat /tmp/cernca.crt >> /certs/rucio_ca.pem \
&& rm /tmp/*.crt \
&& update-ca-certificates

# Setup extension Rucio instance config
COPY configure-vre.py /usr/local/bin/
Expand All @@ -100,4 +93,4 @@ ENV JUPYTERHUB_SINGLEUSER_APP=jupyter-server
WORKDIR $HOME
USER $NB_UID

CMD ["start-notebook.py"]
CMD ["start-notebook.py"]

0 comments on commit 4996f2a

Please sign in to comment.