-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.fish
53 lines (40 loc) · 1.38 KB
/
run.fish
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
#!/usr/bin/env fish
set BASEDIR (dirname (status --current-filename))
echo "Installing git"
apt install --assume-yes git
mkdir -p /srv/salt
cp $BASEDIR/salt/states/* /srv/salt/
cp -r $BASEDIR/requirements /srv/salt/
mkdir -p /srv/pillar
cp $BASEDIR/salt/pillar/* /srv/pillar/
mkdir -p /srv/formulas
if not test -d /srv/formulas/postgres-formula
git clone https://github.com/saltstack-formulas/postgres-formula /srv/formulas/postgres-formula
end
echo "Installing SaltStack"
curl -o bootstrap-salt.sh -L https://bootstrap.saltstack.com
set minion_config '{"master": "localhost"}'
set master_config (echo '
{
"auto_accept": true,
"file_roots": {
"base": [
"/srv/salt",
"/srv/formulas/postgres-formula"
]
},
"interface": "127.0.0.1"
}
')
sh bootstrap-salt.sh -M -j "$minion_config" -J "$master_config"
while not salt '*' test.ping >/dev/null ^/dev/null
echo "Waiting for SaltStack startup"
sleep 1
end
echo "Applying SaltStack state (this could take minutes to complete)"
salt '*' state.apply
cp -a $BASEDIR /home/conceptnet/conceptnet-benchmark
chown -R conceptnet:conceptnet /home/conceptnet/
echo "Swithing to conceptnet user and running all rules"
cd /home/conceptnet/conceptnet-benchmark
sudo -u conceptnet /home/conceptnet/conceptnet_rocks_virtualenv/bin/snakemake --snakefile /home/conceptnet/conceptnet-benchmark/Snakefile -j1