From e4c7b50320a056a61895debaaa2412a4c69cded7 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Fri, 8 Dec 2017 17:12:25 +0100 Subject: [PATCH] dev mode: Add support for kuryr Provide support for kolla dev mode in Kuryr. When 'kolla_dev_mode' or 'kuryr_dev_mode' variables are enabled, source code of Kuryr project is cloned and bindmounted. Partially implements: blueprint mount-sources Change-Id: I74c1ea70b4220a0e91f19403971303ca55652371 --- ansible/roles/kuryr/defaults/main.yml | 12 ++++++++++++ ansible/roles/kuryr/tasks/clone.yml | 12 ++++++++++++ ansible/roles/kuryr/tasks/deploy.yml | 4 ++++ 3 files changed, 28 insertions(+) create mode 100644 ansible/roles/kuryr/tasks/clone.yml diff --git a/ansible/roles/kuryr/defaults/main.yml b/ansible/roles/kuryr/defaults/main.yml index 25a2672b32..6cb7529ed9 100644 --- a/ansible/roles/kuryr/defaults/main.yml +++ b/ansible/roles/kuryr/defaults/main.yml @@ -1,5 +1,6 @@ --- project_name: "kuryr" +libnetwork_project_name: "kuryr-libnetwork" # NOTE(huikang, apuimedo): when you request a driver in a docker operation, such # as docker network create, docker searches /usr/lib/docker or /etc/docker @@ -22,6 +23,8 @@ kuryr_services: - "/lib/modules:/lib/modules:ro" - "/run:/run:shared" - "/usr/lib/docker:/usr/lib/docker" + - "{{ kolla_dev_repos_directory ~ '/kuryr/kuryr:/var/lib/kolla/venv/lib/python2.7/site-packages/kuryr' if kuryr_dev_mode | bool else '' }}" + - "{{ kolla_dev_repos_directory ~ '/kuryr-libnetwork/kuryr_libnetwork:/var/lib/kolla/venv/lib/python2.7/site-packages/kuryr_libnetwork' if kuryr_dev_mode | bool else '' }}" - "kolla_logs:/var/log/kolla/" @@ -41,3 +44,12 @@ kuryr_logging_debug: "{{ openstack_logging_debug }}" kuryr_keystone_user: "kuryr" openstack_kuryr_auth: "{{ openstack_auth }}" + + +#################### +# Kolla +#################### +kuryr_git_repository: "{{ kolla_dev_repos_git }}/{{ project_name }}" +kuryr_libnetwork_git_repository: "{{ kolla_dev_repos_git }}/{{ libnetwork_project_name }}" +kuryr_dev_repos_pull: "{{ kolla_dev_repos_pull }}" +kuryr_dev_mode: "{{ kolla_dev_mode }}" diff --git a/ansible/roles/kuryr/tasks/clone.yml b/ansible/roles/kuryr/tasks/clone.yml new file mode 100644 index 0000000000..32a1db9117 --- /dev/null +++ b/ansible/roles/kuryr/tasks/clone.yml @@ -0,0 +1,12 @@ +--- +- name: Cloning kuryr source repository for development + git: + repo: "{{ kuryr_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ project_name }}" + update: "{{ kuryr_dev_repos_pull }}" + +- name: Cloning kuryr-libnetwork source repository for development + git: + repo: "{{ kuryr_libnetwork_git_repository }}" + dest: "{{ kolla_dev_repos_directory }}/{{ libnetwork_project_name }}" + update: "{{ kuryr_dev_repos_pull }}" diff --git a/ansible/roles/kuryr/tasks/deploy.yml b/ansible/roles/kuryr/tasks/deploy.yml index 6b896c6e55..b1b0eebace 100644 --- a/ansible/roles/kuryr/tasks/deploy.yml +++ b/ansible/roles/kuryr/tasks/deploy.yml @@ -3,5 +3,9 @@ - include: config.yml +- include: clone.yml + when: + - kuryr_dev_mode | bool + - name: Flush handlers meta: flush_handlers