-
Notifications
You must be signed in to change notification settings - Fork 2
/
Singularity.cpu
228 lines (195 loc) · 8.05 KB
/
Singularity.cpu
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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
BootStrap: library
From: ubuntu:20.04
%post
echo "Installing packages needed for multiple programs"
apt-get -y update
export DEBIAN_FRONTEND=noninteractive
export TZ=Etc/UTC
apt-get -y install build-essential cmake git htop software-properties-common wget # need these to build packages
apt-add-repository multiverse # add the multiverse repository (where pgplot5 lives)
apt-get -y install pgplot5
export PGPLOT_DIR=/usr/lib/pgplot5
# apt-get -y install python3 python-is-python3 python3-pip # use conda instead
apt-get -y install libfftw3-dev libfftw3-bin libcfitsio-dev # We need these packages for multiple programs
# use conda so everything is compatible with the cuda-10-2 container
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86_64.sh -O ~/miniconda.sh -q
bash ~/miniconda.sh -b -p /usr/local/miniconda
rm ~/miniconda.sh
eval "$(/usr/local/miniconda/bin/conda shell.bash hook)"
conda init
conda create -y --name RT python=3.8
conda activate RT
# As described in https://github.com/hpcng/singularity/issues/5075#issuecomment-594391772
echo "## Activate RT environment" >> /.singularity_bash
echo "source /usr/local/miniconda/etc/profile.d/conda.sh" >> /.singularity_bash
echo "conda activate RT" >> /.singularity_bash
pip install numpy # make sure pip numpy get installed to avoid presto python error
echo "Installing iqrm_apollo"
cd ~
apt-get -y install libboost-all-dev
git clone https://gitlab.com/kmrajwade/iqrm_apollo.git
cd iqrm_apollo
mkdir build; cd build
cmake -DBOOST_ROOT=/ ../
make -j
cp iqrm_apollo/iqrm_apollo_cli /usr/local/bin/
echo "iqrm_apollo Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
cd ~ && rm -rf iqrm_apollo
echo "Installing juyterlab"
# pip3 install jupyterlab
conda install -y -c conda-forge jupyterlab
echo "Jupiterlab Built from conda" >> "$SINGULARITY_LABELS"
echo "Installing Tempo"
cd /usr/local #put file here so we can access them later
apt-get -y install csh autoconf gfortran
git clone git://git.code.sf.net/p/tempo/tempo
cd tempo
./prepare
./configure
make
make install
export TEMPO=$PWD # Presto need to know this
echo "Tempo Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
echo "Installing PRESTO"
# mkdir /usr/local/
cd /usr/local/
apt-get -y install libglib2.0-dev libpng-dev libx11-dev mpich
git clone https://github.com/scottransom/presto.git
cd presto
export PRESTO=$PWD
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PRESTO/lib
cd $PRESTO/src # links libsla, thanks https://github.com/scottransom/presto/issues/1#issuecomment-60413231
make prep
make
make mpi
make clean
cd $PRESTO
# pip install numpy # installed at top
sed -i '' $PRESTO/python/presto/waterfaller.py # removes symbolic link (which upsets pip) https://stackoverflow.com/a/12673543
pip install .
cp $PRESTO/bin/* /usr/local/bin
echo "PRESTO at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
echo "Installing psrcat"
cd ~
apt-get -y install tcsh
wget https://www.atnf.csiro.au/people/pulsar/psrcat/downloads/psrcat_pkg.tar.gz
tar xf psrcat_pkg.tar.gz
cd psrcat_tar
tcsh makeit
mv psrcat /usr/local/bin
mv *.db /usr/local
echo "psrcat no version control" >> "$SINGULARITY_LABELS"
cd ~ && rm -rf psrcat_tar
echo "Installing pysigproc"
cd ~
git clone https://github.com/devanshkv/pysigproc.git
cd pysigproc
pip install .
echo "pysigproc Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
cd ~ && rm -rf pysigproc
echo "Installing RFIClean"
cd ~
# git clone https://github.com/josephwkania/RFIClean.git
git clone https://github.com/ymaan4/RFIClean.git
cd RFIClean
mkdir -p /home/maan/pulsar_softwares/bin
make
make install
mv /home/maan/pulsar_softwares/bin/* /usr/local/bin
rm -r /home/maan
echo "RFICLean Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
cd ~ && rm -rf RFIClean
echo "Installing riptide"
pip install riptide-ffa
echo "riptide-ffa installed from pip" >> "$SINGULARITY_LABELS"
echo "Installing sigproc"
cd ~
git clone https://github.com/SixByNine/sigproc.git
cd sigproc
./bootstrap
./configure --prefix=/usr/local/
make
make install
echo "sigproc Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
cd ~ && rm -rf sigproc
echo "Installing YAPP"
cd ~
apt-get -y install libhdf5-dev
mkdir -p /usr/local/hdf5
ln -s /usr/include/hdf5/serial /usr/local/hdf5/include
mkdir -p /usr/local/hdf5
ln -s /usr/lib/x86_64-linux-gnu/hdf5/serial/lib /usr/local/hdf5/lib
git clone https://github.com/jayanthc/yapp.git
cd yapp
make HDF5=yes
make install
echo "YAPP Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
cd ~ && rm -rf yapp
echo "Installing your"
cd ~
git clone https://github.com/thepetabyteproject/your.git
cd your
pip install .
echo "your Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)"
cd ~ && rm -rf your
echo "Installing jess"
cd ~
git clone https://github.com/josephwkania/jess.git
cd jess
pip install .
echo "jess Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
cd ~ && rm -rf jess
echo "Installing will"
cd ~
git clone https://github.com/josephwkania/will.git
cd will
pip install .
echo "will Built at commit $(git rev-parse HEAD) which was on $(git log -1 --format=%cd)" >> "$SINGULARITY_LABELS"
cd ~ && rm -rf will
# This wants to remove libboost, which we need
#apt-get -y purge cmake build-essential git wget # remove build time dependencies
#apt-get -y autoremove
apt-get -y clean # /var/cache/apt/archives is not emptied on its own,
conda clean --all
echo "Done building!"
%environment
# For conda
action="${0##*/}"
if [ "$action" = "shell" ]; then
if [ "${SINGULARITY_SHELL:-}" = "/bin/bash" ]; then
set -- --noprofile --init-file /.singularity_bash
elif test -z "${SINGULARITY_SHELL:-}"; then
export SINGULARITY_SHELL=/bin/bash
set -- --noprofile --init-file /.singularity_bash
fi
fi
source /usr/local/miniconda/bin/activate RT # sets up conda so we can access outside the continuer
export PGPLOT_DIR=/usr/lib/pgplot5
export TEMPO=/usr/local/tempo
export PRESTO=/usr/local/presto
export LD_LIBRARY_PATH=$PRESTO/lib:$LD_LIBRARY_PATH
export PSRCAT_FILE=/usr/local/psrcat.db
%runscript
exec /usr/local/miniconda/RT/bin/"$@"
exec /bin/bash --noprofile --init-file /.singularity_bash "$@"
%help
This container has CPU software to search for radio transients.
Contains the following programs:
htop https://htop.dev/
iqrm_apollo https://gitlab.com/kmrajwade/iqrm_apollo
jess https://github.com/josephwkania/jess
jupyterlab https://jupyter.org/
PRESTO https://www.cv.nrao.edu/~sransom/presto/
psrcat https://www.atnf.csiro.au/people/pulsar/psrcat/download.html
pysigproc https://github.com/devanshkv/pysigproc
riptide https://github.com/v-morello/riptide
sigproc https://github.com/SixByNine/sigproc
Tempo http://tempo.sourceforge.net/
RFIClean https://github.com/ymaan4/RFIClean
will https://github.com/josephwkania/will
YAPP https://github.com/jayanthc/yapp
your https://github.com/thepetabyteproject/your
%labels
Author Joseph W Kania
Version v0.1.0
Build-date 27-Nov-2021