-
Notifications
You must be signed in to change notification settings - Fork 0
/
make-pipes
executable file
·140 lines (121 loc) · 3.44 KB
/
make-pipes
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
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
#!/bin/sh
pwd | grep '/dev/' >/dev/null 2>/dev/null
if [ $? = 0 ] ; then
export DEV='/dev'
fi
/bin/echo -n > volist.tmp
/bin/echo -n > for.html
cat <<EOF >all-vos.pipe
{
"cache_seconds": 3600,
"machinetypes":
[
EOF
(
cat <<EOF
1 cernvm4 cernatschool.org
1 cernvm4 comet.j-parc.jp
1 cernvm4 dune
1 cernvm4 gridpp
8 cernvm4 gridpp
1 cernvm4 hyperk.org
1 cernvm4 lsst
4 cernvm4 lsst
1 cernvm4 lz
1 cernvm4 magrid
1 cernvm4 mice
1 cernvm4 na62.vo.gridpp.ac.uk
1 cernvm4 pheno
1 cernvm4 skatelescope.eu
8 cernvm4 skatelescope.eu
1 cernvm4 snoplus.snolab.ca
1 cernvm4 solidexperiment.org
1 cernvm4 t2k.org
1 cernvm4 vo.moedal.org
1 cernvm4 vo.northgrid.ac.uk
1 cernvm4 vo.scotgrid.ac.uk
EOF
) | (
while read processors cernvmVersion vo
do
export processors cernvmVersion vo
if [ $processors -gt 1 ] ; then
export processors_str="$processors"
export dirac_opts="--maxNumberOfProcessors $processors --tag MultiProcessor --tag ${processors}Processors --requiredTag ${processors}Processors"
else
export processors_str=""
export dirac_opts=""
fi
export dirac_opts="$dirac_opts -o /Resources/Computing/CEDefaults/SubmitPool=Pool_$vo -o /Resources/Computing/CEDefaults/VirtualOrganization=$vo -g v13r0"
export vohyphens=`echo $vo | sed 's/\./-/g'`
# NB this is repeated in the all-vos.pipe file below too
cat <<EOF >$vohyphens$processors_str.pipe
{
"cache_seconds": 3600,
"machinetypes":
[
{
"accounting_fqan": "/$vo/Role=NULL/Capability=NULL",
"backoff_seconds": 600,
"fizzle_seconds": 600,
"heartbeat_file": "heartbeat",
"heartbeat_seconds": 600,
"machine_model": "cernvm3",
"min_wallclock_seconds": 50000,
"max_wallclock_seconds": 100000,
"min_processors": $processors,
"max_processors": $processors,
"root_image": "https://repo.gridpp.ac.uk/vacproject$DEV/gds/$cernvmVersion.iso",
"suffix": "vm$processors_str-$vohyphens",
"target_share": 1.0,
"user_data": "https://repo.gridpp.ac.uk/vacproject$DEV/gds/pilot/user_data_vm",
"user_data_file_hostcert": "hostcert.pem",
"user_data_file_hostkey": "hostkey.pem",
"user_data_option_dirac_opts": "$dirac_opts",
"user_data_option_vo": "$vo"
}
]
}
EOF
if [ "$needcomma" != "" ] ; then
echo ',' >> all-vos.pipe
/bin/echo ', ' >> volist.tmp
/bin/echo -n ', ' >> for.html
else
needcomma="yes"
fi
/bin/echo -n "$vo" >> volist.tmp
/bin/echo -n "gds-vm$processors_str-$vohyphens" >> for.html
cat <<EOF >>all-vos.pipe
{
"accounting_fqan": "/$vo/Role=NULL/Capability=NULL",
"backoff_seconds": 3600,
"fizzle_seconds": 600,
"heartbeat_file": "heartbeat",
"heartbeat_seconds": 600,
"machine_model": "cernvm3",
"min_wallclock_seconds": 50000,
"max_wallclock_seconds": 100000,
"min_processors": $processors,
"max_processors": $processors,
"root_image": "https://repo.gridpp.ac.uk/vacproject$DEV/gds/$cernvmVersion.iso",
"suffix": "vm$processors_str-$vohyphens",
"target_share": 1.0,
"user_data": "https://repo.gridpp.ac.uk/vacproject$DEV/gds/pilot/user_data_vm",
"user_data_file_hostcert": "hostcert.pem",
"user_data_file_hostkey": "hostkey.pem",
"user_data_option_dirac_opts": "$dirac_opts",
"user_data_option_vo": "$vo"
}
EOF
done
)
cat <<EOF >>all-vos.pipe
]
}
EOF
sed 's/"target_share": 1.0/"target_share": 0.0/' all-vos.pipe > all-vos-zero-shares.pipe
echo >> for.html
echo >> for.html
echo `sort volist.tmp | uniq` >> for.html
rm -f volist.tmp