-
Notifications
You must be signed in to change notification settings - Fork 14
Expand file tree
/
Copy pathJupyterKernel-R-4.4.2-GCCcore-13.3.0-4.2.1.eb
More file actions
97 lines (83 loc) · 3.07 KB
/
Copy pathJupyterKernel-R-4.4.2-GCCcore-13.3.0-4.2.1.eb
File metadata and controls
97 lines (83 loc) · 3.07 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
# This file is part of JSC's public easybuild repository (https://github.com/easybuilders/jsc)
easyblock = 'Bundle'
name = 'JupyterKernel-R'
version = '4.4.2'
local_jupyterver = '4.3.4'
versionsuffix = '-' + local_jupyterver
homepage = 'https://github.com/IRkernel/IRkernel'
description = """
Native R 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'),
('R', version, '', ('gcccoreflexiblas', '13.3.0-3.4.4')),
('IRkernel', '1.3.2', '-R-%(version)s'),
]
dependencies = [
('Python', '3.12.3'),
('JupyterLab', local_jupyterver),
]
local_kernel_dir = 'ir40'
local_kernel_name = 'R-%s' % version
modextrapaths = {
'JUPYTER_PATH': ['share/jupyter'], # add search path for kernelspecs
}
# Ensure that the user-specific $HOME/.local/share/jupyter is 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
(
'module purge && '
'module load Stages/${STAGE} && '
'module load GCCcore/.13.3.0 && '
'module load JupyterLab/%s && '
'module load R/%s && '
'module load IRkernel/1.3.2-R-%s && '
'R -e \'IRkernel::installspec(name="%s", displayname="%s", prefix="%%(installdir)s")\' '
) % (local_jupyterver, version, version,
local_kernel_dir, local_kernel_name),
# force options(bitmapType='cairo') -> https://github.com/IRkernel/IRkernel/issues/388
(
'sed -i "s#IRkernel::main()#options(bitmapType=\'cairo\') ; IRkernel::main()#g" '
' %%(installdir)s/share/jupyter/kernels/%s/kernel.json'
) % (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 GCCcore/.13.3.0 \n'
'module load R/%s \n'
'module load IRkernel/1.3.2-R-%s \n'
'\n'
'exec \${EBROOTR}/lib64/R/bin/R "\$@"\n'
'\n'
'EOF'
) % (local_kernel_dir, version, version),
'chmod +x %%(installdir)s/share/jupyter/kernels/%s/kernel.sh' % local_kernel_dir,
# replace `"${EBROOTR}/lib64/R/bin/R"` with `"[..]/kernel.sh"`
(
'sed -i \'s#\'"${EBROOTR}"\'/lib64/R/bin/R#%%(installdir)s/share/jupyter/kernels/%s/kernel.sh#\' '
' %%(installdir)s/share/jupyter/kernels/%s/kernel.json'
) % (local_kernel_dir, local_kernel_dir),
]
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'