instance-boinc.cfg 11.5 KB
Newer Older
1 2 3 4
[buildout]

parts =
  boinc-server
5
  boinc-app
6 7 8 9 10 11 12
  certificate-authority
  ca-stunnel
  logrotate
  logrotate-entry-apache
  logrotate-entry-stunnel
  cron
  cron-entry-logrotate
Alain Takoudjou's avatar
Alain Takoudjou committed
13
  cron-entry-boinc
14 15 16
  promise
  slapmonitor
  frontend-promise
17
  content-promise
18 19 20 21
  publish-connection-informations

eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
22 23 24
#temporary solution
newest = false
offline = false
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39


# Creation of all needed directories
[rootdirectory]
recipe = slapos.cookbook:mkdirectory
etc = $${buildout:directory}/etc/
var = $${buildout:directory}/var/
srv = $${buildout:directory}/srv/
bin = $${buildout:directory}/bin/
tmp = $${buildout:directory}/tmp/
project = $${buildout:directory}/projects/

[basedirectory]
recipe = slapos.cookbook:mkdirectory
log = $${rootdirectory:var}/log/
40 41
services = $${rootdirectory:etc}/service/
scripts = $${rootdirectory:etc}/run/
42 43 44 45
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/
application = $${rootdirectory:tmp}/application
Alain Takoudjou's avatar
Alain Takoudjou committed
46
boinc = $${rootdirectory:tmp}/boinc
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

[directory]
recipe = slapos.cookbook:mkdirectory
ca-dir = $${rootdirectory:srv}/ssl/
httpd-log = $${basedirectory:log}/apache/
php-ini-dir = $${rootdirectory:etc}/php/
tmp-php = $${rootdirectory:tmp}/php/
logrotate-entries = $${rootdirectory:etc}/logrotate.d/
logrotate-backup = $${basedirectory:backup}/logrotate/
stunnel-conf = $${rootdirectory:etc}/stunnel/
cronstamps = $${rootdirectory:etc}/cronstamps/
cron-entries = $${rootdirectory:etc}/cron.d/
crontabs = $${rootdirectory:etc}/crontabs/

[cadirectory]
recipe = slapos.cookbook:mkdirectory
requests = $${directory:ca-dir}/requests/
private = $${directory:ca-dir}/private/
certs = $${directory:ca-dir}/certs/
newcerts = $${directory:ca-dir}/newcerts/
crl = $${directory:ca-dir}/crl/


# Deploy stunnel
[stunnel]
recipe = slapos.cookbook:stunnel
client = true
stunnel-binary = ${stunnel:location}/bin/stunnel
remote-host = $${mariadb-urlparse:host}
remote-port = $${mariadb-urlparse:port}
local-host = $${slap-network-information:local-ipv4}
Alain Takoudjou's avatar
Alain Takoudjou committed
78
local-port = 3306
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
log-file = $${basedirectory:log}/stunnel.log
config-file = $${directory:stunnel-conf}/stunnel.conf
key-file = $${directory:stunnel-conf}/stunnel.key
cert-file = $${directory:stunnel-conf}/stunnel.crt
pid-file = $${basedirectory:run}/stunnel.pid
wrapper = $${rootdirectory:bin}/raw_stunnel
post-rotate-script = $${rootdirectory:bin}/stunnel_post_rotate


# Certificate stuffs
[certificate-authority]
recipe = slapos.cookbook:certificate_authority
openssl-binary = ${openssl:location}/bin/openssl
ca-dir = $${directory:ca-dir}
requests-directory = $${cadirectory:requests}
wrapper = $${basedirectory:services}/ca
ca-private = $${cadirectory:private}
ca-certs = $${cadirectory:certs}
ca-newcerts = $${cadirectory:newcerts}
ca-crl = $${cadirectory:crl}

[ca-stunnel]
<= certificate-authority
recipe = slapos.cookbook:certificate_authority.request
executable = $${stunnel:wrapper}
wrapper = $${basedirectory:services}/stunnel
key-file = $${stunnel:key-file}
cert-file = $${stunnel:cert-file}


# Request MariaDB instance and parse its URL
[request-mariadb]
<= slap-connection
recipe = slapos.cookbook:request
name = MariaDB
software-url = $${slap-connection:software-release-url}
software-type = mariadb
return = url

[mariadb-urlparse]
recipe = slapos.cookbook:urlparse
url = $${request-mariadb:connection-url}

122 123 124 125 126 127 128 129
[httpd-conf]
recipe = slapos.recipe.template
url = ${template-httpd-conf:location}/${template-httpd-conf:filename}
output = $${rootdirectory:etc}/apache.conf

