instance-boinc.cfg 11.1 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
  promise
  frontend-promise
16
  content-promise
17 18 19 20
  publish-connection-informations

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


# 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/
39 40
services = $${rootdirectory:etc}/service/
scripts = $${rootdirectory:etc}/run/
41 42 43 44
run = $${rootdirectory:var}/run/
backup = $${rootdirectory:srv}/backup/
promises = $${rootdirectory:etc}/promise/
application = $${rootdirectory:tmp}/application
Alain Takoudjou's avatar
Alain Takoudjou committed
45
boinc = $${rootdirectory:tmp}/boinc
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

[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
77
local-port = 3306
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
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}

121 122 123 124 125 126 127 128
[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
129
cgid_sock = $${basedirectory:run}/cgid.sock
130 131 132 133 134 135 136 137
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}
138
result_dir = $${rootdirectory:project}/$${slap-parameter:project}/sample_results/
139 140

[environment]
141
PATH = $${rootdirectory:bin}:${subversion:location}/bin:${perl:location}/bin:%(PATH)s
142 143 144 145 146 147

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

148 149
default-conf = false
httpd-conf = $${httpd-conf:output}
150 151 152 153 154
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
155
ip = $${httpd-conf:ip}
156 157
port = $${httpd-conf:port}
url = http://[$${:ip}]:$${:port}/
158
httpd-binary = ${apache:location}/bin/httpd
159 160 161
htdocs = $${rootdirectory:srv}/www/
tmp-dir = $${directory:tmp-php}
php-ini-dir = $${directory:php-ini-dir}
162 163 164 165 166 167

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}
168 169 170
#send environment variable for apache process
environment-section =
  environment
171 172 173 174 175 176 177 178 179 180 181 182 183 184

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
185
project = $${slap-parameter:project}
186
#url-base = http://[$${apache-php:ip}]:$${apache-php:port}/
187
url-base = $${request-frontend:connection-site_url}
Alain Takoudjou's avatar
Alain Takoudjou committed
188 189
fullname = $${slap-parameter:full-name}
copyright = $${slap-parameter:copyright-holder}
190
boinc = ${boinc:location}
Alain Takoudjou's avatar
Alain Takoudjou committed
191
installroot = $${rootdirectory:project}/$${slap-parameter:project}
192
wrapper-dir = $${basedirectory:scripts}
193 194 195 196 197 198 199 200
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
201
python-binary = ${buildout:executable}
202
dash = ${dash:location}/bin/dash
203 204 205

#Apache and php
htpasswd  = ${apache:location}/bin/htpasswd
206
apache-pid = $${httpd-conf:pid_file}
207 208 209 210 211 212 213 214 215 216 217
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}

218 219
#This allow to deploy or to update Boinc application using only slapparameters from
#vifib BOINC instance parameters
220
[boinc-app]
221 222
<= boinc-server
recipe = slapos.cookbook:boinc.app
223 224
#appname and version is require to update any existing application
#otherwise, the recipe would try to install a new one
225 226 227 228 229
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}
230

231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248
# 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
249
log = $${httpd-conf:error_log} $${httpd-conf:access_log}
250 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
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
288 289 290 291 292
[cron-entry-boinc]
<= cron
recipe = slapos.cookbook:cron.d
name = cronjob
frequency = 0,5,10,15,20,25,30,35,40,45,50,55 * * * *
293
command = PATH=$${rootdirectory:bin}:$PATH $${boinc-server:installroot}/bin/start --cron
Alain Takoudjou's avatar
Alain Takoudjou committed
294

295 296 297 298 299 300 301

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


# Publish all instance parameters (url of instance)
[publish-connection-informations]
recipe = slapos.cookbook:publish
312
boinc_admin_page = $${boinc-server:admin_page}
313
boinc_result_url = $${boinc-server:result_page}
314 315 316
boinc_home_page = $${boinc-server:home_page}
boinc_user = $${boinc-server:user}
boinc_passwd = $${boinc-passwd:passwd}
317 318 319 320 321 322 323 324 325 326 327 328


# 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
329
url = $${request-frontend:connection-site_url}/$${slap-parameter:project}
Alain Takoudjou's avatar
Alain Takoudjou committed
330 331
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl
332

333 334 335 336
[content-promise]
recipe = slapos.cookbook:check_page_content
path = $${basedirectory:promises}/content
url = $${request-frontend:connection-site_url}/$${slap-parameter:project}
337
match = $${slap-parameter:full-name}
338 339 340
dash_path = ${dash:location}/bin/dash
curl_path = ${curl:location}/bin/curl

341
[slap-parameter]
Alain Takoudjou's avatar
Alain Takoudjou committed
342 343 344 345
#Default config value for boinc
project = boinc_test
full-name = Boinc Project SAMPLE
copyright-holder = REPLACE WITH COPYRIGHT HOLDER
346 347 348 349 350 351 352 353 354 355 356 357 358
#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}
359
# Default value if no domain is specified
360
domain =