Skip to content

Commit

Permalink
PSMDB 8.0 setup for tarballs (#195)
Browse files Browse the repository at this point in the history
* PSMDB 8.0 setup for tarballs

* Add libffi-dev package

* Add jstestshell for 8.0
  • Loading branch information
olexandr-havryliak authored Aug 14, 2024
1 parent e726e7b commit 9411429
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 17 deletions.
4 changes: 2 additions & 2 deletions psmdb-tarball/psmdb-tarball/molecule/docker/molecule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions psmdb-tarball/psmdb-tarball/playbooks/prepare.yml
Original file line number Diff line number Diff line change
Expand Up @@ -111,6 +111,7 @@
- libreadline-dev
- libssl-dev
- libsqlite3-dev
- libffi-dev
- make
- zlib1g-dev
- python3
Expand Down
48 changes: 33 additions & 15 deletions psmdb-tarball/psmdb-tarball/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down Expand Up @@ -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"
Expand Down Expand Up @@ -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')
Expand Down

0 comments on commit 9411429

Please sign in to comment.