-
Notifications
You must be signed in to change notification settings - Fork 0
/
run_deployment.sh
47 lines (36 loc) · 1.21 KB
/
run_deployment.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
#!/bin/bash
set -e # exits upon first error in any of the commands
# update the system
sudo apt-get update && sudo apt-get upgrade --yes
sudo apt clean
sudo apt autoremove
eval "$(micromamba shell hook --shell=bash)"
micromamba activate zoomin
# List of databases
DATABASES=("de" "es" "pl" "be" "el" "lt" "pt" "bg" "lu" "ro" "cz" "fr" "hu" "si" "dk" "hr" "mt" "sk" "it" "nl" "fi" "ee" "cy" "at" "se" "ie" "lv")
# Run snakemake for each database in parallel
for db_name in "${DATABASES[@]}"; do
export DB_NAME=$db_name
# populate DB
cd snakemake/climate_vars
START=$(date +%s)
snakemake -c 5 -j 5
END=$(date +%s)
duration=$((END - START))
echo "Time taken: $duration seconds ===================================="
cd ../collected_vars
START=$(date +%s)
snakemake -c 5 -j 5
END=$(date +%s)
duration=$((END - START))
echo "Time taken: $duration seconds ===================================="
cd ../eucalc_vars
START=$(date +%s)
snakemake -c 6 -j 6
END=$(date +%s)
duration=$((END - START))
echo "Time taken: $duration seconds ===================================="
cd ../..
sudo systemctl restart nginx
sudo systemctl restart gunicorn
done