Skip to content

Commit da343c7

Browse files
committed
[CI] Enable virtualenv testing for Debian/Ubuntu
This patch enables testing with a runtime virtualenv on Debian and Ubuntu in CI jobs and without for RHEL derivatives. For upgrade scenarios, where the previous stable branch is checked out and does not yet support automatic venv creation, a temporary workaround is added to create the venv manually in the Zuul playbook. Summary: - New deployments on Debian/Ubuntu now test virtualenv creation logic. - Upgrade jobs set ansible_python_interpreter only if testing a previous release, and a manual venv is created in the playbook as a workaround. - This workaround is only needed until the following patches are merged into all relevant stable branches. The workaround can be removed once these are merged: [1] https://review.opendev.org/c/openstack/kolla-ansible/+/949813 [2] https://review.opendev.org/c/openstack/ansible-collection-kolla/+/950265 Change-Id: I5d4c5d960441025da1fc1b6f197b03476b1be1a9
1 parent b949557 commit da343c7

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

tests/run.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,10 +73,15 @@
7373
become: true
7474
when: ansible_facts.os_family != 'RedHat'
7575

76+
# NOTE(kevko): Can be remove after [1] [2] will be merged in stable branches
77+
#
78+
# [1] https://review.opendev.org/c/openstack/kolla-ansible/+/949812
79+
# [2] https://review.opendev.org/c/openstack/ansible-collection-kolla/+/949767
7680
- name: Create Kolla runtime venv
7781
command:
7882
cmd: "{{ 'python3.12' if ansible_facts.os_family == 'RedHat' else 'python3' }} -m venv {{ kolla_runtime_venv_path }}"
7983
creates: "{{ kolla_runtime_venv_path }}"
84+
when: is_upgrade
8085

8186
- hosts: primary
8287
any_errors_fatal: true

tests/templates/globals-default.j2

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,14 @@
11
---
2+
# Upgrade, virtualenv exist
3+
{% if is_previous_release %}
24
virtualenv: "{{ kolla_runtime_venv_path }}"
35
ansible_python_interpreter: "{{ kolla_runtime_venv_path }}/bin/python"
6+
{% else %}
7+
# New deployment - test virtualenv creation in debian, ubuntu scenarios
8+
{% if base_distro in ["debian", "ubuntu"] %}
9+
virtualenv: "{{ kolla_runtime_venv_path }}"
10+
{% endif %}
11+
{% endif %}
412

513
kolla_base_distro: "{{ base_distro }}"
614
network_interface: "{{ api_interface_name }}"

0 commit comments

Comments
 (0)