Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
52 commits
Select commit Hold shift + click to select a range
6c91d2a
build dev image changing ini setup.sh
garciagenrique Feb 8, 2024
de3d457
build dev image without running notebook config
garciagenrique Feb 9, 2024
8bd0f5e
increase mem and buffer size
garciagenrique Feb 9, 2024
30a2489
increase mem and buffer size
garciagenrique Feb 9, 2024
c04b51f
increase mem and buffer size
garciagenrique Feb 9, 2024
2ad5b56
fix permissions of .jupyter dir
garciagenrique Jul 3, 2024
42bc682
fix install
garciagenrique Jul 3, 2024
1e0cd9a
fix rights
garciagenrique Jul 3, 2024
f740a96
fix rights
garciagenrique Jul 3, 2024
c27e7d1
fix rights 2
garciagenrique Jul 3, 2024
4211d76
test dev
garciagenrique Aug 14, 2024
6089aee
building image from zero
garciagenrique Aug 14, 2024
cf69c93
remove exec
garciagenrique Aug 14, 2024
9ff50ce
start notebook
garciagenrique Aug 14, 2024
4ea8acc
solve create.<locals>.Validator.__init__
garciagenrique Aug 14, 2024
592cf59
stupid jsonschema
garciagenrique Aug 14, 2024
a5e3bf2
restartin from zero
garciagenrique Aug 14, 2024
0a59663
restartin from zero
garciagenrique Aug 14, 2024
7b59dca
Update Dockerfile
garciagenrique Aug 14, 2024
97515ba
start sungleuser
garciagenrique Aug 19, 2024
c081bec
start sungleuser
garciagenrique Aug 19, 2024
64264b5
quay and start-notebook.py
garciagenrique Aug 19, 2024
1c2a84f
Merge branch 'main' into dev_image
garciagenrique Oct 8, 2024
5f3e81f
build dev image accessing atlas RSE
garciagenrique Oct 8, 2024
ffcf3d9
trigger correctly dev branch
garciagenrique Oct 8, 2024
90b03e1
int on json file
garciagenrique Oct 8, 2024
8a62a70
root user, of course
garciagenrique Oct 8, 2024
5c9bc5f
dealing with jsonschema.exceptions.ValidationError
garciagenrique Oct 8, 2024
2bd3c40
fixing dics
garciagenrique Oct 8, 2024
bd2cc1b
vomses
garciagenrique Oct 8, 2024
6599d67
vomses correct path
garciagenrique Oct 8, 2024
8972cb8
vomses correct path 2
garciagenrique Oct 8, 2024
3120db1
Test using ATLAS only config
Soap2G Oct 8, 2024
5533fd2
black magic
garciagenrique Oct 8, 2024
4996f2a
build singleuser-py3.11 with dev branch of zen extension
garciagenrique Oct 21, 2024
83e5032
Update configure-vre.py with RUCIO vre
garciagenrique Oct 22, 2024
57724d4
Update configure-vre.py
garciagenrique Oct 22, 2024
93d62fd
add both rucio instances
garciagenrique Dec 13, 2024
3596bc4
fix comnflicts
garciagenrique Dec 13, 2024
2199e89
feat: validation on Rucio ext 1
Soap2G May 21, 2025
5ccc26e
feat: validation on Rucio ext 2
Soap2G May 21, 2025
e8523de
fix: adding certificates to image
Soap2G May 23, 2025
e91594f
fix: adding certificates to image
Soap2G May 23, 2025
e01dcc3
fix: adding certificates to image
Soap2G May 23, 2025
99b7f62
fix: adding certificates to image
Soap2G May 23, 2025
fb445c2
fix: adding certificates to image
Soap2G May 23, 2025
8e03494
fix: adding certificates to image
Soap2G May 23, 2025
8fe3b68
adding debug level to extension
Soap2G May 27, 2025
a1ecf12
test new v1.3.0
garciagenrique Jun 25, 2025
e2f5477
solve conflicts
garciagenrique Jun 25, 2025
efe314c
feat: build v1.3.0 from wheels
garciagenrique Jun 27, 2025
75e7035
feat: build v1.3.2 from wheels for dev image
garciagenrique Jun 27, 2025
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: 1 addition & 1 deletion .github/workflows/env-build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Docker automatic build and publish
on:
push:
branches:
- main
- dev_image

