Add URL to view and download BOINC result
[slapos.git] / stack / boinc / instance-boinc.cfg
1 [buildout]
2
3 parts =
4   boinc-server
5   boinc-app
6   certificate-authority
7   ca-stunnel
8   logrotate
9   logrotate-entry-apache
10   logrotate-entry-stunnel
11   cron
12   cron-entry-logrotate
13   cron-entry-boinc
14   promise
15   slapmonitor
16   frontend-promise
17   content-promise
18   publish-connection-informations
19
20 eggs-directory = ${buildout:eggs-directory}
21 develop-eggs-directory = ${buildout:develop-eggs-directory}
22 #temporary solution
23 newest = false
24 offline = false
25
26
27 # Creation of all needed directories
28 [rootdirectory]
29 recipe = slapos.cookbook:mkdirectory
30 etc = $${buildout:directory}/etc/
31 var = $${buildout:directory}/var/
32 srv = $${buildout:directory}/srv/
33 bin = $${buildout:directory}/bin/
34 tmp = $${buildout:directory}/tmp/
35 project = $${buildout:directory}/projects/
36
37 [basedirectory]
38 recipe = slapos.cookbook:mkdirectory
39 log = $${rootdirectory:var}/log/
40 services = $${rootdirectory:etc}/service/
41 scripts = $${rootdirectory:etc}/run/
42 run = $${rootdirectory:var}/run/
43 backup = $${rootdirectory:srv}/backup/
44 promises = $${rootdirectory:etc}/promise/
45 application = $${rootdirectory:tmp}/application
46 boinc = $${rootdirectory:tmp}/boinc
47
48 [directory]
49 recipe = slapos.cookbook:mkdirectory
50 ca-dir = $${rootdirectory:srv}/ssl/
51 httpd-log = $${basedirectory:log}/apache/
52 php-ini-dir = $${rootdirectory:etc}/php/
53 tmp-php = $${rootdirectory:tmp}/php/
54 logrotate-entries = $${rootdirectory:etc}/logrotate.d/
55 logrotate-backup = $${basedirectory:backup}/logrotate/
56 stunnel-conf = $${rootdirectory:etc}/stunnel/
57 cronstamps = $${rootdirectory:etc}/cronstamps/
58 cron-entries = $${rootdirectory:etc}/cron.d/
59 crontabs = $${rootdirectory:etc}/crontabs/
60
61 [cadirectory]
62 recipe = slapos.cookbook:mkdirectory
63 requests = $${directory:ca-dir}/requests/
64 private = $${directory:ca-dir}/private/
65 certs = $${directory:ca-dir}/certs/
66 newcerts = $${directory:ca-dir}/newcerts/
67 crl = $${directory:ca-dir}/crl/
68
69
70 # Deploy stunnel
71 [stunnel]
72 recipe = slapos.cookbook:stunnel
73 client = true
74 stunnel-binary = ${stunnel:location}/bin/stunnel
75 remote-host = $${mariadb-urlparse:host}
76 remote-port = $${mariadb-urlparse:port}
77 local-host = $${slap-network-information:local-ipv4}
78 local-port = 3306
79 log-file = $${basedirectory:log}/stunnel.log
80 config-file = $${directory:stunnel-conf}/stunnel.conf
81 key-file = $${directory:stunnel-conf}/stunnel.key
82 cert-file = $${directory:stunnel-conf}/stunnel.crt
83 pid-file = $${basedirectory:run}/stunnel.pid
84 wrapper = $${rootdirectory:bin}/raw_stunnel
85 post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate
86
87
88 # Certificate stuffs
89 [certificate-authority]
90 recipe = slapos.cookbook:certificate_authority
91 openssl-binary = ${openssl:location}/bin/openssl
92 ca-dir = $${directory:ca-dir}
93 requests-directory = $${cadirectory:requests}
94 wrapper = $${basedirectory:services}/ca
95 ca-private = $${cadirectory:private}
96 ca-certs = $${cadirectory:certs}
97 ca-newcerts = $${cadirectory:newcerts}
98 ca-crl = $${cadirectory:crl}
99
100 [ca-stunnel]
101 <= certificate-authority
102 recipe = slapos.cookbook:certificate_authority.request
103 executable = $${stunnel:wrapper}
104 wrapper = $${basedirectory:services}/stunnel
105 key-file = $${stunnel:key-file}
106 cert-file = $${stunnel:cert-file}
107
108
109 # Request MariaDB instance and parse its URL
110 [request-mariadb]
111 <= slap-connection
112 recipe = slapos.cookbook:request
113 name = MariaDB
114 software-url = $${slap-connection:software-release-url}
115 software-type = mariadb
116 return = url
117
118 [mariadb-urlparse]
119 recipe = slapos.cookbook:urlparse
120 url = $${request-mariadb:connection-url}
121
122 [httpd-conf]
123 recipe = slapos.recipe.template
124 url = ${template-httpd-conf:location}/${template-httpd-conf:filename}
125 output = $${rootdirectory:etc}/apache.conf
126
127 document_root = $${rootdirectory:srv}/www/
128 pid_file = $${basedirectory:run}/apache.pid
129 lock_file = $${basedirectory:run}/apache.lock
130 cgid_sock = $${basedirectory:run}/cgid.sock
131 ip = $${slap-network-information:global-ipv6}
132 port = 8080
133 error_log = $${directory:httpd-log}/error.log
134 access_log = $${directory:httpd-log}/access.log
135 php_ini_dir = $${directory:php-ini-dir}
136 niceprojectname = $${slap-parameter:project}@HOME
137 project = $${slap-parameter:project}
138 installroot = $${rootdirectory:project}/$${slap-parameter:project}
139 result_dir = $${rootdirectory:project}/$${slap-parameter:project}/sample_results/
140
141 [environment]
142 PATH = $${rootdirectory:bin}:${subversion:location}/bin:${perl:location}/bin:%(PATH)s
143
144 # Deploy Apache + PHP application
145 [apache-php]
146 recipe = slapos.cookbook:apachephp
147 source = $${basedirectory:application}
148
149 default-conf = false
150 httpd-conf = $${httpd-conf:output}
151 pid-file = $${basedirectory:run}/apache.pid
152 lock-file = $${basedirectory:run}/apache.lock
153 error-log = $${directory:httpd-log}/error.log
154 access-log = $${directory:httpd-log}/access.log
155 wrapper = $${basedirectory:services}/apache
156 ip = $${httpd-conf:ip}
157 port = $${httpd-conf:port}
158 url = http://[$${:ip}]:$${:port}/
159 httpd-binary = ${apache:location}/bin/httpd
160 htdocs = $${rootdirectory:srv}/www/
161 tmp-dir = $${directory:tmp-php}
162 php-ini-dir = $${directory:php-ini-dir}
163
164 mysql-username = $${mariadb-urlparse:username}
165 mysql-password = $${mariadb-urlparse:password}
166 mysql-database = $${mariadb-urlparse:path}
167 mysql-host = $${stunnel:local-host}
168 mysql-port = $${stunnel:local-port}
169 #send environment variable for apache process
170 environment-section =
171   environment
172
173 template = 
174 configuration = 
175
176 [boinc-passwd]
177 recipe = slapos.cookbook:generate.password
178 storage-path = $${rootdirectory:etc}/.boincpasswd
179 bytes = 4
180
181 #deploy boinc server instance now
182 #Boinc server depend on apache-php instance
183 [boinc-server]
184 recipe = slapos.cookbook:boinc
185 home = $${buildout:directory}
186 project = $${slap-parameter:project}
187 #url-base = http://[$${apache-php:ip}]:$${apache-php:port}/
188 url-base = $${request-frontend:connection-site_url}
189 fullname = $${slap-parameter:full-name}
190 copyright = $${slap-parameter:copyright-holder}
191 boinc = ${boinc:location}
192 installroot = $${rootdirectory:project}/$${slap-parameter:project}
193 wrapper-dir = $${basedirectory:scripts}
194 source = ${boinc:source}
195 passwd = $${boinc-passwd:storage-path}
196 #Manualy add develop-egg and boinc-egg to pythonpath
197 develop-egg = ${buildout:develop-eggs-directory}
198
199 #Other binary path
200 svn-binary = ${subversion:location}/bin
201 perl-binary = ${perl:location}/bin
202 python-binary = ${buildout:executable}
203 dash = ${dash:location}/bin/dash
204
205 #Apache and php
206 htpasswd  = ${apache:location}/bin/htpasswd
207 apache-pid = $${httpd-conf:pid_file}
208 php-ini = $${apache-php:php-ini-dir}/php.ini
209 php-bin = ${apache-php:location}/bin/php
210 php-wrapper = $${rootdirectory:bin}php
211
212 #Mysql Informations
213 mysql-username = $${mariadb-urlparse:username}
214 mysql-password = $${mariadb-urlparse:password}
215 mysql-database = $${mariadb-urlparse:path}
216 mysql-host = $${stunnel:local-host}
217 mysql-port = $${stunnel:local-port}
218
219 #This allow to deploy or to update Boinc application using only slapparameters from
220 #vifib BOINC instance parameters
221 [boinc-app]
222 <= boinc-server
223 recipe = slapos.cookbook:boinc.app
224 #appname and version is require to update any existing application
225 #otherwise, the recipe would try to install a new one
226 boinc-app-list  = $${slap-parameter:boinc-app-list}
227 default-template-result = $${slap-parameter:default-template-result}
228 default-template-wu = $${slap-parameter:default-template-wu}
229 default-extension = $${slap-parameter:default-extension}
230 default-platform = $${slap-parameter:default-platform}
231
232 # Deploy logrotate, cron, configure it
233 [logrotate]
234 recipe = slapos.cookbook:logrotate
235 # Binaries
236 logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
237 gzip-binary = ${gzip:location}/bin/gzip
238 gunzip-binary = ${gzip:location}/bin/gunzip
239 # Directories
240 wrapper = $${rootdirectory:bin}/logrotate
241 conf = $${rootdirectory:etc}/logrotate.conf
242 logrotate-entries = $${directory:logrotate-entries}
243 backup = $${directory:logrotate-backup}
244 state-file = $${rootdirectory:srv}/logrotate.status
245
246 [logrotate-entry-apache]
247 <= logrotate
248 recipe = slapos.cookbook:logrotate.d
249 name = apache
250 log = $${httpd-conf:error_log} $${httpd-conf:access_log}
251 frequency = daily
252 rotate-num = 30
253 sharedscripts = true
254 notifempty = true
255 create = true
256
257 [logrotate-entry-stunnel]
258 <= logrotate
259 recipe = slapos.cookbook:logrotate.d
260 name = stunnel
261 log = $${stunnel:log-file}
262 frequency = daily
263 rotate-num = 30
264 notifempty = true
265 create = true
266 post = $${stunnel:post-rotate-script}
267
268 [cron-simplelogger]
269 recipe = slapos.cookbook:simplelogger
270 wrapper = $${rootdirectory:bin}/cron_simplelogger
271 log = $${basedirectory:log}/crond.log
272
273 [cron]
274 recipe = slapos.cookbook:cron
275 dcrond-binary = ${dcron:location}/sbin/crond
276 cron-entries = $${directory:cron-entries}
277 crontabs = $${directory:crontabs}
278 cronstamps = $${directory:cronstamps}
279 catcher = $${cron-simplelogger:wrapper}
280 binary = $${basedirectory:services}/crond
281
282 [cron-entry-logrotate]
283 <= cron
284 recipe = slapos.cookbook:cron.d
285 name = logrotate
286 frequency = 0 0 * * *
287 command = $${logrotate:wrapper}
288
289 [cron-entry-boinc]
290 <= cron
291 recipe = slapos.cookbook:cron.d
292 name = cronjob
293 frequency = 0,5,10,15,20,25,30,35,40,45,50,55 * * * *
294 command = PATH=$${rootdirectory:bin}:$PATH $${boinc-server:installroot}/bin/start --cron
295
296
297 # Request frontend
298 [request-frontend]
299 <= slap-connection
300 recipe = slapos.cookbook:requestoptional
301 name = Frontend
302 # XXX We have hardcoded SR URL here.
303 software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
304 slave = true
305 config = url custom_domain
306 config-url = http://[$${apache-php:ip}]:$${apache-php:port}/
307 return = site_url
308 config-custom_domain = $${slap-parameter:domain}
309
310
311 # Deploy slapmonitor
312 [slapmonitor]
313 recipe = slapos.cookbook:slapmonitor
314 pid-file = $${basedirectory:run}/apache.pid
315 database-path = $${basedirectory:log}/slapmonitor.db
316 shell-path = ${dash:location}/bin/dash
317 slapmonitor-path = ${buildout:bin-directory}/slapmonitor
318 path = $${basedirectory:scripts}/slapmonitor
319
320
321 # Publish all instance parameters (url of instance)
322 [publish-connection-informations]
323 recipe = slapos.cookbook:publish
324 boinc_admin_page = $${boinc-server:admin_page}
325 boinc_result_url = $${boinc-server:result_page}
326 boinc_home_page = $${boinc-server:home_page}
327 boinc_user = $${boinc-server:user}
328 boinc_passwd = $${boinc-passwd:passwd}
329
330
331 # Deploy promises scripts
332 [promise]
333 recipe = slapos.cookbook:check_port_listening
334 path = $${basedirectory:promises}/apache
335 hostname = $${apache-php:ip}
336 port = $${apache-php:port}
337
338 [frontend-promise]
339 recipe = slapos.cookbook:check_url_available
340 path = $${basedirectory:promises}/frontend
341 url = $${request-frontend:connection-site_url}/$${slap-parameter:project}
342 dash_path = ${dash:location}/bin/dash
343 curl_path = ${curl:location}/bin/curl
344
345 [content-promise]
346 recipe = slapos.cookbook:check_page_content
347 path = $${basedirectory:promises}/content
348 url = $${request-frontend:connection-site_url}/$${slap-parameter:project}
349 match = $${slap-parameter:full-name}
350 dash_path = ${dash:location}/bin/dash
351 curl_path = ${curl:location}/bin/curl
352
353 [slap-parameter]
354 #Default config value for boinc
355 project = boinc_test
356 full-name = Boinc Project SAMPLE
357 copyright-holder = REPLACE WITH COPYRIGHT HOLDER
358 #definition of BOINC parameter
359 #boinc-app-list is a Json data for all application to deploy
360 # boinc-app-list  = {"MY_APP1":{VERSION1:{
361 #                   use_default:true, "binary":"MY_BINARY",
362 #                   "platform":"", "extension":"", "template-result":"",
363 #                   "template-wu":"", "wu-number":1, "input-file":"INPUT"},
364 #                   "VERSION2":{use_default:false, ...}}}
365 # "app-name" parameter is now boinc-app-list[key]
366 boinc-app-list  = ${boinc-application:app-list}
367 default-template-result = ${boinc-default:template-result}
368 default-template-wu = ${boinc-default:template-wu}
369 default-extension = ${boinc-default:extension}
370 default-platform = ${boinc-default:platform}
371 # Default value if no domain is specified
372 domain =