Commit 8fe8ac61 authored by Jérome Perrin's avatar Jérome Perrin

stack/monitor: run monitor-globalstate once from buildout

monitor-globalstate (which is supposed to create monitor configuration file
accessed by HTTP as .../public//monitor.global.json) runs by cron every 2
minutes. This crontab also uses randomsleep to add a delay - but there's a
promise waiting for this monitor configuration file to be available, so the
instanciation had to wait for this and if this was sometimes causing problems
in software release tests because promise did not succeed fast enough.

To prevent this pattern where slapos node instance has to wait for a crontab
to be executed, we run that script a first time from buildout.
parent 3e8439b3
......@@ -14,7 +14,7 @@
# not need these here).
[monitor2-template]
filename = instance-monitor.cfg.jinja2.in
md5sum = 84bc2cf29e34b48c51116d93e2be7636
md5sum = 200bb126dbfc33e5c5c165ae17bab64b
[monitor-httpd-conf]
_update_hash_filename_ = templates/monitor-httpd.conf.in
......
......@@ -252,6 +252,11 @@ name = monitor-globalstate
frequency = */2 * * * *
command = {{ bin_directory }}/randomsleep 20 && ${monitor-globalstate-wrapper:wrapper-path}
[monitor-globalstate-first-run]
recipe = plone.recipe.command
command = ${monitor-globalstate-wrapper:wrapper-path}
stop-on-error = true
[monitor-configurator-cron-entry]
recipe = slapos.cookbook:cron.d
cron-entries = ${cron:cron-entries}
......@@ -388,6 +393,7 @@ update-command =
base-url = ${monitor-conf-parameters:base-url}
depends =
${monitor-globalstate-cron-entry:name}
${monitor-globalstate-first-run:recipe}
${monitor-configurator-cron-entry:name}
${monitor-collect-cron-entry:name}
${cron-entry-logrotate:name}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment