-
Notifications
You must be signed in to change notification settings - Fork 3
/
switch-mirgecom.sh
executable file
·86 lines (72 loc) · 2.31 KB
/
switch-mirgecom.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
#!/bin/bash
set -eo pipefail
function usage {
echo "Usage: $0 <env_name>"
echo 'Where <env_name> is one of "parlazy", "prod", "prodfusion", "main".'
}
if [[ $# -ne 1 ]]; then
usage
exit 1
fi
envname="$1"
if [[ "$envname" = "parlazy" ]]; then
arraycontext=origin/main
pytato=origin/main
loopy=kaushikcfd/pytato-array-context-transforms
meshmode=kaushikcfd/pytato-array-context-transforms
grudge=origin/main
mirgecom=origin/distributed-parallel-lazy
elif [[ "$envname" = "prod" ]]; then
arraycontext=origin/main
pytato=origin/main
loopy=kaushikcfd/pytato-array-context-transforms
meshmode=kaushikcfd/pytato-array-context-transforms
grudge=origin/main
mirgecom=origin/production
elif [[ "$envname" = "prodfusion" ]]; then
arraycontext=kaushikcfd/main
pytato=kaushikcfd/main
loopy=kaushikcfd/main
meshmode=kaushikcfd/main
grudge=kaushikcfd/main
mirgecom=origin/fusion_actx
echo "Installing additional dependencies for prodfusion"
pip install -U git+https://github.com/pythological/kanren.git#egg=miniKanren
pip install -U git+https://github.com/kaushikcfd/feinsum.git#egg=feinsum
elif [[ "$envname" = "main" ]]; then
# Ignore shellcheck warnings regarding unused variables
# shellcheck disable=SC2034
arraycontext=origin/main
# shellcheck disable=SC2034
pytato=origin/main
# shellcheck disable=SC2034
loopy=origin/main
# shellcheck disable=SC2034
meshmode=origin/main
# shellcheck disable=SC2034
grudge=origin/main
# shellcheck disable=SC2034
mirgecom=origin/main
else
usage
exit 2
fi
for pkg in arraycontext pytato loopy meshmode grudge mirgecom; do
remote_and_branch=${!pkg}
remote="$(dirname "$remote_and_branch")"
branch="$(basename "$remote_and_branch")"
echo "-------------------------------------------------------------------"
echo "Updating $pkg to $remote_and_branch..."
echo "-------------------------------------------------------------------"
(
cd "$pkg"
if [[ $(git remote | grep "$remote") != "$remote" ]]; then
git remote add "$remote" "[email protected]:$remote/$pkg"
fi
git fetch "$remote"
git checkout "$branch"
git branch --set-upstream-to="$remote/$branch"
git pull --rebase "$remote" "$branch"
)
done
# vim: sw=4