document_root = $${rootdirectory:srv}/www/
pid_file = $${basedirectory:run}/apache.pid
lock_file = $${basedirectory:run}/apache.lock
130
cgid_sock = $${basedirectory:run}/cgid.sock
131 132 133 134 135 136 137 138
ip = $${slap-network-information:global-ipv6}
port = 8080
error_log = $${directory:httpd-log}/error.log
access_log = $${directory:httpd-log}/access.log
php_ini_dir = $${directory:php-ini-dir}
niceprojectname = $${slap-parameter:project}@HOME
project = $${slap-parameter:project}
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 145 146 147 148

# Deploy Apache + PHP application
[apache-php]
recipe = slapos.cookbook:apachephp
source = $${basedirectory:application}

149 150
default-conf = false
httpd-conf = $${httpd-conf:output}
151 152 153 154 155
pid-file = $${basedirectory:run}/apache.pid
lock-file = $${basedirectory:run}/apache.lock
error-log = $${directory:httpd-log}/error.log
access-log = $${directory:httpd-log}/access.log
wrapper = $${basedirectory:services}/apache
156
ip = $${httpd-conf:ip}
157 158
port = $${httpd-conf:port}
url = http://[$${:ip}]:$${:port}/
159
httpd-binary = ${apache:location}/bin/httpd
160 161 162
htdocs = $${rootdirectory:srv}/www/
tmp-dir = $${directory:tmp-php}
php-ini-dir = $${directory:php-ini-dir}
163 164 165 166 167 168

mysql-username = $${mariadb-urlparse:username}
mysql-password = $${mariadb-urlparse:password}
mysql-database = $${mariadb-urlparse:path}
mysql-host = $${stunnel:local-host}
mysql-port = $${stunnel:local-port}
169 170 171
#send environment variable for apache process
environment-section =
  environment
172 173 174 175 176 177 178 179 180 181 182 183 184 185

template = 
configuration = 

[boinc-passwd]
recipe = slapos.cookbook:generate.password
storage-path = $${rootdirectory:etc}/.boincpasswd
bytes = 4

#deploy boinc server instance now
#Boinc server depend on apache-php instance
[boinc-server]
recipe = slapos.cookbook:boinc
home = $${buildout:directory}
Alain Takoudjou's avatar
Alain Takoudjou committed
186
project = $${slap-parameter:project}
187
#url-base = http://[$${apache-php:ip}]:$${apache-php:port}/
188
url-base = $${request-frontend:connection-site_url}
Alain Takoudjou's avatar
Alain Takoudjou committed
189 190
fullname = $${slap-parameter:full-name}
copyright = $${slap-parameter:copyright-holder}
191
boinc = ${boinc:location}
Alain Takoudjou's avatar
Alain Takoudjou committed
192
installroot = $${rootdirectory:project}/$${slap-parameter:project}
193
wrapper-dir = $${basedirectory:scripts}
194 195 196 197 198 199 200 201
source = ${boinc:source}
passwd = $${boinc-passwd:storage-path}
#Manualy add develop-egg and boinc-egg to pythonpath
develop-egg = ${buildout:develop-eggs-directory}

#Other binary path
svn-binary = ${subversion:location}/bin
perl-binary = ${perl:location}/bin
202
python-binary = ${buildout:executable}
203
dash = ${dash:location}/bin/dash
204 205 206

#Apache and php
htpasswd  = ${apache:location}/bin/htpasswd
207
apache-pid = $${httpd-conf:pid_file}
208 209 210 211 212 213 214 215 216 217 218
php-ini = $${apache-php:php-ini-dir}/php.ini
php-bin = ${apache-php:location}/bin/php
php-wrapper = $${rootdirectory:bin}php

#Mysql Informations
mysql-username = $${mariadb-urlparse:username}
mysql-password = $${mariadb-urlparse:password}
mysql-database = $${mariadb-urlparse:path}
mysql-host = $${stunnel:local-host}
mysql-port = $${stunnel:local-port}

219 220
#This allow to deploy or to update Boinc application using only slapparameters from
#vifib BOINC instance parameters
221
[boinc-app]
222 223
<= boinc-server
recipe = slapos.cookbook:boinc.app
224 225
#appname and version is require to update any existing application
#otherwise, the recipe would try to install a new one
226 227 228 229 230
boinc-app-list  = $${slap-parameter:boinc-app-list}
default-template-result = $${slap-parameter:default-template-result}
default-template-wu = $${slap-parameter:default-template-wu}
default-extension = $${slap-parameter:default-extension}
default-platform = $${slap-parameter:default-platform}
231

232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249
# Deploy logrotate, cron, configure it
[logrotate]
recipe = slapos.cookbook:logrotate
# Binaries
logrotate-binary = ${logrotate:location}/usr/sbin/logrotate
gzip-binary = ${gzip:location}/bin/gzip
gunzip-binary = ${gzip:location}/bin/gunzip
# Directories
wrapper = $${rootdirectory:bin}/logrotate
conf = $${rootdirectory:etc}/logrotate.conf
logrotate-entries = $${directory:logrotate-entries}
backup = $${directory:logrotate-backup}
state-file = $${rootdirectory:srv}/logrotate.status

