From f7badb2b37efcec2862eec0c16cc677badffea1a Mon Sep 17 00:00:00 2001 From: Mark Goddard Date: Tue, 18 Sep 2018 18:57:25 +0100 Subject: [PATCH] Use openstack-hosted development config The Kayobe development configuration has moved to openstack/kayobe-config-dev. It was previously hosted at stackhpc/dev-kayobe-config on Github. This change updates the Zuul configuration and development documentation to use the new location. It also uses a location for the kayobe source code that works when kayobe is not the repository against which the code review is targetted. This allows us to run kayobe jobs for kayobe-config-dev changes. Configuration for the seed VM and seed hypervisor development environments is not yet supported by kayobe-config-dev, so the documentation references a branch in my personal fork on Github. Change-Id: I621324093b8dff0ac52a648539cd91bc12da4862 --- doc/source/development/automated.rst | 21 +++++++++++---------- playbooks/kayobe-overcloud-base/post.yml | 2 +- playbooks/kayobe-overcloud-base/pre.yml | 16 ++++------------ playbooks/kayobe-overcloud-base/run.yml | 5 ++++- playbooks/kayobe-seed-base/post.yml | 2 +- playbooks/kayobe-seed-base/pre.yml | 16 ++++------------ playbooks/kayobe-seed-base/run.yml | 10 ++++++---- zuul.d/jobs.yaml | 2 ++ 8 files changed, 33 insertions(+), 41 deletions(-) diff --git a/doc/source/development/automated.rst b/doc/source/development/automated.rst index 3152ce13f..b3bbf6243 100644 --- a/doc/source/development/automated.rst +++ b/doc/source/development/automated.rst @@ -15,10 +15,11 @@ Overview The kayobe development environment automation tooling is built using simple shell scripts. Some minimal configuration can be applied by setting the environment variables in `dev/config.sh`. Control plane configuration is -typically provided via the `dev-kayobe-config -`_ repository, although it is -also possible to use your own kayobe configuration. This allows us to build a -development environment that is as close to production as possible. +typically provided via the `kayobe-config-dev +`_ repository, +although it is also possible to use your own kayobe configuration. This allows +us to build a development environment that is as close to production as +possible. Environments ============ @@ -46,10 +47,10 @@ Change the current directory to the kayobe repository:: cd kayobe -Clone the ``dev-kayobe-config`` repository to ``config/src/kayobe-config``:: +Clone the ``kayobe-config-dev`` repository to ``config/src/kayobe-config``:: mkdir -p config/src - git clone https://github.com/stackhpc/dev-kayobe-config config/src/kayobe-config + git clone https://git.openstack.org/openstack/kayobe-config-dev.git config/src/kayobe-config Inspect the kayobe configuration and make any changes necessary for your environment. @@ -112,11 +113,11 @@ Change the current directory to the kayobe repository:: cd kayobe -Clone the ``add-seed-and-hv`` branch of the ``dev-kayobe-config`` repository to +Clone the ``add-seed-and-hv`` branch of the ``kayobe-config-dev`` repository to ``config/src/kayobe-config``:: mkdir -p config/src - git clone https://github.com/stackhpc/dev-kayobe-config -b add-seed-and-hv config/src/kayobe-config + git clone https://github.com/markgoddard/dev-kayobe-config -b add-seed-and-hv config/src/kayobe-config Inspect the kayobe configuration and make any changes necessary for your environment. @@ -155,11 +156,11 @@ Change to the ``kayobe`` directory:: cd kayobe -Clone the ``add-seed-and-hv`` branch of the ``dev-kayobe-config`` repository to +Clone the ``add-seed-and-hv`` branch of the ``kayobe-config-dev`` repository to ``config/src/kayobe-config``:: mkdir -p config/src - git clone https://github.com/stackhpc/dev-kayobe-config -b add-seed-and-hv config/src/kayobe-config + git clone https://github.com/markgoddard/dev-kayobe-config -b add-seed-and-hv config/src/kayobe-config Inspect the kayobe configuration and make any changes necessary for your environment. diff --git a/playbooks/kayobe-overcloud-base/post.yml b/playbooks/kayobe-overcloud-base/post.yml index 9970faca7..31dccb283 100644 --- a/playbooks/kayobe-overcloud-base/post.yml +++ b/playbooks/kayobe-overcloud-base/post.yml @@ -4,5 +4,5 @@ - role: kayobe-diagnostics kayobe_diagnostics_phase: "post" kayobe_diagnostics_log_dir: "/tmp/logs" - kayobe_diagnostics_config_dir: "{{ zuul.project.src_dir }}/config/src/kayobe-config" + kayobe_diagnostics_config_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe-config-dev'].src_dir }}" kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}" diff --git a/playbooks/kayobe-overcloud-base/pre.yml b/playbooks/kayobe-overcloud-base/pre.yml index d99e207d9..bed29c078 100644 --- a/playbooks/kayobe-overcloud-base/pre.yml +++ b/playbooks/kayobe-overcloud-base/pre.yml @@ -2,8 +2,10 @@ - hosts: primary vars: logs_dir: "/tmp/logs" - kayobe_src_dir: "{{ zuul.project.src_dir }}" - kayobe_config_src_dir: "{{ kayobe_src_dir }}/config/src/kayobe-config" + kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe'].src_dir }}" + kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe-config-dev'].src_dir }}" + environment: + KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}" roles: - role: kayobe-diagnostics kayobe_diagnostics_phase: "pre" @@ -39,16 +41,6 @@ mode: 0644 remote_src: true - - name: Ensure kayobe-config directory exists - file: - path: "{{ kayobe_config_src_dir }}" - state: directory - - - name: Ensure kayobe-config repository is cloned - git: - repo: https://github.com/stackhpc/dev-kayobe-config - dest: "{{ kayobe_config_src_dir }}" - # NOTE(mgoddard): Use the name zz-overrides.yml to ensure this takes # precedence over the standard config files. - name: Ensure kayobe-config override config file exists diff --git a/playbooks/kayobe-overcloud-base/run.yml b/playbooks/kayobe-overcloud-base/run.yml index a5f1a442f..8752409ea 100644 --- a/playbooks/kayobe-overcloud-base/run.yml +++ b/playbooks/kayobe-overcloud-base/run.yml @@ -1,8 +1,11 @@ --- - hosts: primary vars: - kayobe_src_dir: "{{ zuul.project.src_dir }}" + kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe'].src_dir }}" + kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe-config-dev'].src_dir }}" logs_dir: "/tmp/logs" + environment: + KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}" tasks: - name: Ensure overcloud is deployed shell: diff --git a/playbooks/kayobe-seed-base/post.yml b/playbooks/kayobe-seed-base/post.yml index 9970faca7..31dccb283 100644 --- a/playbooks/kayobe-seed-base/post.yml +++ b/playbooks/kayobe-seed-base/post.yml @@ -4,5 +4,5 @@ - role: kayobe-diagnostics kayobe_diagnostics_phase: "post" kayobe_diagnostics_log_dir: "/tmp/logs" - kayobe_diagnostics_config_dir: "{{ zuul.project.src_dir }}/config/src/kayobe-config" + kayobe_diagnostics_config_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe-config-dev'].src_dir }}" kayobe_diagnostics_executor_log_dir: "{{ zuul.executor.log_root }}/{{ inventory_hostname }}" diff --git a/playbooks/kayobe-seed-base/pre.yml b/playbooks/kayobe-seed-base/pre.yml index 2303d2490..e7a6d3dd8 100644 --- a/playbooks/kayobe-seed-base/pre.yml +++ b/playbooks/kayobe-seed-base/pre.yml @@ -2,8 +2,10 @@ - hosts: primary vars: logs_dir: "/tmp/logs" - kayobe_src_dir: "{{ zuul.project.src_dir }}" - kayobe_config_src_dir: "{{ kayobe_src_dir }}/config/src/kayobe-config" + kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe'].src_dir }}" + kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe-config-dev'].src_dir }}" + environment: + KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}" roles: - role: kayobe-diagnostics kayobe_diagnostics_phase: "pre" @@ -39,16 +41,6 @@ mode: 0644 remote_src: true - - name: Ensure kayobe-config directory exists - file: - path: "{{ kayobe_config_src_dir }}" - state: directory - - - name: Ensure kayobe-config repository is cloned - git: - repo: https://github.com/stackhpc/dev-kayobe-config - dest: "{{ kayobe_config_src_dir }}" - # NOTE(mgoddard): Use the name zz-overrides.yml to ensure this takes # precedence over the standard config files. - name: Ensure kayobe-config override config file exists diff --git a/playbooks/kayobe-seed-base/run.yml b/playbooks/kayobe-seed-base/run.yml index 99b6851f2..3693b6dfc 100644 --- a/playbooks/kayobe-seed-base/run.yml +++ b/playbooks/kayobe-seed-base/run.yml @@ -1,13 +1,15 @@ --- - hosts: primary vars: - kayobe_src_dir: "{{ zuul.project.src_dir }}" + kayobe_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe'].src_dir }}" + kayobe_config_src_dir: "{{ ansible_env.PWD ~ '/' ~ zuul.projects['git.openstack.org/openstack/kayobe-config-dev'].src_dir }}" logs_dir: "/tmp/logs" + environment: + KAYOBE_CONFIG_SOURCE_PATH: "{{ kayobe_config_src_dir }}" + # Don't provision a seed VM - use the Zuul VM as the seed host. + KAYOBE_SEED_VM_PROVISION: 0 tasks: - name: Ensure seed is deployed shell: cmd: dev/seed-deploy.sh > {{ logs_dir }}/ansible/seed-deploy chdir: "{{ kayobe_src_dir }}" - environment: - # Don't provision a seed VM - use the Zuul VM as the seed host. - KAYOBE_SEED_VM_PROVISION: 0 diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index e39af27f6..6fe0e84e9 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -40,6 +40,7 @@ attempts: 1 timeout: 5400 required-projects: + - name: openstack/kayobe-config-dev - name: openstack/kolla override-checkout: stable/queens - name: openstack/kolla-ansible @@ -67,6 +68,7 @@ attempts: 1 timeout: 5400 required-projects: + - name: openstack/kayobe-config-dev - name: openstack/kolla override-checkout: stable/queens - name: openstack/kolla-ansible