From e178f95290b2bf2bd2c2f604c49845326c869af1 Mon Sep 17 00:00:00 2001 From: Jakob Meng Date: Mon, 17 Oct 2022 10:36:23 +0200 Subject: [PATCH] Choose version of Ansible OpenStack collection based on RDO release Starting with RDO Zed, openstacksdk has been bumped to >=0.99.0 which broke backward compatibility with previous releases. This required a refactoring of most most modules in Ansible OpenStack collection 2.0.0, which thus also broke backward compatibilty with earlier releases of the 1.x.x collection series. Now, quickstart.sh must choose collection version depending on the openstacksdk release which gets installed by the RDO release. Since quickstart.sh, TripleO CI and RDO releases are tightly coupled we have to implement this version chooser in three steps: 1. Implement version chooser in quickstart.sh and install the collection as well as openstacksdk from a temporary yum repository created by Alfredo. 2. Bump the collection and openstacksdk in RDO release and wait for component lines and integration line promotions. 3. Remove Alfredo's temporary yum repository from quickstart.sh This patch accomplishes the first step, introducing the version chooser logic and introducing Alfredo's temporary yum repository with a preview RPM of ansible-collections-openstack 2.0.0 and python3-openstacksdk 0.101.0. Co-Authored-By: Alfredo Moralejo Change-Id: Ic7660a85079688be206b8fb63f76add333ba68f2 --- ansible-collection-requirements.yml | 8 +++---- config/release/tripleo-ci/CentOS-9/master.yml | 4 +++- .../promotion-testing-hash-master.yml | 4 +++- .../CentOS-9/promotion-testing-hash-zed.yml | 4 +++- config/release/tripleo-ci/CentOS-9/zed.yml | 4 +++- quickstart.sh | 24 +++++++++++++++++++ 6 files changed, 40 insertions(+), 8 deletions(-) diff --git a/ansible-collection-requirements.yml b/ansible-collection-requirements.yml index 577d4d6cc..a7281a308 100644 --- a/ansible-collection-requirements.yml +++ b/ansible-collection-requirements.yml @@ -10,6 +10,10 @@ collections: # and otherwise will fail with "Non integer values in LooseVersion" [2]. # [1] https://semver.org/ # [2] https://bugzilla.redhat.com/show_bug.cgi?id=2109807 + # + # FIXME(jmeng): Collection openstack.cloud aka git+https://opendev.org/openstack/ + # ansible-collections-openstack is installed with quickstart.sh because the + # version to be installed depends on the RDO release. - name: ansible.utils source: https://galaxy.ansible.com version: 2.4.2 @@ -34,10 +38,6 @@ collections: - name: openstack.config_template source: git+https://opendev.org/openstack/ansible-config_template.git type: git - - name: openstack.cloud - source: git+https://opendev.org/openstack/ansible-collections-openstack - type: git - version: 1.8.0 - name: tripleo.operator source: git+https://opendev.org/openstack/tripleo-operator-ansible/ type: git diff --git a/config/release/tripleo-ci/CentOS-9/master.yml b/config/release/tripleo-ci/CentOS-9/master.yml index 6589d168b..9f300b9a0 100644 --- a/config/release/tripleo-ci/CentOS-9/master.yml +++ b/config/release/tripleo-ci/CentOS-9/master.yml @@ -159,7 +159,9 @@ repos: - type: file filename: delorean-master-deps.repo - down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/delorean-deps.repo" + # FIXME(jmeng): Remove aoc-temp repository once prerelease of ansible-collections-openstack 2.0.0 has been promoted + #down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/delorean-deps.repo" + down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/aoc-temp/delorean-deps.repo" # CentOS related repos - type: generic diff --git a/config/release/tripleo-ci/CentOS-9/promotion-testing-hash-master.yml b/config/release/tripleo-ci/CentOS-9/promotion-testing-hash-master.yml index 48c515eb6..ac95e0050 100644 --- a/config/release/tripleo-ci/CentOS-9/promotion-testing-hash-master.yml +++ b/config/release/tripleo-ci/CentOS-9/promotion-testing-hash-master.yml @@ -129,7 +129,9 @@ repos: - type: file filename: delorean-master-deps.repo - down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/delorean-deps.repo" + # FIXME(jmeng): Remove aoc-temp repository once prerelease of ansible-collections-openstack 2.0.0 has been promoted + #down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/delorean-deps.repo" + down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/aoc-temp/delorean-deps.repo" # CentOS related repos - type: generic diff --git a/config/release/tripleo-ci/CentOS-9/promotion-testing-hash-zed.yml b/config/release/tripleo-ci/CentOS-9/promotion-testing-hash-zed.yml index cc9ae770e..4529f0d7f 100644 --- a/config/release/tripleo-ci/CentOS-9/promotion-testing-hash-zed.yml +++ b/config/release/tripleo-ci/CentOS-9/promotion-testing-hash-zed.yml @@ -128,7 +128,9 @@ repos: - type: file filename: delorean-zed-deps.repo - down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/delorean-deps.repo" + # FIXME(jmeng): Remove aoc-temp repository once prerelease of ansible-collections-openstack 2.0.0 has been promoted + #down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/delorean-deps.repo" + down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/aoc-temp/delorean-deps.repo" # CentOS related repos - type: generic diff --git a/config/release/tripleo-ci/CentOS-9/zed.yml b/config/release/tripleo-ci/CentOS-9/zed.yml index 1da0f93c8..abe61d238 100644 --- a/config/release/tripleo-ci/CentOS-9/zed.yml +++ b/config/release/tripleo-ci/CentOS-9/zed.yml @@ -158,7 +158,9 @@ repos: - type: file filename: delorean-zed-deps.repo - down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/delorean-deps.repo" + # FIXME(jmeng): Remove aoc-temp repository once prerelease of ansible-collections-openstack 2.0.0 has been promoted + #down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/delorean-deps.repo" + down_url: "${NODEPOOL_RDO_PROXY}/{{ distro_ver }}-{{ release }}/aoc-temp/delorean-deps.repo" # CentOS related repos - type: generic diff --git a/quickstart.sh b/quickstart.sh index 95070a86e..36296a6ca 100755 --- a/quickstart.sh +++ b/quickstart.sh @@ -133,6 +133,30 @@ install_ansible_collections_deps(){ -r ansible-collection-requirements.yml \ -p $VIRTUAL_ENV/share/ansible/collections + # Install openstack.cloud release depending on the RDO release if is not installed + # + # Some jobs run quickstart.sh several times, so ansible-galaxy might get called twice or more. + # On such subsequent runs, ansible-galaxy will find the collections to be installed already and + # will use the optional version part of the SCM pointer to compare it against existing + # collections. This comparison will fail with "Non integer values in LooseVersion" [2] if the + # version in the SCM pointer is not a valid semantic version [1]. + # Both a branch name and a commit hash are not valid semantic versions and thus we can only run + # ansible-galaxy on the first run aka if openstack.cloud has not been installed yet. + # [1] https://semver.org/ + # [2] https://bugzilla.redhat.com/show_bug.cgi?id=2109807 + if [[ ! -d $VIRTUAL_ENV/share/ansible/collections/ansible_collections/openstack/cloud ]]; then + if [[ $QUICKSTART_RELEASE =~ .*(train|victoria|wallaby).* ]]; then + retry 10 ansible-galaxy collection install -vvv --force \ + git+https://opendev.org/openstack/ansible-collections-openstack,stable/1.0.0 \ + -p $VIRTUAL_ENV/share/ansible/collections + else + # FIXME(jmeng): Replace commit hash with 'master' once Ansible OpenStack collection 2.0.0 has been released + retry 10 ansible-galaxy collection install -vvv --force \ + git+https://opendev.org/openstack/ansible-collections-openstack,ed36d82a0c60a841d2f30c61a50d60531481b2cc \ + -p $VIRTUAL_ENV/share/ansible/collections + fi + fi + # Use collections already cloned by CI if they're available OS_COLLECTIONS="ansible-config_template ansible-collections-openstack \ tripleo-operator-ansible"