Merge "Use Docker healthchecks for mistral services"

This commit is contained in:
Zuul 2021-09-08 16:07:51 +00:00 committed by Gerrit Code Review
commit 44c7b166cf
4 changed files with 67 additions and 1 deletions

View File

@ -9,6 +9,7 @@ mistral_services:
image: "{{ mistral_api_image_full }}" image: "{{ mistral_api_image_full }}"
volumes: "{{ mistral_api_default_volumes + mistral_api_extra_volumes }}" volumes: "{{ mistral_api_default_volumes + mistral_api_extra_volumes }}"
dimensions: "{{ mistral_api_dimensions }}" dimensions: "{{ mistral_api_dimensions }}"
healthcheck: "{{ mistral_api_healthcheck }}"
haproxy: haproxy:
mistral_api: mistral_api:
enabled: "{{ enable_mistral }}" enabled: "{{ enable_mistral }}"
@ -27,6 +28,7 @@ mistral_services:
image: "{{ mistral_engine_image_full }}" image: "{{ mistral_engine_image_full }}"
volumes: "{{ mistral_engine_default_volumes + mistral_engine_extra_volumes }}" volumes: "{{ mistral_engine_default_volumes + mistral_engine_extra_volumes }}"
dimensions: "{{ mistral_engine_dimensions }}" dimensions: "{{ mistral_engine_dimensions }}"
healthcheck: "{{ mistral_engine_healthcheck }}"
mistral-event-engine: mistral-event-engine:
container_name: mistral_event_engine container_name: mistral_event_engine
group: mistral-event-engine group: mistral-event-engine
@ -34,6 +36,7 @@ mistral_services:
image: "{{ mistral_event_engine_image_full }}" image: "{{ mistral_event_engine_image_full }}"
volumes: "{{ mistral_event_engine_default_volumes + mistral_event_engine_extra_volumes }}" volumes: "{{ mistral_event_engine_default_volumes + mistral_event_engine_extra_volumes }}"
dimensions: "{{ mistral_event_engine_dimensions }}" dimensions: "{{ mistral_event_engine_dimensions }}"
healthcheck: "{{ mistral_event_engine_healthcheck }}"
mistral-executor: mistral-executor:
container_name: mistral_executor container_name: mistral_executor
group: mistral-executor group: mistral-executor
@ -41,6 +44,7 @@ mistral_services:
image: "{{ mistral_executor_image_full }}" image: "{{ mistral_executor_image_full }}"
volumes: "{{ mistral_executor_default_volumes + mistral_executor_extra_volumes }}" volumes: "{{ mistral_executor_default_volumes + mistral_executor_extra_volumes }}"
dimensions: "{{ mistral_executor_dimensions }}" dimensions: "{{ mistral_executor_dimensions }}"
healthcheck: "{{ mistral_executor_healthcheck }}"
#################### ####################
@ -78,6 +82,58 @@ mistral_event_engine_dimensions: "{{ default_container_dimensions }}"
mistral_executor_dimensions: "{{ default_container_dimensions }}" mistral_executor_dimensions: "{{ default_container_dimensions }}"
mistral_api_dimensions: "{{ default_container_dimensions }}" mistral_api_dimensions: "{{ default_container_dimensions }}"
mistral_api_enable_healthchecks: "{{ enable_container_healthchecks }}"
mistral_api_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
mistral_api_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
mistral_api_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
mistral_api_healthcheck_test: ["CMD-SHELL", "healthcheck_curl http://{{ api_interface_address | put_address_in_context('url') }}:{{ mistral_api_port }}"]
mistral_api_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
mistral_api_healthcheck:
interval: "{{ mistral_api_healthcheck_interval }}"
retries: "{{ mistral_api_healthcheck_retries }}"
start_period: "{{ mistral_api_healthcheck_start_period }}"
test: "{% if mistral_api_enable_healthchecks | bool %}{{ mistral_api_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ mistral_api_healthcheck_timeout }}"
mistral_engine_enable_healthchecks: "{{ enable_container_healthchecks }}"
mistral_engine_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
mistral_engine_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
mistral_engine_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
mistral_engine_healthcheck_test: ["CMD-SHELL", "healthcheck_port mistral-server {{ om_rpc_port }}"]
mistral_engine_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
mistral_engine_healthcheck:
interval: "{{ mistral_engine_healthcheck_interval }}"
retries: "{{ mistral_engine_healthcheck_retries }}"
start_period: "{{ mistral_engine_healthcheck_start_period }}"
test: "{% if mistral_engine_enable_healthchecks | bool %}{{ mistral_engine_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ mistral_engine_healthcheck_timeout }}"
mistral_event_engine_enable_healthchecks: "{{ enable_container_healthchecks }}"
mistral_event_engine_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
mistral_event_engine_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
mistral_event_engine_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
mistral_event_engine_healthcheck_test: ["CMD-SHELL", "healthcheck_port mistral-server {{ om_rpc_port }}"]
mistral_event_engine_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
mistral_event_engine_healthcheck:
interval: "{{ mistral_event_engine_healthcheck_interval }}"
retries: "{{ mistral_event_engine_healthcheck_retries }}"
start_period: "{{ mistral_event_engine_healthcheck_start_period }}"
test: "{% if mistral_event_engine_enable_healthchecks | bool %}{{ mistral_event_engine_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ mistral_event_engine_healthcheck_timeout }}"
mistral_executor_enable_healthchecks: "{{ enable_container_healthchecks }}"
mistral_executor_healthcheck_interval: "{{ default_container_healthcheck_interval }}"
mistral_executor_healthcheck_retries: "{{ default_container_healthcheck_retries }}"
mistral_executor_healthcheck_start_period: "{{ default_container_healthcheck_start_period }}"
mistral_executor_healthcheck_test: ["CMD-SHELL", "healthcheck_port mistral-server {{ om_rpc_port }}"]
mistral_executor_healthcheck_timeout: "{{ default_container_healthcheck_timeout }}"
mistral_executor_healthcheck:
interval: "{{ mistral_executor_healthcheck_interval }}"
retries: "{{ mistral_executor_healthcheck_retries }}"
start_period: "{{ mistral_executor_healthcheck_start_period }}"
test: "{% if mistral_executor_enable_healthchecks | bool %}{{ mistral_executor_healthcheck_test }}{% else %}NONE{% endif %}"
timeout: "{{ mistral_executor_healthcheck_timeout }}"
mistral_engine_default_volumes: mistral_engine_default_volumes:
- "{{ node_config_directory }}/mistral-engine/:{{ container_config_directory }}/:ro" - "{{ node_config_directory }}/mistral-engine/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro" - "/etc/localtime:/etc/localtime:ro"

