dev mode: Add support for mistral

Provide support for kolla dev mode in mistral. When
'kolla_dev_mode' or 'mistral_dev_mode' variables are
enabled, source code of mistral project is cloned
and bind mounted.

Partially implements: blueprint mount-sources
Co-Authored-By: chenqiaomin <chen.qiaomin@99cloud.net>

Change-Id: I6e5f9b1a6b35dbb672905987e715cae4bf10af7f
This commit is contained in:
caoyuan 2018-04-13 00:47:35 +08:00
parent 905de55cda
commit c3c7b4827e
6 changed files with 24 additions and 5 deletions

View File

@ -11,6 +11,7 @@ mistral_services:
- "{{ node_config_directory }}/mistral-api/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/mistral/mistral:/var/lib/kolla/venv/lib/python2.7/site-packages/mistral' if mistral_dev_mode | bool else '' }}"
mistral-engine:
container_name: mistral_engine
group: mistral-engine
@ -20,6 +21,7 @@ mistral_services:
- "{{ node_config_directory }}/mistral-engine/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/mistral/mistral:/var/lib/kolla/venv/lib/python2.7/site-packages/mistral' if mistral_dev_mode | bool else '' }}"
mistral-executor:
container_name: mistral_executor
group: mistral-executor
@ -29,6 +31,7 @@ mistral_services:
- "{{ node_config_directory }}/mistral-executor/:{{ container_config_directory }}/:ro"
- "/etc/localtime:/etc/localtime:ro"
- "kolla_logs:/var/log/kolla/"
- "{{ kolla_dev_repos_directory ~ '/mistral/mistral:/var/lib/kolla/venv/lib/python2.7/site-packages/mistral' if mistral_dev_mode | bool else '' }}"
####################
@ -70,3 +73,10 @@ mistral_logging_debug: "{{ openstack_logging_debug }}"
mistral_keystone_user: "mistral"
openstack_mistral_auth: "{{ openstack_auth }}"
####################
# Kolla
####################
mistral_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}"
mistral_dev_repos_pull: "{{ kolla_dev_repos_pull }}"
mistral_dev_mode: "{{ kolla_dev_mode }}"

View File

@ -12,7 +12,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -35,7 +35,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]
@ -58,7 +58,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ service.container_name }}"
image: "{{ service.image }}"
volumes: "{{ service.volumes }}"
volumes: "{{ service.volumes|reject('equalto', '')|list }}"
when:
- kolla_action != "config"
- inventory_hostname in groups[service.group]

View File

@ -14,6 +14,6 @@
BOOTSTRAP:
name: "bootstrap_mistral"
restart_policy: "never"
volumes: "{{ mistral_api.volumes }}"
volumes: "{{ mistral_api.volumes|reject('equalto', '')|list }}"
run_once: True
delegate_to: "{{ groups[mistral_api.group][0] }}"

View File

@ -0,0 +1,6 @@
---
- name: Cloning mistral source repository for development
git:
repo: "{{ mistral_git_repository }}"
dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}"
update: "{{ mistral_dev_repos_pull }}"

View File

@ -83,7 +83,7 @@
common_options: "{{ docker_common_options }}"
name: "{{ item.value.container_name }}"
image: "{{ item.value.image }}"
volumes: "{{ item.value.volumes }}"
volumes: "{{ item.value.volumes|reject('equalto', '')|list }}"
register: check_mistral_containers
when:
- kolla_action != "config"

View File

@ -7,6 +7,9 @@
inventory_hostname in groups['mistral-engine'] or
inventory_hostname in groups['mistral-executor']
- include: clone.yml
when: mistral_dev_mode | bool
- include: bootstrap.yml
when: inventory_hostname in groups['mistral-api']