Fix Zed CI

This is a combination of 3 commits.

====================

py2constraints: pin PasteDeploy version

PasteDeploy version 3.0 (2022-10-16) dropped support for python2 (as
well as <3.7), which causes our py2 tests to fail. So cap the version
here at 2.1.1, the last which is compatible with our tests.

Even doing this doesn't stop pip install swift pulling in a newer
PasteDeploy in the
tools/playbooks/saio_single_node_setup/make_rings.yaml playbook
(causing the probes test on CentOS-7 to fail); so handle CentOS 7
explicitly.

Signed-off-by: Matthew Vernon <mvernon@wikimedia.org>
(cherry picked from commit cc033154ad)

====================

playbooks: replace ansible_ssh_user with ansible_user

ansible_ssh_user has been deprecated since Ansible 2.0 [1]

[1] https://github.com/ansible/ansible/blob/stable-2.0/CHANGELOG.md
(cherry picked from commit 07b5f139a5)

====================

CI: Install pip from pinned upstream for py2 probe tests

As part of that, invert the inheritance so the py2 job derives from the
py3 job.

(cherry picked from commit 3571cdf2f7)

====================

Change-Id: If69ae0f8eac8fe8ff7d5e4f4f1bff6d0ea9e7a8b
This commit is contained in:
Matthew Vernon
2022-10-17 09:47:14 +01:00
committed by Tim Burke
parent 49d35e0c32
commit 88e3f7be98
8 changed files with 43 additions and 27 deletions

View File

@@ -345,14 +345,30 @@
- job: - job:
name: swift-probetests-centos-7 name: swift-probetests-centos-7
parent: unittests parent: swift-probetests-centos-8-stream
nodeset: centos-7 nodeset: centos-7
description: | description: |
Setup a SAIO dev environment and run Swift's probe tests Setup a SAIO dev environment and run Swift's probe tests
under Python 2. under Python 2.
timeout: 7200
vars: vars:
bindep_profile: test py27 bindep_profile: test py27
ensure_pip_from_packages: False
ensure_pip_from_packages_with_python2: False
ensure_pip_from_upstream: True
ensure_pip_from_upstream_interpreters:
- python2
ensure_pip_from_upstream_url: "https://bootstrap.pypa.io/pip/2.7/get-pip.py"
- job:
name: swift-probetests-centos-8-stream
parent: unittests
nodeset: centos-8-stream
description: |
Setup a SAIO dev environment and run Swift's probe tests
under Python 3.
timeout: 7200
vars:
bindep_profile: test py36
pre-run: pre-run:
- tools/playbooks/common/install_dependencies.yaml - tools/playbooks/common/install_dependencies.yaml
- tools/playbooks/saio_single_node_setup/setup_saio.yaml - tools/playbooks/saio_single_node_setup/setup_saio.yaml
@@ -360,16 +376,6 @@
run: tools/playbooks/probetests/run.yaml run: tools/playbooks/probetests/run.yaml
post-run: tools/playbooks/probetests/post.yaml post-run: tools/playbooks/probetests/post.yaml
- job:
name: swift-probetests-centos-8-stream
parent: swift-probetests-centos-7
nodeset: centos-8-stream
description: |
Setup a SAIO dev environment and run Swift's probe tests
under Python 3.
vars:
bindep_profile: test py36
- job: - job:
name: swift-probetests-centos-8-stream-arm64 name: swift-probetests-centos-8-stream-arm64
parent: swift-probetests-centos-8-stream parent: swift-probetests-centos-8-stream

View File

@@ -78,3 +78,4 @@ dnspython===1.16.0
setuptools===44.1.1 setuptools===44.1.1
pycadf===2.10.0 pycadf===2.10.0
smmap===3.0.5 smmap===3.0.5
PasteDeploy==2.1.1

View File

@@ -43,3 +43,12 @@
# For some reason, pip on py2 isn't smart enough to prevent us # For some reason, pip on py2 isn't smart enough to prevent us
# trying to install a too-new mock?? # trying to install a too-new mock??
- 'mock<4' - 'mock<4'
- name: install PasteDeploy - CentOS 7
pip: name={{ item }} state=present extra_args='--upgrade'
with_items:
# py2_constraints isn't obeyed by pip install swift
- 'PasteDeploy==2.1.1'
when:
- ansible_facts['distribution'] == "CentOS"
- ansible_facts['distribution_major_version'] == "7"

View File

@@ -69,7 +69,7 @@
- hosts: test-runner - hosts: test-runner
tasks: tasks:
- name: add new env. variable for running tests - name: add new env. variable for running tests
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="export SWIFT_TEST_CONFIG_FILE=/home/{{ ansible_ssh_user}}/test.conf" lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="export SWIFT_TEST_CONFIG_FILE=/home/{{ ansible_user}}/test.conf"
- name: copy the sample configuration files for running tests - name: copy the sample configuration files for running tests
template: src=test.conf.j2 dest=/home/{{ ansible_ssh_user }}/test.conf template: src=test.conf.j2 dest=/home/{{ ansible_user }}/test.conf

View File

