-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathslurm.recipe
More file actions
119 lines (99 loc) · 3.87 KB
/
slurm.recipe
File metadata and controls
119 lines (99 loc) · 3.87 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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
BootStrap: docker
From: centos:7.3.1611
%labels
author "simotrone@gmail.com"
version "0.12"
%post
yum -y install crontabs wget
yum -y install deltarpm perl net-tools libaio perl-Getopt-Long numactl-libs
# yum -y update
localedef -i en_US -f UTF-8 en_US.UTF-8
export MUNGEUSER=991
groupadd -g $MUNGEUSER munge
useradd -m -c "MUNGE Uid 'N' Gid Emporium" -d /var/lib/munge -u $MUNGEUSER -g munge -s /sbin/nologin munge
export SLURMUSER=992
groupadd -g $SLURMUSER slurm
useradd -m -c "SLURM workload manager" -d /var/lib/slurm -u $SLURMUSER -g slurm -s /bin/bash slurm
yum -y install epel-release
yum -y install munge munge-libs munge-devel
yum -y install rng-tools
rngd -r /dev/urandom
/usr/sbin/create-munge-key -r
dd if=/dev/urandom bs=1 count=1024 > /etc/munge/munge.key
chown -R munge: /etc/munge/ /var/log/munge/
chmod 0400 /etc/munge/munge.key
chmod 0700 /etc/munge/ /var/log/munge/
# install software distros
SRC_DIR="/usr/local/src"
# mysqld
cd $SRC_DIR
MYSQL_RPMS="mysql-community-server-5.7.24-1.el7.x86_64.rpm
mysql-community-client-5.7.24-1.el7.x86_64.rpm
mysql-community-common-5.7.24-1.el7.x86_64.rpm
mysql-community-libs-5.7.24-1.el7.x86_64.rpm
mysql-community-devel-5.7.24-1.el7.x86_64.rpm"
for rpm_file in $MYSQL_RPMS; do
wget "https://dev.mysql.com/get/Downloads/MySQL-5.7/$rpm_file"
done
cat <<EOF >> $SRC_DIR/mysql_hash_md5
6ef92158238cd2dd8a7b74f85c62490d mysql-community-server-5.7.24-1.el7.x86_64.rpm
8044968ba1cdce487baf7b2d5ec42629 mysql-community-devel-5.7.24-1.el7.x86_64.rpm
daac5b7147949351aed38995c647194b mysql-community-client-5.7.24-1.el7.x86_64.rpm
5f10843255b1987acbc89a7d1c3a18af mysql-community-common-5.7.24-1.el7.x86_64.rpm
ba4058a9233d7a1d33b77283798dcdea mysql-community-libs-5.7.24-1.el7.x86_64.rpm
EOF
md5sum -c mysql_hash_md5
rpm -ivh $MYSQL_RPMS
sed -e '/^log-error=/ s/^/# /' \
-e '/log-error=/a log-error=/var/log/mysqld/mysqld.log' \
-i /etc/my.cnf
# start munge
yum -y install openssl openssl-devel pam-devel numactl numactl-devel hwloc hwloc-devel lua lua-devel readline-devel rrdtool-devel ncurses-devel man2html libibmad libibumad
yum -y install rpm-build perl-ExtUtils-MakeMaker
yum -y groupinstall "Development Tools"
cd $SRC_DIR
wget https://download.schedmd.com/slurm/slurm-17.11.12.tar.bz2
echo "42f0a5dbe34210283f474328ac6e8d5267dc2386 slurm-17.11.12.tar.bz2" > slurm_hash_sha1
sha1sum -c slurm_hash_sha1
rpmbuild -ta slurm-17.11.12.tar.bz2
yum -y --nogpgcheck localinstall /root/rpmbuild/RPMS/x86_64/slurm-*rpm
# filesystem fix
mkdir -p /var/lib/{mysql,munge,slurm}
mkdir -p /var/log/{mysqld,munge,slurm}
mkdir -p /var/run/{mysqld,munge,slurm}
mkdir -p /var/spool/{slurm,slurmd}
chown slurm:slurm /var/{log,spool}/slurm
chmod 0755 /var/{lib,log,run}/munge
# change munge key permission so we can start it as normal user with munged -f
chmod 0755 /etc/munge/
chmod 0444 /etc/munge/munge.key
# %startscript
# echo "checking service's dirs"
# EXIT=0
# DIRS="/var/lib/mysql /var/lib/munge /var/lib/slurm"
# DIRS="$DIRS /var/log/mysqld /var/log/munge /var/log/slurm"
# DIRS="$DIRS /var/run/mysqld /var/run/munge /var/run/slurm"
# DIRS="$DIRS /var/spool/slurm /var/spool/slurmd"
# for dir in $DIRS; do
# mkdir -p $dir
# touch $dir/write_test
# if [ ! -f $dir/write_test ]; then
# echo "$dir/ is not writable. Bind it to host directory."
# EXIT=1
# else
# rm -f $dir/write_test
# fi
# done
# [ $EXIT -ne 0 ] && exit 1
# # see singularity logs in /tmp
#
%help
To use this container you NEED /etc/slurm/slurm.conf
munged -f
mysqld --initialize --init-file=$HOME/slurm_init_db_server
mysqld --secure-file-priv=NULL &
export SLURM_CONF=slurm_slurm.conf
slurmctld
slurmd
ln -s /my/slurmdbd_config_file $HOME/slurmdbd.conf
slurmdbd