From aef84c86460abfe9dcd1874ce978b1a09056f4f6 Mon Sep 17 00:00:00 2001 From: Leonardo Fagundes Luz Serrano Date: Mon, 22 Jul 2024 16:35:15 -0300 Subject: [PATCH] Zuul/Tox: Install custom python3-keystoneauth1 Some packages available upstream have custom versions in STX repos. Tests need to be against these custom dependencies. In this case, distcloud repo requires python3-keystoneauth1. This commit adds logic for installing the latest available STX build of test dependencies. Test Plan: pass - Install bindep deps and requirements, then run the ansible playbook to install STX deps tools/gate/playbooks/install-stx-custom-deps.yaml tox -epy39 -c distributedcloud/tox.ini Closes-Bug: 2073917 Change-Id: I1c025de9699ca3b388b81a5d77e2c0cd46ce9d7a Signed-off-by: Leonardo Fagundes Luz Serrano --- .gitignore | 6 ++++++ .yamllint | 4 ++++ .zuul.yaml | 1 + tools/gate/playbooks/install-postgresql.yaml | 2 +- tools/gate/playbooks/install-stx-custom-deps.yaml | 5 +++++ .../roles/install-stx-custom-deps/tasks/main.yaml | 13 +++++++++++++ .../roles/install-stx-custom-deps/vars/main.yaml | 7 +++++++ 7 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 .yamllint create mode 100644 tools/gate/playbooks/install-stx-custom-deps.yaml create mode 100644 tools/gate/roles/install-stx-custom-deps/tasks/main.yaml create mode 100644 tools/gate/roles/install-stx-custom-deps/vars/main.yaml diff --git a/.gitignore b/.gitignore index c6d84a374..9f1571387 100644 --- a/.gitignore +++ b/.gitignore @@ -31,6 +31,11 @@ nosetests.xml .testrepository .venv +# Unit test temp files +# Reference: distributedcloud/dcmanager/common/utils.py -> syncronized() +distributedcloud/DCManager-* +distributedcloud/*fake_file.yml + # Translations *.mo @@ -60,4 +65,5 @@ ChangeLog *~ .*.swp .*sw? +.vscode diff --git a/.yamllint b/.yamllint new file mode 100644 index 000000000..9d785ba6a --- /dev/null +++ b/.yamllint @@ -0,0 +1,4 @@ +rules: + line-length: + allow-non-breakable-words: true + allow-non-breakable-inline-mappings: true diff --git a/.zuul.yaml b/.zuul.yaml index 9e266cc8d..979fb10d5 100644 --- a/.zuul.yaml +++ b/.zuul.yaml @@ -30,6 +30,7 @@ nodeset: debian-bullseye pre-run: - tools/gate/playbooks/install-postgresql.yaml + - tools/gate/playbooks/install-stx-custom-deps.yaml required-projects: - starlingx/fault - starlingx/nfv diff --git a/tools/gate/playbooks/install-postgresql.yaml b/tools/gate/playbooks/install-postgresql.yaml index 194dffe10..431bd8323 100644 --- a/tools/gate/playbooks/install-postgresql.yaml +++ b/tools/gate/playbooks/install-postgresql.yaml @@ -1,5 +1,5 @@ --- -- hosts: all +- hosts: "{{ target_hosts | default('all') }}" gather_facts: false roles: - install-postgresql diff --git a/tools/gate/playbooks/install-stx-custom-deps.yaml b/tools/gate/playbooks/install-stx-custom-deps.yaml new file mode 100644 index 000000000..43d10220e --- /dev/null +++ b/tools/gate/playbooks/install-stx-custom-deps.yaml @@ -0,0 +1,5 @@ +--- +- hosts: "{{ target_hosts | default('all') }}" + gather_facts: false + roles: + - install-stx-custom-deps diff --git a/tools/gate/roles/install-stx-custom-deps/tasks/main.yaml b/tools/gate/roles/install-stx-custom-deps/tasks/main.yaml new file mode 100644 index 000000000..c7e850204 --- /dev/null +++ b/tools/gate/roles/install-stx-custom-deps/tasks/main.yaml @@ -0,0 +1,13 @@ +--- +- name: Add STX master repo + apt_repository: + filename: "{{ stx_master_tag }}" + repo: "deb [trusted=yes] {{ stx_master_repo }} /" + become: true + +- name: Install dependencies from STX master package repo + package: + name: "{{ item }}" + state: present + become: true + with_items: "{{ stx_master_deps }}" diff --git a/tools/gate/roles/install-stx-custom-deps/vars/main.yaml b/tools/gate/roles/install-stx-custom-deps/vars/main.yaml new file mode 100644 index 000000000..4b9bda1f7 --- /dev/null +++ b/tools/gate/roles/install-stx-custom-deps/vars/main.yaml @@ -0,0 +1,7 @@ +--- +stx_master_repo: "https://mirror.starlingx.windriver.com/mirror/starlingx/master/debian/monolithic/latest_build/outputs/std/packages" + +stx_master_tag: stxmaster + +stx_master_deps: + - python3-keystoneauth1