forked from giovtorres/slurm-docker-cluster
-
Notifications
You must be signed in to change notification settings - Fork 3
/
docker-entrypoint.sh
executable file
·64 lines (52 loc) · 1.58 KB
/
docker-entrypoint.sh
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
#!/bin/bash
set -e
if [ "$1" = "slurmdbd" -o "$1" = "slurmctld" -o "$1" = "slurmd" ]
then
echo "---> Starting the MUNGE Authentication service (munged) ..."
gosu munge /usr/sbin/munged
until pgrep norouter
do
echo "-- Waiting for norouter to start. Sleeping 2 seconds ..."
sleep 2
done
sleep 2
fi
if [ "$1" = "slurmdbd" ]
then
echo "---> Starting the Slurm Database Daemon (slurmdbd) ..."
{
. /etc/slurm/slurmdbd.conf
until echo "SELECT 1" | mysql -h $StorageHost -u$StorageUser -p$StoragePass 2>&1 > /dev/null
do
echo "-- Waiting for database to become active ..."
sleep 1
done
}
echo "-- Database is now active ..."
exec gosu slurm /usr/sbin/slurmdbd -Dvvv
fi
if [ "$1" = "slurmctld" ]
then
echo "---> Waiting for slurmdbd to become active before starting slurmctld ..."
until 2>/dev/null >/dev/tcp/slurmdbd/6819
do
echo "-- Waiting for slurmdbd to become active ..."
sleep 1
done
echo "-- slurmdbd is now active ..."
echo "---> Starting the Slurm Controller Daemon (slurmctld) ..."
exec gosu slurm /usr/sbin/slurmctld -Dvvv
fi
if [ "$1" = "slurmd" ]
then
echo "---> Waiting for slurmctld to become active before starting slurmd..."
until 2>/dev/null >/dev/tcp/slurmctld-norouter/6817
do
echo "-- slurmctld is not available. Sleeping ..."
sleep 1
done
echo "-- slurmctld is now active ..."
echo "---> Starting the Slurm Node Daemon (slurmd) ..."
exec /usr/sbin/slurmd -Dvvv
fi
exec "$@"