-
Notifications
You must be signed in to change notification settings - Fork 0
/
buster-9.4.0.def
190 lines (154 loc) · 5.81 KB
/
buster-9.4.0.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
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
Bootstrap: docker
From: debian:buster
%help
USAGE: salome [-h]
NOTES:
1) This image is read-only!
EXAMPLES:
List availailable apps
$ singularity apps <image-name>
Run salome in TUI mode:
$ singularity run <image-name> -t scrypt.py args:....
Run salome in GUI mode:
$ singularity run --nv --app salome <image-name>
# Run salome in GUI mode on NoVNC/Virtual :
# $ singularity run --nv --app vgl_salome <image-name> ...
Run salome in TUI mode for Hifimagnet :
$ singularity run --app hifimagnet-tui <image-name> ...
Run salome in GUI mode for Hifimagnet :
$ singularity run --nv --app hifimagnet_gui <image-name> ...
To add support for MeshGems:
$ singularity run --nv -B ${MESHGEMS_LICDIR}:/opt/DISTENE/DLim [--app <app>] <image-app>
where MESHGEMS_LICDIR points to the directory holding a valid MeshGems license
%runscript
exec salome "$@"
%setup
echo "Looking in directory '$SINGULARITY_ROOTFS' for /bin/sh"
if [ ! -x "$SINGULARITY_ROOTFS/bin/sh" ]; then
echo "Hrmm, this container does not have /bin/sh installed..."
exit 1
fi
# prepare for MeshGems
mkdir -p $SINGULARITY_ROOTFS/opt/DISTENE/DLim
mkdir -p $SINGULARITY_ROOTFS/tmp
cp /home/LNCMI-G/trophime/Salome_Packages/SALOME-9.4.0-DB10.tgz $SINGULARITY_ROOTFS/tmp/
cp /home/LNCMI-G/trophime/Salome_Packages/install-SALOME-9.4.0-DB10.sh $SINGULARITY_ROOTFS/tmp/
# cp /home/LNCMI-G/trophime/Salome_Packages/SALOME-9.4.0-DBtesting-SRC.tgz $SINGULARITY_ROOTFS/tmp/SALOME-9.4.0-MPI-DBtesting.tgz
# cp /home/LNCMI-G/trophime/Salome_Packages/install-SALOME-9.4.0-MPI-DBtesting.sh $SINGULARITY_ROOTFS/tmp/
mkdir -p $SINGULARITY_ROOTFS/usr/local/share/salome/test
for script in $(ls /home/LNCMI-G/trophime/Salome_Tests/scripts/*py); do
cp $script $SINGULARITY_ROOTFS/usr/local/share/salome/test
done
mkdir -p $SINGULARITY_ROOTFS/usr/local/share/salome/H1H4
for cfg in $(ls /home/LNCMI-G/trophime/Salome_Tests/H1H4/*yaml); do
cp $cfg $SINGULARITY_ROOTFS/usr/local/share/salome/H1H4
done
for dat in $(ls /home/LNCMI-G/trophime/Salome_Tests/H1H4/*dat); do
cp $dat $SINGULARITY_ROOTFS/usr/local/share/salome/H1H4
done
exit 0
%environment
export PATH=/opt/SALOME-9.4.0-DB10:$PATH
export DISTENE_LICENSE_FILE=/opt/DISTENE/DLim/dlim8.key
export FEELPP_REPOSITORY=/feel
export HIFIMAGNET=/opt/SALOME-9.4.0-DB10/BINARIES-DB10/HIFIMAGNET/bin/salome/
# Defining alias for security
alias ls='ls --color=auto'
alias ll='ls -ls'
alias cp='cp -i'
alias mv='mv -i'
alias rm='rm -i'
alias grep='grep --color'
# # Add support for openmp
# export OMP_NUM_THREADS=1
# export OPENBLAS_NUM_THREADS=1
export LANG=C
%labels
AUTHOR [email protected]
Maintainer: Christophe Trophime
Maintainer_email: [email protected]
Version 1.0
%post
mkdir -p /feel
mkdir -p /scratch /tmp
# Installing Salome
cd /tmp && sh ./install-SALOME-9.4.0-DB10.sh
rm /tmp/install-SALOME-9.4.0-DB10.sh
rm /tmp/SALOME-9.4.0-DB10.tgz
find /opt/SALOME-9.4.0-DB10 -name \*.py[co] | xargs -r rm
# Patch installation
find /opt/SALOME-9.4.0-DB10 -name \*.cmake | xargs perl -pi -e "s|/home/feelpp/salome/|/opt/SALOME-9.4.0-DB10/|g"
find /opt/SALOME-9.4.0-DB10 -name \*.cmake | xargs perl -pi -e "s|/INSTALL/|/BINARIES-DB10/|g"
find /opt/SALOME-9.4.0-DB10 -name \*.py | xargs perl -pi -e "s|/home/feelpp/salome/SALOME-9.4.0-DB10/SOURCES|/opt/SALOME-9.4.0-DB10/SOURCES|g"
perl -pi -e "s|\[ParaView\]|\[ParaView\]\\n context.addToLdLibraryPath(r\"/usr/lib/paraview\")|" /opt/SALOME-9.4.0-DB10/salome
perl -pi -e "s|\[qt\]|\[qt\]\\n context.setVariable(r\"QT5_ROOT_DIR\", r\"/usr/lib/x86_64-linux-gnu/qt5\", overwrite=True)|" /opt/SALOME-9.4.0-DB10/salome
# To get HifiMagnet Salome plugin working
apt -y install net-tools
apt -y install python3-pint python3-freesteam python3-yaml yamllint
apt -y install libpastix-dev
apt -y install libann0 libmetis5
apt -y install libcgns-dev
# to get salome test working
apt-get -y install cmake
# ## Installing VirtualGl for noVNC
# wget https://sourceforge.net/projects/virtualgl/files/2.6.3/virtualgl_2.6.3_amd64.deb/download -O /tmp/virtualgl_2.6.3_amd64.deb
# apt -y install mesa-utils mesa-utils-extra x11-apps libxv1
# dpkg -i /tmp/virtualgl_2.6.3_amd64.deb
# rm -f /tmp/virtualgl_2.6.3_amd64.deb
# To use on Cluster with InfinyBand and Slurm
apt -y install dapl2-utils \
libdapl2 \
libibverbs1 \
librdmacm1 \
libcxgb3-1 \
libipathverbs1 \
libmlx4-1 \
libmlx5-1 \
libmthca1 \
libnes1 \
libpmi0 \
libslurm33
# Cleanup
apt -y clean
apt -y autoclean
# # Try to cleanup more
# for package in $(dpkg -l | egrep ".*\-dev\b" | awk '{print $2}'); do \
# echo "Remove $package"; \
# apt -y remove $package; \
# done
# create custom motd
# Install figlet!
apt -y install figlet
cat > /.singularity.d/env/99-motd.sh <<EOF
case \$0 in
/.singularity.d/actions/shell)
figlet Salome 9.4.0
echo
echo "Hello \$USER from shell" ;;
/.singularity.d/actions/exec)
echo "Hello \$USER from exec" ;;
/.singularity.d/actions/run)
echo "Hello \$USER from run" ;;
/.singularity.d/actions/test)
echo "Hello \$USER from test" ;;
esac
EOF
%test
for script in $(ls /usr/local/share/salome/test/*py); do
echo -n "Running $script"
export LD_LIBRARY_PATH=/usr/lib/paraview:$LD_LIBRARY_PATH
export PATH=/opt/SALOME-9.4.0-DB10:$PATH
salome -t $script > /dev/null 2>&1
status=$?
if [ "x$status" = "0" ]; then
echo -en "[\033[32m OK \033[39m]"
else
echo -en "[\033[32m OK \033[39m]"
fi
echo
done
%apprun salome
echo "Need to pass --nv options to singularity"
salome "$@"
# %apprun vgl_salome
# vglrun salome "$@"