-
Notifications
You must be signed in to change notification settings - Fork 0
/
chronos_deploy.sh
executable file
·62 lines (53 loc) · 1.87 KB
/
chronos_deploy.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
broker tenant set $1
deploy cluster chronos create -F DCOS -C Small --cidr 192.168.14.0/24
NODE_NB=${2:-2}
[ -z $2 ] || deploy cluster chronos expand -n $(($NODE_NB - 2))
install_script=$(cat<<- EOT
useradd toil
yum remove -y python-requests
yum group install -y "Development Tools"
yum install -y python-pip python-devel
pip install --upgrade setuptools pip
python -m pip install --upgrade --no-cache-dir toil[mesos,cwl]
git clone https://github.com/CS-SI/chronos-demo/ /home/toil/chronos-demo
chown -R toil:toil /home/toil/chronos-demo
easy_install /home/toil/chronos-demo/python-mesos/centos-7.3_mesos-1.5.1/mesos.interface-*.egg
easy_install /home/toil/chronos-demo/python-mesos/centos-7.3_mesos-1.5.1/mesos.executor-*.egg
easy_install /home/toil/chronos-demo/python-mesos/centos-7.3_mesos-1.5.1/mesos.scheduler-*.egg
easy_install /home/toil/chronos-demo/python-mesos/centos-7.3_mesos-1.5.1/mesos.native-*.egg
easy_install /home/toil/chronos-demo/python-mesos/centos-7.3_mesos-1.5.1/mesos.cli-*.egg
easy_install /home/toil/chronos-demo/python-mesos/centos-7.3_mesos-1.5.1/mesos-*.egg
mkdir -p /home/toil/.local/bin
ln -s /home/toil/chronos-demo/pge/task.py /home/toil/.local/bin
chown -R toil:toil /home/toil/.local/bin
EOT
)
cat<<-EOT | broker ssh connect chronos-master-1
sudo -s
${install_script}
EOT
for num in $(seq 1 $NODE_NB)
do
(cat<<-EOT | broker ssh connect chronos-node-${num}
sudo -s
${install_script}
EOT
)&
done
wait
broker nas create --path="/data" chronos-nas chronos-master-1
for num in $(seq 1 $NODE_NB)
do
broker nas mount chronos-nas chronos-node-${num}&
done
wait
setup_script=$(cat<<- EOT
mkdir -p /data/toil/job_stores
/home/toil/chronos-demo/init_input.sh
chown -R toil:toil /data/toil
EOT
)
cat<<-EOT | broker ssh connect chronos-master-1
sudo -s
${setup_script}
EOT