View File

@ -11,6 +11,7 @@
image: "{{ service.image }}" image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when:
- kolla_action != "config" - kolla_action != "config"
@ -26,6 +27,7 @@
image: "{{ service.image }}" image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when:
- kolla_action != "config" - kolla_action != "config"
@ -40,6 +42,7 @@
name: "{{ service.container_name }}" name: "{{ service.container_name }}"
image: "{{ service.image }}" image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
when: when:
- kolla_action != "config" - kolla_action != "config"
@ -56,5 +59,6 @@
image: "{{ service.image }}" image: "{{ service.image }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}" volumes: "{{ service.volumes|reject('equalto', '')|list }}"
dimensions: "{{ service.dimensions }}" dimensions: "{{ service.dimensions }}"
healthcheck: "{{ service.healthcheck | default(omit) }}"
when: when:
- kolla_action != "config" - kolla_action != "config"

View File

@ -8,7 +8,7 @@
image: "{{ item.value.image }}" image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}" volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
dimensions: "{{ item.value.dimensions }}" dimensions: "{{ item.value.dimensions }}"
healthcheck: "{{ item.value.healthcheck | default(omit) }}"
when: when:
- inventory_hostname in groups[item.value.group] - inventory_hostname in groups[item.value.group]
- item.value.enabled | bool - item.value.enabled | bool

View File

@ -0,0 +1,6 @@
---
features:
- |
Implements container healthchecks for mistral services.
See `blueprint
<https://blueprints.launchpad.net/kolla-ansible/+spec/container-health-check>`__