Skip to content

Commit fada4c6

Browse files
install latests versions of swan-cern and extension
1 parent 354162c commit fada4c6

File tree

2 files changed

+28
-18
lines changed

2 files changed

+28
-18
lines changed

vre-singleuser-swan-cern/Dockerfile

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ARG VERSION_PARENT=v0.0.27
1+
ARG VERSION_PARENT=v0.0.34
22

33
FROM gitlab-registry.cern.ch/swan/docker-images/jupyter/swan-cern:${VERSION_PARENT}
44
LABEL author="E. Garcia - 2024"
@@ -14,16 +14,12 @@ RUN curl -Lo /etc/yum.repos.d/lcg-trustanchors.repo https://lcg-ca.web.cern.ch/d
1414

1515
USER ${NB_UID}
1616

17-
RUN python -m pip install rucio-clients
18-
RUN python -m pip install --upgrade typing_extensions
17+
#RUN python -m pip install rucio-clients
18+
#RUN python -m pip install --upgrade typing_extensions
1919

20-
#RUN python -m pip install rucio-jupyterlab==1.0.0 \
20+
#RUN python -m pip install rucio-jupyterlab==1.2.0 \
2121
RUN git clone https://github.com/rucio/jupyterlab-extension.git \
22-
&& cd jupyterlab-extension \
23-
&& python -m pip install . \
24-
&& jupyter serverextension enable --py rucio_jupyterlab --sys-prefix \
25-
&& cd .. \
26-
&& rm -rf jupyterlab-extension
22+
&& jupyter serverextension enable --py rucio_jupyterlab --sys-prefix
2723

2824
# Add pre-hooks to be run before the jupyter server starts
2925
COPY scripts/before-notebook.d/* /usr/local/bin/before-notebook.d/

vre-singleuser-swan-cern/scripts/others/configure_rucio_jupyterlab.py

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,16 @@
55
import json
66

77
def write_jupyterlab_config():
8-
config_jupyterlab = os.environ['JUPYTER_CONFIG_DIR']
9-
file_path = config_jupyterlab + '/jupyter_server_config.json'
8+
dir_config_jupyterlab = os.getenv('JUPYTER_CONFIG_DIR',
9+
os.path.join(os.getenv('HOME'), '.jupyter')
10+
)
11+
file_server_config = os.path.join(dir_config_jupyterlab, 'jupyter_server_config.json')
1012

11-
if not os.path.isfile(file_path):
12-
os.makedirs( config_jupyterlab + '/.jupyter/', exist_ok=True)
13-
else:
14-
config_file = open(file_path, 'r')
15-
config_payload = config_file.read()
16-
config_file.close()
13+
if not os.path.exists(dir_config_jupyterlab):
14+
os.makedirs( dir_config_jupyterlab, exist_ok=True)
15+
elif os.path.isfile(file_server_config) :
16+
with open(file_server_config, "r") as config_file:
17+
config_payload = config_file.read()
1718

1819
try:
1920
config_json = json.loads(config_payload)
@@ -93,7 +94,7 @@ def write_jupyterlab_config():
9394
"default_auth_type": os.getenv('RUCIO_DEFAULT_AUTH_TYPE', 'x509_proxy'),
9495
}
9596

96-
config_file = open(file_path, 'w')
97+
config_file = open(file_server_config, 'w')
9798
config_file.write(json.dumps(config_json, indent=2))
9899
config_file.close()
99100

@@ -121,6 +122,19 @@ def write_jupyterlab_config():
121122
# rucio_config['client'] = client_config
122123
# with open('/opt/rucio/etc/rucio.cfg', 'w') as f:
123124
# rucio_config.write(f)
125+
126+
# [client]
127+
# rucio_host = https://vre-rucio.cern.ch
128+
# auth_host = https://vre-rucio-auth.cern.ch
129+
# ca_cert = /certs/rucio_ca.pem
130+
# account = garcia
131+
# auth_type = oidc
132+
# oidc_audience = rucio
133+
# oidc_polling = true
134+
# oidc_issuer = escape
135+
# oidc_scope = openid profile offline_access
136+
# auth_token_file_path = /tmp/rucio_oauth.token
137+
124138

125139
if __name__ == '__main__':
126140
write_jupyterlab_config()

0 commit comments

Comments
 (0)