env:
REGISTRY: ghcr.io
Expand Down
113 changes: 113 additions & 0 deletions vre-singleuser-dev/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
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
# Branch gguerrie-API-refactoring from Soap2G - v1.3.0
# COPY rucio_jupyterlab-1.3.0-py3-none-any.whl .
# RUN pip install rucio_jupyterlab-1.3.0-py3-none-any.whl

# v1.3.2
COPY rucio_jupyterlab-1.3.2-py3-none-any.whl .
RUN pip install rucio_jupyterlab-1.3.2-py3-none-any.whl

#RUN jupyter server extension enable --py rucio_jupyterlab --sys-prefix
# 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 apt update \
# && apt install -y software-properties-common \
# && add-apt-repository 'deb https://lcg-ca.web.cern.ch/lcg-ca/distribution/current focal main' \
# && apt update \
# && apt -y install ca-policy-lcg


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/
RUN chmod +x /usr/local/bin/configure-vre.py
COPY configure-vre.sh /usr/local/bin/before-notebook.d/

RUN mkdir -p /opt/rucio/etc \
&& chown -R $NB_UID /opt/rucio/etc

ENV JUPYTER_ENABLE_LAB=yes
ENV RUCIO_JUPYTERLAB_LOGLEVEL=DEBUG
ENV JUPYTERHUB_SINGLEUSER_APP=jupyter-server

WORKDIR $HOME
USER $NB_UID

CMD ["start-notebook.py"]
3 changes: 3 additions & 0 deletions vre-singleuser-dev/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# VRE singleuser Dev Image

For Dev purposes
118 changes: 118 additions & 0 deletions vre-singleuser-dev/configure-vre.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
#!/usr/bin/env python
# Derived from https://gitlab.cern.ch/escape-wp2/docker-images/-/blob/master/datalake-singleuser/bin/configure.py (restricted access).

import os
import json

HOME = '/home/jovyan'

def write_jupyterlab_config():
file_path = HOME + '/.jupyter/jupyter_server_config.json'
if not os.path.isfile(file_path):
os.makedirs(HOME + '/.jupyter/', exist_ok=True)
else:
config_file = open(file_path, 'r')
config_payload = config_file.read()
config_file.close()

try:
config_json = json.loads(config_payload)
except:
config_json = {}


# Looking to the rucio-jupyterlab configuration; https://github.com/rucio/jupyterlab-extension/blob/master/rucio_jupyterlab/config/schema.py#L101
# either ("destination_rse", "rse_mount_path") either ("rucio_ca_cert") are required env vars, even if they are defined in the jhub manifest.
# Adding 'rucio_base_url' too - from debugging experience

escape_config = {
"name": os.getenv('RUCIO_NAME', 'default'),
"display_name": os.getenv('RUCIO_DISPLAY_NAME', 'Default Instance'),
"rucio_base_url": os.getenv('RUCIO_BASE_URL', 'DEFAULT rucio base url'),
"rucio_auth_url": os.getenv('RUCIO_AUTH_URL'),
"rucio_webui_url": os.getenv('RUCIO_WEBUI_URL'),
"rucio_ca_cert": os.getenv('RUCIO_CA_CERT'),
"site_name": os.getenv('RUCIO_SITE_NAME'),
"vo": os.getenv('RUCIO_VO'),
"voms_enabled": os.getenv('RUCIO_VOMS_ENABLED', '0') == '1',
"voms_vomses_path": os.getenv('RUCIO_VOMS_VOMSES_PATH'),
"voms_certdir_path": os.getenv('RUCIO_VOMS_CERTDIR_PATH'),
"voms_vomsdir_path": os.getenv('RUCIO_VOMS_VOMSDIR_PATH'),
"destination_rse": os.getenv('RUCIO_DESTINATION_RSE', 'DEFAULT rse destination'),
"rse_mount_path": os.getenv('RUCIO_RSE_MOUNT_PATH', 'DEFAULT rse mount path'),
"replication_rule_lifetime_days": int(os.getenv('RUCIO_REPLICATION_RULE_LIFETIME_DAYS')) if os.getenv('RUCIO_REPLICATION_RULE_LIFETIME_DAYS') else None,
"path_begins_at": int(os.getenv('RUCIO_PATH_BEGINS_AT', '0')),
"mode": os.getenv('RUCIO_MODE', 'replica'),
"wildcard_enabled": os.getenv('RUCIO_WILDCARD_ENABLED', '0') == '1',
"oidc_auth": os.getenv('RUCIO_OIDC_AUTH'),
"oidc_env_name": os.getenv('RUCIO_OIDC_ENV_NAME'),
"oidc_file_name": os.getenv('RUCIO_OIDC_FILE_NAME'),
}

atlas_config = {
"name": "https://voatlasrucio-server-prod.cern.ch",
"display_name": "ATLAS RUCIO",
"rucio_base_url": "https://voatlasrucio-server-prod.cern.ch:443",
"rucio_auth_url": "https://atlas-rucio-auth.cern.ch:443",
"rucio_ca_cert": "/certs/rucio_ca.pem",
"site_name": "CERN",
"vo": "atlas",
"voms_enabled": os.getenv('RUCIO_VOMS_ENABLED', '0') == '1',
"destination_rse": "CERN-PROD_PHYS-TOP",
"rse_mount_path": "/eos/atlas/atlasscratchdisk/rucio",
"path_begins_at": 4,
"mode": "replica",
"wildcard_enabled": os.getenv('RUCIO_WILDCARD_ENABLED', '0') == '0'
}

escape_config = {k: v for k,
v in escape_config.items() if v is not None}

atlas_config = {k: v for k,
v in atlas_config.items() if v is not None}


config_json['RucioConfig'] = {
'instances': [escape_config, atlas_config],
"default_instance": os.getenv('RUCIO_DEFAULT_INSTANCE', escape_config['name']),
"default_auth_type": os.getenv('RUCIO_DEFAULT_AUTH_TYPE', 'oidc'),
}

config_file = open(file_path, 'w')
config_file.write(json.dumps(config_json, indent=2))
config_file.close()

def write_ipython_config():
file_path = HOME + '/.ipython/profile_default/ipython_kernel_config.json'
extension_module = 'rucio_jupyterlab.kernels.ipython'

if not os.path.isfile(file_path):
os.makedirs(HOME + '/.ipython/profile_default/', exist_ok=True)
else:
config_file = open(file_path, 'r')
config_payload = config_file.read()
config_file.close()

try:
config_json = json.loads(config_payload)
except:
config_json = {}

if 'IPKernelApp' not in config_json:
config_json['IPKernelApp'] = {}

ipkernel_app = config_json['IPKernelApp']

if 'extensions' not in ipkernel_app:
ipkernel_app['extensions'] = []

if extension_module not in ipkernel_app['extensions']:
ipkernel_app['extensions'].append(extension_module)

config_file = open(file_path, 'w')
config_file.write(json.dumps(config_json, indent=2))
config_file.close()

if __name__ == '__main__':
write_jupyterlab_config()
write_ipython_config()
3 changes: 3 additions & 0 deletions vre-singleuser-dev/configure-vre.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/bash
set -e
python /usr/local/bin/configure-vre.py
Binary file not shown.
Binary file not shown.
2 changes: 2 additions & 0 deletions vre-singleuser-dev/voms-atlas-auth.app.cern.ch.lsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/DC=ch/DC=cern/OU=computers/CN=atlas-auth.web.cern.ch
/DC=ch/DC=cern/CN=CERN Grid Certification Authority
2 changes: 2 additions & 0 deletions vre-singleuser-dev/voms-atlas-auth.cern.ch.lsc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
/DC=ch/DC=cern/OU=computers/CN=atlas-auth.cern.ch
/DC=ch/DC=cern/CN=CERN Grid Certification Authority
Loading