Skip to content

Commit c4f6ca1

Browse files
committed
CI: fix kolla-ansible installation after cryptography 3.4 release
Installing kolla-ansible system-wide on CentOS 8 fails with: ModuleNotFoundError: No module named 'setuptools_rust' This error appeared following the release of cryptography 3.4, which now includes Rust code. It can be installed without Rust using a Python wheel, but only with more recent pip than version 9.0.3 available as RPM on CentOS 8. The cryptography bug report [1] recommends pip>=19.1.1. This change switches to using pip --user when installing kolla-ansible. Also fixes an issue with ansible-lint which was failing on etc/kolla/globals.yml due to a missing space before comments. This Victoria backport also includes I47473de6f71c422db2238d653c2d8f379c55e79b, which fixes a similar issue with ceph-ansible. (cherry picked from commit 5fc7707) This Victoria backport also includes I4c65a428facdf6d4ce28d97a868589aeae4c856e, which drops lower-constraints testing. Per our PTG resolution [2] and general OpenStack resolution [3], lower-constraints are not worth the extra work and confusion they introduce. This patch drops them along with all mentions. (cherry picked from commit 604d85b) [1] pyca/cryptography#5753 [2] http://lists.openstack.org/pipermail/openstack-discuss/2020-October/018445.html [3] http://lists.openstack.org/pipermail/openstack-discuss/2020-December/019521.html Change-Id: Ifaf1948ed5d42eebaa62d7bad375bbfc12b134d5 (cherry picked from commit 3dd6834) Closes-Bug: #1915141
1 parent 4f69885 commit c4f6ca1

File tree

7 files changed

+21
-100
lines changed

7 files changed

+21
-100
lines changed

lower-constraints.txt

Lines changed: 0 additions & 87 deletions
This file was deleted.

tests/deploy-ceph-ansible.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export PYTHONUNBUFFERED=1
99
function setup_ceph_ansible {
1010
# Prepare virtualenv for ceph-ansible deployment
1111
python3 -m venv --system-site-packages ~/ceph-venv
12+
# NOTE(mgoddard): We need a recent pip to install the latest cryptography
13+
# library. See https://github.com/pyca/cryptography/issues/5753
14+
~/ceph-venv/bin/pip install -I 'pip>=19.1.1'
1215
~/ceph-venv/bin/pip install -Ir requirements.txt
1316
~/ceph-venv/bin/pip install -IU selinux
1417
}

tests/post.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
- "--quiet"
5151

5252
- hosts: primary
53+
environment:
54+
PATH: "{{ ansible_env.HOME + '/.local/bin:' + ansible_env.PATH }}"
5355
tasks:
5456
- name: check for existence of ara sqlite
5557
stat:

tests/run.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@
2525
dashboard_enabled: "{{ openstack_core_enabled }}"
2626
upper_constraints_file: "{{ ansible_env.HOME }}/src/opendev.org/openstack/requirements/upper-constraints.txt"
2727
docker_image_tag_suffix: "{{ '-aarch64' if ansible_architecture == 'aarch64' else '' }}"
28+
pip_user_path_env:
29+
PATH: "{{ ansible_env.HOME + '/.local/bin:' + ansible_env.PATH }}"
2830

2931
- name: Install dig for Designate testing
3032
become: true
@@ -65,6 +67,7 @@
6567
# NOTE(yoctozepto): to avoid issues with IPv6 not enabled in the docker daemon
6668
# and since we don't need isolated networks here, use host networking
6769
network_mode: host
70+
environment: "{{ pip_user_path_env }}"
6871
tasks:
6972
- name: detect whether need build images
7073
set_fact:
@@ -200,6 +203,14 @@
200203
state: directory
201204
become: true
202205

206+
# NOTE(mgoddard): We need a recent pip to install the latest cryptography
207+
# library. See https://github.com/pyca/cryptography/issues/5753
208+
- name: install pip 19.1.1+
209+
pip:
210+
name: "pip>=19.1.1"
211+
executable: "pip3"
212+
extra_args: "--user"
213+
203214
- name: install kolla-ansible and dependencies
204215
vars:
205216
# Test latest ansible version on Ubuntu, minimum supported on others.
@@ -210,8 +221,7 @@
210221
- "ansible{{ ansible_version_constraint }}"
211222
- "ara<1.0.0"
212223
executable: "pip3"
213-
extra_args: "-c {{ upper_constraints_file }}"
214-
become: true
224+
extra_args: "-c {{ upper_constraints_file }} --user"
215225

216226
- name: get ARA callback plugin path
217227
command: "python3 -m ara.setup.callback_plugins"
@@ -486,6 +496,7 @@
486496

487497
- hosts: primary
488498
any_errors_fatal: true
499+
environment: "{{ pip_user_path_env }}"
489500
tasks:
490501
# Upgrade: update config.
491502
- block:
@@ -529,8 +540,7 @@
529540
pip:
530541
name: "{{ kolla_ansible_src_dir }}"
531542
executable: pip3
532-
extra_args: "-c {{ upper_constraints_file }}"
533-
become: true
543+
extra_args: "-c {{ upper_constraints_file }} --user"
534544

535545
# Update passwords.yml to include any new passwords added in this
536546
# release.
@@ -627,6 +637,7 @@
627637

628638
- hosts: primary
629639
any_errors_fatal: true
640+
environment: "{{ pip_user_path_env }}"
630641
tasks:
631642
- name: Run reconfigure.sh script
632643
script:

tox.ini

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,6 @@ commands =
7070
rm -rf releasenotes/build
7171
sphinx-build -a -E -W -d releasenotes/build/doctrees --keep-going -b html releasenotes/source releasenotes/build/html
7272

73-
[testenv:lower-constraints]
74-
deps =
75-
-c{toxinidir}/lower-constraints.txt
76-
-r{toxinidir}/test-requirements.txt
77-
-r{toxinidir}/requirements.txt
78-
7973
[testenv:linters]
8074
# Env vars and deps need to be defined in top level tox env
8175
setenv =
@@ -131,7 +125,7 @@ setenv = {[testenv:linters]setenv}
131125
deps = {[testenv:linters]deps}
132126
commands =
133127
python {toxinidir}/tools/validate-all-file.py
134-
ansible-lint -p --exclude {toxinidir}/tests --exclude {toxinidir}/roles
128+
ansible-lint -p --exclude {toxinidir}/tests --exclude {toxinidir}/roles --exclude {toxinidir}/etc
135129

136130
[testenv:yamllint]
137131
deps = {[testenv:linters]deps}

zuul.d/base.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
irrelevant-files:
1515
- ^.*\.rst$
1616
- ^doc/.*
17-
- ^lower-constraints.txt$
1817
- ^releasenotes/.*$
1918
- ^deploy-guide/.*$
2019
- ^test-requirements.txt$

zuul.d/project.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
templates:
44
- check-requirements
55
- openstack-cover-jobs
6-
- openstack-lower-constraints-jobs
76
- openstack-python3-victoria-jobs
87
- ansible-role-jobs
98
- publish-openstack-docs-pti

0 commit comments

Comments
 (0)