Commit 1e2d3caf authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Use publish_failsafe for slave publishing

Due to various reasons there might be an error while publishing information
about a slave, and such error would end up with stopping the processing of
the partition. This is undesired effect, thus switch to publish_failsafe style
in order to continue processing.
parent b5144c24
...@@ -26,7 +26,7 @@ md5sum = 1ec349747487b45dd6b30bb2aa45acbe ...@@ -26,7 +26,7 @@ md5sum = 1ec349747487b45dd6b30bb2aa45acbe
[profile-master] [profile-master]
filename = instance-master.cfg.in filename = instance-master.cfg.in
md5sum = 50dbd9bd25fbc608b576ac83f4e13b0f md5sum = 4edf417511a7bdb9f95c04640fcca4df
[profile-slave-list] [profile-slave-list]
filename = instance-slave-list.cfg.in filename = instance-slave-list.cfg.in
...@@ -34,7 +34,7 @@ md5sum = aba91817a1b58377597500f676603d23 ...@@ -34,7 +34,7 @@ md5sum = aba91817a1b58377597500f676603d23
[profile-master-publish-slave-information] [profile-master-publish-slave-information]
filename = instance-master-publish-slave-information.cfg.in filename = instance-master-publish-slave-information.cfg.in
md5sum = e03eef8feee481256928a0e9249642c5 md5sum = cba4d995962f7fbeae3f61c9372c4181
[template-caddy-frontend-configuration] [template-caddy-frontend-configuration]
_update_hash_filename_ = templates/Caddyfile.in _update_hash_filename_ = templates/Caddyfile.in
......
...@@ -67,7 +67,8 @@ ...@@ -67,7 +67,8 @@
{% do part_list.append(publish_section_title) %} {% do part_list.append(publish_section_title) %}
[{{ publish_section_title }}] [{{ publish_section_title }}]
<= common-frontend-information <= common-frontend-information
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish_failsafe
-error-status-file = {{ publish_failsafe_error }}/{{ slave_reference }}-error.status
-slave-reference = {{ slave_reference }} -slave-reference = {{ slave_reference }}
{% set log_access_url = slave_information.pop('log-access-urls', None) %} {% set log_access_url = slave_information.pop('log-access-urls', None) %}
{% if log_access_url %} {% if log_access_url %}
......
...@@ -546,6 +546,7 @@ extra-context = ...@@ -546,6 +546,7 @@ extra-context =
section active_slave_instance_dict active-slave-instance section active_slave_instance_dict active-slave-instance
section warning_slave_information warning-slave-information section warning_slave_information warning-slave-information
key slave_kedifa_information request-kedifa:connection-slave-kedifa-information key slave_kedifa_information request-kedifa:connection-slave-kedifa-information
key publish_failsafe_error directory:publish-failsafe-error-var
[monitor-base-url-dict] [monitor-base-url-dict]
kedifa = ${request-kedifa:connection-monitor-base-url} kedifa = ${request-kedifa:connection-monitor-base-url}
...@@ -564,6 +565,8 @@ caucased = ${:srv}/caucased ...@@ -564,6 +565,8 @@ caucased = ${:srv}/caucased
backup-caucased = ${:backup}/caucased backup-caucased = ${:backup}/caucased
# NGINX # NGINX
rejected-var = ${:var}/rejected-nginx rejected-var = ${:var}/rejected-nginx
# slaves
publish-failsafe-error-var = ${:var}/publish-failsafe-error
{% if aikc_enabled %} {% if aikc_enabled %}
[directory] [directory]
...@@ -986,6 +989,19 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg ...@@ -986,6 +989,19 @@ hash-existing-files = ${buildout:directory}/software_release/buildout.cfg
key_len=2048 key_len=2048
)}} )}}
[check-publish-failsafe-error]
recipe = plone.recipe.command
file = ${directory:var}/publish-failsafe-error.check
command = {{ software_parameter_dict['findutils'] }}/bin/find ${directory:publish-failsafe-error-var} -type f -printf "%f\n" > ${:file}
update-command = ${:command}
[publish-failsafe-error-promise]
<= monitor-promise-base
promise = check_file_state
name = publish-failsafe-error.py
config-filename = ${check-publish-failsafe-error:file}
config-state = empty
[buildout] [buildout]
extends = extends =
{{ software_parameter_dict['profile_common'] }} {{ software_parameter_dict['profile_common'] }}
...@@ -993,6 +1009,8 @@ extends = ...@@ -993,6 +1009,8 @@ extends =
parts = parts =
monitor-base monitor-base
publish-slave-information publish-slave-information
check-publish-failsafe-error
publish-failsafe-error-promise
publish-information publish-information
request-kedifa request-kedifa
rejected-slave-promise rejected-slave-promise
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -9,6 +9,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -9,6 +9,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -14,6 +14,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -14,6 +14,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py ...@@ -13,6 +13,7 @@ T-0/etc/plugin/master-key-upload-url-ready-promise.py
T-0/etc/plugin/monitor-bootstrap-status.py T-0/etc/plugin/monitor-bootstrap-status.py
T-0/etc/plugin/monitor-http-frontend.py T-0/etc/plugin/monitor-http-frontend.py
T-0/etc/plugin/monitor-httpd-listening-on-tcp.py T-0/etc/plugin/monitor-httpd-listening-on-tcp.py
T-0/etc/plugin/publish-failsafe-error.py
T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py T-0/etc/plugin/rejected-slave-publish-ip-port-listening.py
T-0/etc/plugin/rejected-slave.py T-0/etc/plugin/rejected-slave.py
T-1/etc/plugin/__init__.py T-1/etc/plugin/__init__.py
......
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