@@ -126,20 +126,20 @@
when: previous_swift_version | default(latest_swift_release.stdout) is not match("^(rocky|stein|train|ussuri)-em.*|^2\.(1?[0-9]|2[0-5])\.|^(origin/)?stable/[a-u].*") when: previous_swift_version | default(latest_swift_release.stdout) is not match("^(rocky|stein|train|ussuri)-em.*|^2\.(1?[0-9]|2[0-5])\.|^(origin/)?stable/[a-u].*")
- name: create remakerings from template - name: create remakerings from template
template: src=make_multinode_rings.j2 dest=/home/{{ ansible_ssh_user }}/make_multinode_rings mode=0755 template: src=make_multinode_rings.j2 dest=/home/{{ ansible_user }}/make_multinode_rings mode=0755
- name: create rings dir - name: create rings dir
file: > file: >
path=/home/{{ ansible_ssh_user }}/rings path=/home/{{ ansible_user }}/rings
state=directory state=directory
- name: make rings - name: make rings
shell: shell:
cmd: /home/{{ ansible_ssh_user }}/make_multinode_rings cmd: /home/{{ ansible_user }}/make_multinode_rings
executable: /bin/bash executable: /bin/bash
- name: scp rings to all swift-cluster nodes - name: scp rings to all swift-cluster nodes
command: scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o ConnectionAttempts=360 /home/{{ ansible_ssh_user }}/rings/{{ item[0] }} {{ ansible_ssh_user }}@{{ hostvars[item[1]].nodepool.public_ipv4 }}:/etc/swift command: scp -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -o ConnectTimeout=5 -o ConnectionAttempts=360 /home/{{ ansible_user }}/rings/{{ item[0] }} {{ ansible_user }}@{{ hostvars[item[1]].nodepool.public_ipv4 }}:/etc/swift
with_nested: with_nested:
- ['account.ring.gz', 'container.ring.gz', 'object.ring.gz', 'object-1.ring.gz', 'object-2.ring.gz'] - ['account.ring.gz', 'container.ring.gz', 'object.ring.gz', 'object-1.ring.gz', 'object-2.ring.gz']
- "{{ groups['swift-cluster'] }}" - "{{ groups['swift-cluster'] }}"

View File

@@ -40,4 +40,4 @@
tox_envlist: func-py3 tox_envlist: func-py3
tox_environment: tox_environment:
TOX_CONSTRAINTS_FILE: https://releases.openstack.org/constraints/upper/yoga TOX_CONSTRAINTS_FILE: https://releases.openstack.org/constraints/upper/yoga
SWIFT_TEST_CONFIG_FILE: /home/{{ ansible_ssh_user }}/test.conf SWIFT_TEST_CONFIG_FILE: /home/{{ ansible_user }}/test.conf

View File

@@ -2,7 +2,7 @@
set -e set -e
cd /home/{{ ansible_ssh_user }}/rings cd /home/{{ ansible_user }}/rings
rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz rm -f *.builder *.ring.gz backups/*.builder backups/*.ring.gz

View File

@@ -161,22 +161,22 @@
create: no create: no
- name: copy the SAIO scripts for resetting the environment - name: copy the SAIO scripts for resetting the environment
command: cp -r {{ zuul.project.src_dir }}/doc/saio/bin /home/{{ ansible_ssh_user }}/bin creates=/home/{{ ansible_ssh_user }}/bin command: cp -r {{ zuul.project.src_dir }}/doc/saio/bin /home/{{ ansible_user }}/bin creates=/home/{{ ansible_user }}/bin
- name: set the correct file mode for SAIO scripts - name: set the correct file mode for SAIO scripts
file: dest=/home/{{ ansible_ssh_user }}/bin mode=0777 recurse=yes file: dest=/home/{{ ansible_user }}/bin mode=0777 recurse=yes
- name: add new env. variable for loopback device - name: add new env. variable for loopback device
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="export SAIO_BLOCK_DEVICE=/srv/swift-disk" lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="export SAIO_BLOCK_DEVICE=/srv/swift-disk"
- name: remove line from resetswift - name: remove line from resetswift
lineinfile: dest=/home/{{ ansible_ssh_user }}/bin/resetswift line="sudo find /var/log/swift -type f -exec rm -f {} \;" state=absent lineinfile: dest=/home/{{ ansible_user }}/bin/resetswift line="sudo find /var/log/swift -type f -exec rm -f {} \;" state=absent
- name: add new env. variable for running tests - name: add new env. variable for running tests
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="export SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf" lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="export SWIFT_TEST_CONFIG_FILE=/etc/swift/test.conf"
- name: make sure PATH includes the bin directory - name: make sure PATH includes the bin directory
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="export PATH=${PATH}:/home/{{ ansible_ssh_user }}/bin" lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="export PATH=${PATH}:/home/{{ ansible_user }}/bin"
- name: increase open files limit to run probe tests - name: increase open files limit to run probe tests
lineinfile: dest=/home/{{ ansible_ssh_user }}/.bashrc line="ulimit -n 4096" lineinfile: dest=/home/{{ ansible_user }}/.bashrc line="ulimit -n 4096"