forked from openhpc/ohpc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Singularity.1.3.3.el7
121 lines (90 loc) · 2.61 KB
/
Singularity.1.3.3.el7
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
bootstrap:docker
From:centos:7
%post
yum -y upgrade
# OpenHPC repo
yum -y install https://github.com/openhpc/ohpc/releases/download/v1.3.GA/ohpc-release-1.3-1.el7.x86_64.rpm
yum -y install perl
yum -y install \
ohpc-base \
ohpc-base-compute \
ohpc-autotools \
ohpc-gnu7-io-libs \
ohpc-gnu7-mpich-parallel-libs \
ohpc-gnu7-mvapich2-parallel-libs \
ohpc-gnu7-openmpi3-parallel-libs \
ohpc-gnu7-perf-tools \
ohpc-gnu7-python-libs \
ohpc-gnu7-serial-libs \
openssh-clients
yum -y install lmod-defaults-gnu7-openmpi3-ohpc
cat << EOF > /etc/profile.d/lmod.sh
#!/bin/sh
# -*- shell-script -*-
########################################################################
# This is the system wide source file for setting up
# modules:
#
########################################################################
# NOOP if running under known resource manager
if [[ ! -z "$SLURM_NODELIST" && -z "$SINGULARITY_CONTAINER" ]];then
return
fi
if [[ ! -z "$PBS_NODEFILE" && -z "$SINGULARITY_CONTAINER" ]];then
return
fi
export LMOD_SETTARG_CMD=":"
export LMOD_FULL_SETTARG_SUPPORT=no
export LMOD_COLORIZE=no
export LMOD_PREPEND_BLOCK=normal
if [ $EUID -eq 0 ]; then
export MODULEPATH=/opt/ohpc/admin/modulefiles:/opt/ohpc/pub/modulefiles
else
export MODULEPATH=/opt/ohpc/pub/modulefiles
fi
export BASH_ENV=/opt/ohpc/admin/lmod/lmod/init/bash
# Initialize modules system
. /opt/ohpc/admin/lmod/lmod/init/bash >/dev/null
if [[ -n "$SINGULARITY_CONTAINER" ]];then
module purge
clearMT
fi
# Load baseline OpenHPC environment
module try-add ohpc
EOF
cat << EOF > /etc/profile.d/lmod.csh
#!/bin/csh
# -*- shell-script -*-
########################################################################
# This is the system wide source file for setting up
# modules:
#
########################################################################
if ( $?SLURM_NODELIST && ! $?SINGULARITY_CONTAINER ) then
exit 0
endif
if ( $?PBS_NODEFILE && ! $?SINGULARITY_CONTAINER ) then
exit 0
endif
setenv LMOD_SETTARG_CMD ":"
setenv LMOD_FULL_SETTARG_SUPPORT "no"
setenv LMOD_COLORIZE "no"
setenv LMOD_PREPEND_BLOCK "normal"
if ( `id -u` == "0" ) then
setenv MODULEPATH "/opt/ohpc/admin/modulefiles:/opt/ohpc/pub/modulefiles"
else
setenv MODULEPATH "/opt/ohpc/pub/modulefiles"
endif
# Initialize modules system
source /opt/ohpc/admin/lmod/lmod/init/csh >/dev/null
if ( $?SINGULARITY_CONTAINER ) then
module purge
clearMT
endif
# Load baseline OpenHPC environment
module try-add ohpc
EOF
# verification
ls -l /opt/ohpc/pub
# build info
echo "Timestamp:" `date --utc` | tee /image-build-info.txt