-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathJupyterKernel-PyEarthSystem-2025.1-GCCcore-13.3.0-4.3.4.eb
More file actions
171 lines (155 loc) · 5.81 KB
/
Copy pathJupyterKernel-PyEarthSystem-2025.1-GCCcore-13.3.0-4.3.4.eb
File metadata and controls
171 lines (155 loc) · 5.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
# This file is part of JSC's public easybuild repository (https://github.com/easybuilders/jsc)
easyblock = 'PythonBundle'
name = 'JupyterKernel-PyEarthSystem'
version = '2025.1'
local_jupyterver = '4.3.4'
versionsuffix = '-' + local_jupyterver
homepage = 'https://www.fz-juelich.de'
description = """
Special Earth System Modeling kernel for Jupyter.
Project Jupyter exists to develop open-source software, open-standards, and services
for interactive computing across dozens of programming languages.
"""
toolchain = {'name': 'GCCcore', 'version': '13.3.0'}
toolchainopts = {'pic': True}
builddependencies = [
('binutils', '2.42'),
# just ensure they exist (if they can be loaded here)
('netcdf4-python', '1.7.1.post2', '-serial', ('gcccoreflexiblas', '13.3.0-3.4.4')),
('SciPy-bundle', '2024.05', '', ('gcccoreflexiblas', '13.3.0-3.4.4')),
('xarray', '2024.11.0', '', ('gcccoreflexiblas', '13.3.0-3.4.4')),
('dask', '2024.9.1', '-serial', ('gcccoreflexiblas', '13.3.0-3.4.4')),
('Cartopy', '0.24.1'),
('Ninja', '1.12.1'),
('git', '2.45.1'),
('GSL', '2.8'),
('gnuplot', '6.0.1'),
('ncview', '2.1.11'),
('ImageMagick', '7.1.1-38'),
('GDAL', '3.10.0'),
('numba', '0.60.0'),
('plotly.py', '5.24.1'),
# ('OpenMPI', '5.0.5'),
# ('NCO', '5.3.0'),
# ('CDO', '2.4.4'),
# ('mpi4py', '4.0.1'),
# ('PyTorch', '2.5.1', '', ('gcccoreflexiblas', '13.3.0-3.4.4')),
]
dependencies = [
('Python', '3.12.3'),
('JupyterLab', local_jupyterver),
]
components = [
('logos', '1.0', {
'easyblock': 'Binary',
'sources': [
{'filename': 'logo-32x32.png', 'extract_cmd': "cp %s %%(builddir)s/"},
{'filename': 'logo-64x64.png', 'extract_cmd': "cp %s %%(builddir)s/"},
{'filename': 'logo-128x128.png', 'extract_cmd': "cp %s %%(builddir)s/"},
],
'checksums': [
{'logo-32x32.png': '9be08e0d60c570111fc4cee9f93ee2dbda162fbeabe86dadd454f2691e740d2f'},
{'logo-64x64.png': 'fda5018fe188829e019e75935e1f1dc34677f5e19bd84d9403a675c460f8030d'},
{'logo-128x128.png': '32c80f50184d757afbac72ea72f5120659bc9245bfecaf7762b0dda1f5ecd6eb'},
]
}),
]
exts_default_options = {
'source_urls': [PYPI_SOURCE],
'use_pip': True,
'sanity_pip_check': True,
'download_dep_fail': True,
'use_pip_for_deps': False,
}
exts_list = [
]
local_kernel_dir = 'pyearthsystem'
local_kernel_name = 'PyEarthSystem-%s' % version
modextrapaths = {
'JUPYTER_PATH': ['share/jupyter'], # add search path for kernelspecs
'HOROVOD_MPI_THREADS_DISABLE': ['1'], # no mpi by default
}
# Ensure that the user-specific $HOME/.local/share/jupyter is always first entry in JUPYTHER_PATH
modluafooter = """
remove_path("JUPYTER_PATH", pathJoin(os.getenv("HOME"), ".local/share/jupyter"))
prepend_path("JUPYTER_PATH", pathJoin(os.getenv("HOME"), ".local/share/jupyter"))
"""
postinstallcmds = [
# create kernel skeleton
(
'python -m ipykernel install --name=%s --prefix=%%(installdir)s && '
'rm -f %%(installdir)s/share/jupyter/kernels/%s/logo-svg.svg && '
'mv %%(installdir)s/logo-32x32.png %%(installdir)s/share/jupyter/kernels/%s/logo-32x32.png && '
'mv %%(installdir)s/logo-64x64.png %%(installdir)s/share/jupyter/kernels/%s/logo-64x64.png && '
'mv %%(installdir)s/logo-128x128.png %%(installdir)s/share/jupyter/kernels/%s/logo-128x128.png'
) % (local_kernel_dir, local_kernel_dir, local_kernel_dir, local_kernel_dir, local_kernel_dir),
# write kernel.sh
(
'{ cat > %%(installdir)s/share/jupyter/kernels/%s/kernel.sh; } << EOF\n'
'#!/bin/bash \n'
'\n'
'# Load required modules \n'
'module purge \n'
'module load Stages/${STAGE} \n'
'module load GCC/13.3.0 \n'
'module load OpenMPI \n'
'module load %s/.%s%s \n'
'\n'
'module load netcdf4-python/1.7.1.post2-serial \n'
'module load SciPy-bundle/2024.05 \n'
'module load xarray/2024.11.0 \n'
'module load dask/2024.9.1 \n'
'module load Cartopy/0.24.1 \n'
'module load Ninja/1.12.1 \n'
'module load git/2.45.1 \n'
'module load GSL/2.8 \n'
'module load gnuplot/6.0.1 \n'
'module load ncview/2.1.11 \n'
'module load ImageMagick/7.1.1-38 \n'
'module load GDAL/3.10.0 \n'
'module load numba/0.60.0 \n'
'module load plotly.py/5.24.1 \n'
'\n'
'module load HDF5/1.14.5 \n'
'module load NCO/5.3.0 \n'
'module load CDO/2.4.4 \n'
'module load mpi4py/4.0.1 \n'
'module load PyTorch/2.5.1 \n'
'\n'
'export PYTHONPATH=%%(installdir)s/lib/python%%(pyshortver)s/site-packages:\$PYTHONPATH \n'
'exec python -m ipykernel \$@\n'
'\n'
'EOF'
) % (local_kernel_dir, name, version, versionsuffix),
'chmod +x %%(installdir)s/share/jupyter/kernels/%s/kernel.sh' % local_kernel_dir,
# write kernel.json
(
'{ cat > %%(installdir)s/share/jupyter/kernels/%s/kernel.json; } << \'EOF\'\n'
'{ \n'
' "argv": [ \n'
' "%%(installdir)s/share/jupyter/kernels/%s/kernel.sh", \n'
' "-m", \n'
' "ipykernel_launcher", \n'
' "-f", \n'
' "{connection_file}" \n'
' ], \n'
' "display_name": "%s", \n'
' "language": "python", \n'
' "name": "%s", \n'
' "metadata": { \n'
' "debugger": true \n'
' } \n'
'}\n'
'EOF'
) % (local_kernel_dir, local_kernel_dir, local_kernel_name, local_kernel_name),
]
sanity_check_paths = {
'files': [
'share/jupyter/kernels/%s/kernel.sh' % local_kernel_dir,
'share/jupyter/kernels/%s/kernel.json' % local_kernel_dir,
],
'dirs': [
'share/jupyter/kernels/',
],
}
moduleclass = 'tools'