From 000052f67a38579666cc9c446675de148c4f0b4d Mon Sep 17 00:00:00 2001 From: Andrey Kurilin Date: Thu, 13 Feb 2020 14:27:30 +0200 Subject: [PATCH] Rework rally-install-* jobs * use python3 * do not use install_rally.sh script * check centos-8 * remove postgres packages brom bindep Change-Id: I00abce40d333352b25848cfe941f845746bffa8c --- .zuul.d/zuul.yaml | 23 +++++--- bindep.txt | 5 +- .../rally-database-migration/run.yaml | 4 +- tests/ci/playbooks/rally-install/pre.yaml | 53 +++++++++++++++++++ tests/ci/playbooks/rally-install/run.yaml | 45 +++++++--------- 5 files changed, 91 insertions(+), 39 deletions(-) create mode 100644 tests/ci/playbooks/rally-install/pre.yaml diff --git a/.zuul.d/zuul.yaml b/.zuul.d/zuul.yaml index a35226eb0a..263e3a8cf7 100644 --- a/.zuul.d/zuul.yaml +++ b/.zuul.d/zuul.yaml @@ -1,23 +1,29 @@ - job: - name: rally-install-ubuntu-xenial + name: rally-install-base parent: base - nodeset: ubuntu-xenial + pre-run: tests/ci/playbooks/rally-install/pre.yaml run: tests/ci/playbooks/rally-install/run.yaml timeout: 1800 +- job: + name: rally-install-ubuntu-xenial + parent: rally-install-base + nodeset: ubuntu-xenial + - job: name: rally-install-ubuntu-bionic - parent: base + parent: rally-install-base nodeset: ubuntu-bionic - run: tests/ci/playbooks/rally-install/run.yaml - timeout: 1800 - job: name: rally-install-centos-7 - parent: base + parent: rally-install-base nodeset: centos-7 - run: tests/ci/playbooks/rally-install/run.yaml - timeout: 1800 + +- job: + name: rally-install-centos-8 + parent: rally-install-base + nodeset: centos-8 - job: name: rally-database-migration @@ -43,6 +49,7 @@ - rally-install-ubuntu-xenial - rally-install-ubuntu-bionic - rally-install-centos-7 + - rally-install-centos-8 - rally-tox-self gate: jobs: diff --git a/bindep.txt b/bindep.txt index 5719dfb008..21f7e3860c 100644 --- a/bindep.txt +++ b/bindep.txt @@ -7,17 +7,14 @@ gmp-devel [platform:rpm] libffi-dev [platform:dpkg] libffi-devel [platform:rpm !platform:opensuse] libffi48-devel [platform:opensuse] -libpq-dev [platform:dpkg] libssl-dev [platform:dpkg] libxml2-dev [platform:dpkg] libxml2-devel [platform:rpm] libxslt1-dev [platform:dpkg] libxslt-devel [platform:rpm] openssl-devel [platform:rpm] -postgresql-devel [platform:rpm !platform:opensuse] -postgresql93-devel [platform:opensuse] python-dev [platform:dpkg] -python-devel [platform:rpm] +python3-devel [platform:rpm] redhat-rpm-config [platform:rpm !platform:suse] iputils-ping [platform:dpkg] iputils [platform:rpm] diff --git a/tests/ci/playbooks/rally-database-migration/run.yaml b/tests/ci/playbooks/rally-database-migration/run.yaml index 5ad5f758f0..462832c253 100644 --- a/tests/ci/playbooks/rally-database-migration/run.yaml +++ b/tests/ci/playbooks/rally-database-migration/run.yaml @@ -61,7 +61,9 @@ echo "Update to the master branch" git checkout master sudo pip uninstall rally --yes - sudo pip install --constraint ./upper-constraints.txt ./ + # NOTE(andreykurilin): Starting from Rally 3.0.0 there is no + # Python2.7 support + sudo pip3 install --constraint ./upper-constraints.txt ./ rally --version rally db upgrade diff --git a/tests/ci/playbooks/rally-install/pre.yaml b/tests/ci/playbooks/rally-install/pre.yaml new file mode 100644 index 0000000000..ccc6aaad29 --- /dev/null +++ b/tests/ci/playbooks/rally-install/pre.yaml @@ -0,0 +1,53 @@ +- hosts: all + name: Prepare host to install Rally + tasks: + - name: Check whether apt is available + shell: + cmd: "apt-get --version" + executable: /bin/sh + register: apt_get_installed + ignore_errors: True + + - name: Check whether dnf is available + shell: + cmd: "dnf --version" + executable: /bin/sh + register: dnf_installed + ignore_errors: True + + - name: Check whether yum is available + shell: + cmd: "yum --version" + executable: /bin/sh + register: yum_installed + ignore_errors: True + + - name: Install required packages (Centos-7) + when: yum_installed.rc == 0 + shell: + cmd: | + sudo yum remove -y python-crypto || true + + sudo yum update + sudo yum install -y yum-utils + sudo yum groupinstall -y development + + sudo yum install -y https://centos7.iuscommunity.org/ius-release.rpm + sudo yum install -y python36u python36u-devel + + curl https://bootstrap.pypa.io/get-pip.py -o /tmp/get-pip.py + sudo python3 /tmp/get-pip.py + + - name: Install required packages (Ubuntu) + when: apt_get_installed.rc == 0 + shell: + chdir: '{{ zuul.project.src_dir }}' + cmd: | + # NOTE(pabelanger): We run apt-get update to ensure we dont have a stale + # package cache in the gate. + sudo apt-get update + + - name: Install bindep + shell: + cmd: | + sudo pip3 install bindep diff --git a/tests/ci/playbooks/rally-install/run.yaml b/tests/ci/playbooks/rally-install/run.yaml index f525cf604b..8c67a41f2f 100644 --- a/tests/ci/playbooks/rally-install/run.yaml +++ b/tests/ci/playbooks/rally-install/run.yaml @@ -1,34 +1,27 @@ - hosts: all - name: a run script for rally-install-ubuntu-xenial and rally-install-centos-7 jobs + name: a run script for rally-install-* jobs tasks: + - name: Get list of packages to install from bindep + command: "bindep -b -f {{ zuul.project.src_dir }}/bindep.txt" + register: bindep_output + ignore_errors: True - - shell: + - name: Install distro packages from bindep + package: + name: "{{ bindep_output.stdout_lines }}" + state: present + become: yes + when: bindep_output.stdout_lines + + - name: Install Rally and check + shell: cmd: | - sudo yum remove -y python-crypto || true - - # NOTE(pabelanger): We run apt-get update to ensure we dont have a stale - # package cache in the gate. - sudo apt-get update || true - - sudo ./install_rally.sh --system --yes - - rally deployment list - [ -d /etc/bash_completion.d ] && cat /etc/bash_completion.d/rally.bash_completion || true - - sudo ./install_rally.sh --system --yes - rally deployment list - - sudo ./install_rally.sh --yes -d /tmp/rallytest_root/ - /tmp/rallytest_root/bin/rally deployment list - cat /tmp/rallytest_root/etc/bash_completion.d/rally.bash_completion - - sudo rm -fr ~/.rally - - ./install_rally.sh --yes -d /tmp/rallytest_user - /tmp/rallytest_user/bin/rally deployment list - - ./install_rally.sh --overwrite --dbtype sqlite + # install system wide + sudo pip3 install --constraint ./upper-constraints.txt ./ + rally --version + rally db create + rally env list executable: /bin/sh chdir: '{{ zuul.project.src_dir }}'