forked from llr-cta/calin
-
Notifications
You must be signed in to change notification settings - Fork 0
/
singularity_build.def
143 lines (125 loc) · 6.8 KB
/
singularity_build.def
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
# calin/singularity_build.def -- Stephen Fegan -- 2021-08-23
#
# Build a singularity container for calin using Github Actions
#
# Copyright 2021, Stephen Fegan <[email protected]>
# Laboratoire Leprince-Ringuet, CNRS/IN2P3, Ecole Polytechnique, Institut Polytechnique de Paris
#
# This file is part of "calin"
#
# "calin" is free software: you can redistribute it and/or modify it under the
# terms of the GNU General Public License version 2 or later, as published by
# the Free Software Foundation.
#
# "calin" is distributed in the hope that it will be useful, but WITHOUT ANY
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
Bootstrap: docker
From: ubuntu:22.04
%files
/tmp/calin_installed.tgz
%environment
export GEANT4_DATA_DIR="/usr/share/Geant4/data"
export G4NEUTRONHPDATA="$GEANT4_DATA_DIR/G4NDL4.7.1"
export G4LEDATA="$GEANT4_DATA_DIR/G4EMLOW8.5"
export G4LEVELGAMMADATA="$GEANT4_DATA_DIR/PhotonEvaporation5.7"
export G4RADIOACTIVEDATA="$GEANT4_DATA_DIR/RadioactiveDecay5.6"
export G4PARTICLEXSDATA="$GEANT4_DATA_DIR/G4PARTICLEXS4.0"
export G4PIIDATA="$GEANT4_DATA_DIR/G4PII1.3"
export G4REALSURFACEDATA="$GEANT4_DATA_DIR/RealSurface2.2"
export G4SAIDXSDATA="$GEANT4_DATA_DIR/G4SAIDDATA2.0"
export G4ABLADATA="$GEANT4_DATA_DIR/G4ABLA3.3"
export G4INCLDATA="$GEANT4_DATA_DIR/G4INCL1.2"
export G4ENSDFSTATEDATA="$GEANT4_DATA_DIR/G4ENSDFSTATE2.3"
export OMP_NUM_THREADS=1
export SHELL=/bin/bash
%post
export DEBIAN_FRONTEND=noninteractive
echo "deb http://us.archive.ubuntu.com/ubuntu jammy main universe" > /etc/apt/sources.list
echo "deb http://us.archive.ubuntu.com/ubuntu/ jammy-security main universe" >> /etc/apt/sources.list
apt-get -y update
apt-get -y upgrade
apt-get -y install \
less \
wget \
libgsl27 \
libzmq5 \
libpcre3 \
libpcap0.8 \
zlib1g \
python3 \
python3-pip \
python3-numpy \
python3-scipy \
python3-matplotlib \
cython3 \
fftw3 \
sqlite3 \
libxerces-c3.2 \
vim \
curl \
ffmpeg \
libgeos3.10.2 \
libgeos-c1v5 \
hdf5-tools \
libjpeg8 \
libnetcdf19 \
netcdf-bin \
netcdf-doc \
proj-bin \
libproj22 \
libopenjp2-7 \
libopenjp2-tools \
libzstd-dev \
libprotobuf-c1 \
libprotobuf23 \
libprotoc23 \
valgrind \
gdb
apt-get -y autoremove
apt-get -y clean
pip3 install notebook cdsapi ecmwf-api-client astropy gammapy
pip3 install --upgrade google-api-python-client google-auth-httplib2 google-auth-oauthlib
export G4DATADIR=/usr/share/Geant4/data
# export G4URL=http://geant4-data.web.cern.ch/datasets
export G4URL=https://cern.ch/geant4-data/datasets
mkdir -p $G4DATADIR
curl -L $G4URL/G4NDL.4.7.1.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4EMLOW.8.5.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4PhotonEvaporation.5.7.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4RadioactiveDecay.5.6.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4SAIDDATA.2.0.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4PARTICLEXS.4.0.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4ABLA.3.3.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4INCL.1.2.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4PII.1.3.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4ENSDFSTATE.2.3.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4RealSurface.2.2.tar.gz | tar -C $G4DATADIR -zxf -
curl -L $G4URL/G4TENDL.1.4.tar.gz | tar -C $G4DATADIR -zxf -
export CTA_ADH_APIS_REL=ubuntu-22.04
export GEANT4_REL=ubuntu-22.04-11.2.2-OFF
curl -L https://github.com/llr-cta/CTA_ADH_APIS_Build/releases/download/$CTA_ADH_APIS_REL/cta_adh_apis_installed.tgz | tar -zxf - -C /
curl -L https://github.com/llr-cta/Geant4Build/releases/download/$GEANT4_REL/Geant4-$GEANT4_REL.tbz2 | tar -jxf - -C /
tar -zxf /tmp/calin_installed.tgz -C /
rm -f /tmp/calin_installed.tgz
jupyter notebook --allow-root --generate-config
sed -i -e '/c.NotebookApp.ip/s/^#//' \
-e '/c.NotebookApp.ip/s/localhost/*/' \
-e '/c.NotebookApp.allow_origin =/s/^#//' \
-e "/c.NotebookApp.allow_origin =/s/''/'*'/" \
-e '/c.NotebookApp.open_browser/s/^#//' \
-e '/c.NotebookApp.open_browser/s/True/False/' \
-e '/c.NotebookApp.allow_root/s/^#//' \
-e '/c.NotebookApp.allow_root/s/False/True/' \
/root/.jupyter/jupyter_notebook_config.py
mkdir /data
ldconfig
NOW=`date`
echo "export NOW=\"${NOW}\"" >> $SINGULARITY_ENVIRONMENT
%labels
Author [email protected]
Version v0.0.1
%help
This is a container containing calin and all of its dependencies
%runscript
exec /usr/bin/jupyter-notebook "$@"