From 9411429cb4bd53a6c8b00a7409cb98b1fca1dc4d Mon Sep 17 00:00:00 2001 From: Oleksandr Havryliak <88387200+olexandr-havryliak@users.noreply.github.com> Date: Wed, 14 Aug 2024 14:04:58 +0300 Subject: [PATCH] PSMDB 8.0 setup for tarballs (#195) * PSMDB 8.0 setup for tarballs * Add libffi-dev package * Add jstestshell for 8.0 --- .../molecule/docker/molecule.yml | 4 +- .../psmdb-tarball/playbooks/prepare.yml | 1 + psmdb-tarball/psmdb-tarball/tasks/main.yml | 48 +++++++++++++------ 3 files changed, 36 insertions(+), 17 deletions(-) diff --git a/psmdb-tarball/psmdb-tarball/molecule/docker/molecule.yml b/psmdb-tarball/psmdb-tarball/molecule/docker/molecule.yml index aec49fce..6c93f986 100644 --- a/psmdb-tarball/psmdb-tarball/molecule/docker/molecule.yml +++ b/psmdb-tarball/psmdb-tarball/molecule/docker/molecule.yml @@ -4,8 +4,8 @@ dependency: driver: name: docker platforms: - - name: ${MOLECULE_OS:-centos7} - image: "${MOLECULE_DISTRO:-geerlingguy/docker-centos7-ansible:latest}" + - name: ${MOLECULE_OS:-ubuntu2204} + image: "${MOLECULE_DISTRO:-geerlingguy/docker-ubuntu2204-ansible:latest}" command: ${MOLECULE_DOCKER_COMMAND:-""} volumes: - /sys/fs/cgroup:/sys/fs/cgroup:rw diff --git a/psmdb-tarball/psmdb-tarball/playbooks/prepare.yml b/psmdb-tarball/psmdb-tarball/playbooks/prepare.yml index a8a9d61d..bb5b7684 100644 --- a/psmdb-tarball/psmdb-tarball/playbooks/prepare.yml +++ b/psmdb-tarball/psmdb-tarball/playbooks/prepare.yml @@ -111,6 +111,7 @@ - libreadline-dev - libssl-dev - libsqlite3-dev + - libffi-dev - make - zlib1g-dev - python3 diff --git a/psmdb-tarball/psmdb-tarball/tasks/main.yml b/psmdb-tarball/psmdb-tarball/tasks/main.yml index 51b94e86..01b3504c 100644 --- a/psmdb-tarball/psmdb-tarball/tasks/main.yml +++ b/psmdb-tarball/psmdb-tarball/tasks/main.yml @@ -10,11 +10,9 @@ set_fact: repo_branch: "{{ tarball | regex_search('mongodb-([0-9]+\\.[0-9]+)', '\\1') }}" -- name: Copy tarball - copy: - src: /tmp/percona-server-mongodb-{{mongodb_ver[0]}}-{{ item }}.tar.gz - dest: /tmp/percona-server-mongodb.tar.gz - mode: '0644' +- name: Detect OS + set_fact: + os: "{{ item }}" loop: - ol7 - ol8 @@ -25,7 +23,7 @@ - bookworm - bullseye - buster - when: + when: - ( ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "20" and item == "focal") or ( ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "22" and item == "jammy") or ( ansible_distribution == "Ubuntu" and ansible_distribution_major_version == "24" and item == "noble") or @@ -36,6 +34,12 @@ ( ansible_os_family == "RedHat" and ansible_distribution_major_version == "8" and item == "ol8") or ( ansible_os_family == "RedHat" and ansible_distribution_major_version == "9" and item == "ol9") +- name: Copy tarball + copy: + src: /tmp/percona-server-mongodb-{{mongodb_ver[0]}}-{{ os }}.tar.gz + dest: /tmp/percona-server-mongodb.tar.gz + mode: '0644' + - name: Unpack new tarball unarchive: src: /tmp/percona-server-mongodb.tar.gz @@ -66,13 +70,9 @@ - name: Install percona release package include_tasks: ../../../tasks/install_percona_release.yml -- name: Enable psmdb 7.0 experimental repo - command: percona-release enable psmdb-70 experimental - when: not mongo.stat.exists and repo_branch[0] | float == 7.0 - -- name: Enable psmdb 6.0 testing repo (for buster and bionic) - command: percona-release enable psmdb-60 testing - when: not mongo.stat.exists and repo_branch[0] | float == 6.0 +- name: Enable psmdb testing repo + command: percona-release enable psmdb-{{ repo_branch[0].split('.')[0] }}{{ repo_branch[0].split('.')[1] }} testing + when: not mongo.stat.exists and repo_branch[0] | float >= 6.0 - name: Install mongosh deb packages apt: @@ -114,6 +114,24 @@ pip: requirements: /percona-server-mongodb/etc/pip/dev-requirements.txt virtualenv: /opt/venv + when: repo_branch[0] | float <= 7.0 + +- name: Install poetry for PSMDB 8.0 + pip: + name: + - poetry==1.5.1 + - pyproject-hooks==1.0.0 + state: present + virtualenv: /opt/venv + when: repo_branch[0] | float >= 8.0 + +- name: Install Python utilities for PSMDB 8.0 + shell: /opt/venv/bin/poetry install --sync --no-root + args: + chdir: /percona-server-mongodb + environment: + POETRY_VIRTUALENVS_CREATE: false + when: repo_branch[0] | float >= 8.0 - name: Fix files permissions shell: "find /percona-server-mongodb/jstests -type f | xargs chmod 400" @@ -151,13 +169,13 @@ create: yes - name: Setup multiversion - shell: /opt/venv/bin/python buildscripts/setup_multiversion_mongodb.py --installDir /data/install --linkDir /data/multiversion --edition base --platform ubuntu1804 --architecture x86_64 4.2 4.4 5.0 6.0 + shell: /opt/venv/bin/python buildscripts/setup_multiversion_mongodb.py --installDir /data/install --linkDir /data/multiversion --edition base --platform ubuntu1804 --architecture x86_64 4.2 4.4 5.0 6.0 7.0 args: chdir: /percona-server-mongodb when: not (( ansible_distribution == "Ubuntu" and ansible_distribution_major_version >= "22" ) or (ansible_os_family == 'Debian' and ansible_distribution_release == 'bookworm')) - name: Setup multiversion - shell: /opt/venv/bin/python buildscripts/setup_multiversion_mongodb.py --installDir /data/install --linkDir /data/multiversion --edition base --platform ubuntu2204 --architecture x86_64 4.2 4.4 5.0 6.0 + shell: /opt/venv/bin/python buildscripts/setup_multiversion_mongodb.py --installDir /data/install --linkDir /data/multiversion --edition base --platform ubuntu2204 --architecture x86_64 4.2 4.4 5.0 6.0 7.0 args: chdir: /percona-server-mongodb when: (ansible_distribution == "Ubuntu" and ansible_distribution_major_version >= "22") or (ansible_os_family == 'Debian' and ansible_distribution_release == 'bookworm')