[logrotate-entry-apache]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = apache
250
log = $${httpd-conf:error_log} $${httpd-conf:access_log}
251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288
frequency = daily
rotate-num = 30
sharedscripts = true
notifempty = true
create = true

[logrotate-entry-stunnel]
<= logrotate
recipe = slapos.cookbook:logrotate.d
name = stunnel
log = $${stunnel:log-file}
frequency = daily
rotate-num = 30
notifempty = true
create = true
post = $${stunnel:post-rotate-script}

[cron-simplelogger]
recipe = slapos.cookbook:simplelogger
wrapper = $${rootdirectory:bin}/cron_simplelogger
log = $${basedirectory:log}/crond.log

[cron]
recipe = slapos.cookbook:cron
dcrond-binary = ${dcron:location}/sbin/crond
cron-entries = $${directory:cron-entries}
crontabs = $${directory:crontabs}
cronstamps = $${directory:cronstamps}
catcher = $${cron-simplelogger:wrapper}
binary = $${basedirectory:services}/crond

[cron-entry-logrotate]
<= cron
recipe = slapos.cookbook:cron.d
name = logrotate
frequency = 0 0 * * *
command = $${logrotate:wrapper}

Alain Takoudjou's avatar
Alain Takoudjou committed
289 290 291 292 293
[cron-entry-boinc]
<= cron
recipe = slapos.cookbook:cron.d
name = cronjob
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
Alain Takoudjou's avatar
Alain Takoudjou committed
295

296 297 298 299 300 301 302 303 304

# Request frontend
[request-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
305
config = url custom_domain
306 307 308 309 310 311 312 313 314 315 316 317
config-url = http://[$${apache-php:ip}]:$${apache-php:port}/
return = site_url
config-custom_domain = $${slap-parameter:domain}


# Deploy slapmonitor
[slapmonitor]
recipe = slapos.cookbook:slapmonitor
pid-file = $${basedirectory:run}/apache.pid
database-path = $${basedirectory:log}/slapmonitor.db
shell-path = ${dash:location}/bin/dash
slapmonitor-path = ${buildout:bin-directory}/slapmonitor
318
path = $${basedirectory:scripts}/slapmonitor
319 320 321 322 323


# Publish all instance parameters (url of instance)
[publish-connection-informations]
recipe = slapos.cookbook:publish
324
boinc_admin_page = $${boinc-server:admin_page}
325
boinc_result_url = $${boinc-server:result_page}
326 327 328
boinc_home_page = $${boinc-server:home_page}
boinc_user = $${boinc-server:user}
boinc_passwd = $${boinc-passwd:passwd}
329 330 331 332 333 334 335 336 337 338 339 340


# Deploy promises scripts
[promise]
recipe = slapos.cookbook:check_port_listening
path = $${basedirectory:promises}/apache
hostname = $${apache-php:ip}
port = $${apache-php:port}

[frontend-promise]
recipe = slapos.cookbook:check_url_available
path = $${basedirectory:promises}/frontend
341
url = $${request-frontend:connection-site_url}/$${slap-parameter:project}
Alain Takoudjou's avatar
Alain Takoudjou committed
342 343
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
344

345 346 347 348
[content-promise]
recipe = slapos.cookbook:check_page_content
path = $${basedirectory:promises}/content
url = $${request-frontend:connection-site_url}/$${slap-parameter:project}
349
match = $${slap-parameter:full-name}
350 351 352
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl

353
[slap-parameter]
Alain Takoudjou's avatar
Alain Takoudjou committed
354 355 356 357
#Default config value for boinc
project = boinc_test
full-name = Boinc Project SAMPLE
copyright-holder = REPLACE WITH COPYRIGHT HOLDER
358 359 360 361 362 363 364 365 366 367 368 369 370
#definition of BOINC parameter
#boinc-app-list is a Json data for all application to deploy
# boinc-app-list  = {"MY_APP1":{VERSION1:{
#                   use_default:true, "binary":"MY_BINARY",
#                   "platform":"", "extension":"", "template-result":"",
#                   "template-wu":"", "wu-number":1, "input-file":"INPUT"},
#                   "VERSION2":{use_default:false, ...}}}
# "app-name" parameter is now boinc-app-list[key]
boinc-app-list  = ${boinc-application:app-list}
default-template-result = ${boinc-default:template-result}
default-template-wu = ${boinc-default:template-wu}
default-extension = ${boinc-default:extension}
default-platform = ${boinc-default:platform}
371
# Default value if no domain is specified
372
domain =