Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
random_service_name_value: ""
docker_repo: "percona/percona-distribution-postgresql"
container_prefix: "pdpgsql_pmm{{ (setup_type|default('')) and '_' ~ setup_type }}_{{ pdpgsql_version }}_"
pgsm_branch: "{{ lookup('env', 'PGSM_BRANCH') }}"

tasks:
- name: Display setup type selected
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,40 @@

- name: Install Percona Distribution for PostgreSQL
shell: |
docker exec -u root {{ container_prefix }}{{ item }} apt-get install -y percona-postgresql-{{ pdpgsql_version }} percona-pgbackrest percona-pg-stat-monitor{{ pdpgsql_version }}
docker exec -u root {{ container_prefix }}{{ item }} apt-get install -y percona-postgresql-{{ pdpgsql_version }} percona-pgbackrest
become: true
loop: "{{ range(1, nodes_count | int + 1) | list }}"

- name: Install PG Stat Monitor
shell: docker exec -u root {{ container_prefix }}{{ item }} apt-get install -y percona-pg-stat-monitor{{ pdpgsql_version }}
become: true
loop: "{{ range(1, nodes_count | int + 1) | list }}"
when: pgsm_branch | length == 0

- name: Prepare installation of PG Stat Monitor from sources
shell: |
docker exec -u root {{ container_prefix }}{{ item }} sh -c '
wget --quiet -O - https://www.postgresql.org/media/keys/ACCC4CF8.asc | apt-key add - &&
echo "deb http://apt.postgresql.org/pub/repos/apt $(lsb_release -cs)-pgdg main" > /etc/apt/sources.list.d/pgdg.list &&
apt-get update &&
apt-get -y install git clang-18 llvm-18 build-essential percona-postgresql-server-dev-{{ pdpgsql_version }}
'
become: true
loop: "{{ range(1, nodes_count | int + 1) | list }}"
when: pgsm_branch | length > 0

- name: Install PG Stat Monitor from sources
shell: |
docker exec -u root {{ container_prefix }}{{ item }} sh -c '
git clone --branch {{ pgsm_branch }} https://github.com/percona/pg_stat_monitor.git &&
cd pg_stat_monitor &&
make USE_PGXS=1 &&
make USE_PGXS=1 install
'
become: true
loop: "{{ range(1, nodes_count | int + 1) | list }}"
when: pgsm_branch | length > 0

- name: Start Percona distribution for Postgresql
shell: docker exec -u root {{ container_prefix }}{{ item }} systemctl start postgresql
become: true
Expand Down
4 changes: 3 additions & 1 deletion pmm_qa/pmm-framework.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,6 +159,7 @@ def setup_pdpgsql(db_type, db_version=None, db_config=None, args=None):
# Gather Version details
pdpgsql_version = os.getenv('PDPGSQL_VERSION') or db_version or database_configs[db_type]["versions"][-1]
setup_type_value = get_value('SETUP_TYPE', db_type, args, db_config).lower()
pgsm_branch = get_value('PGSM_BRANCH', db_type, args, db_config).lower()

# Define environment variables for playbook
env_vars = {
Expand All @@ -172,7 +173,8 @@ def setup_pdpgsql(db_type, db_version=None, db_config=None, args=None):
'PDPGSQL_PGSM_PORT': 5447,
'DISTRIBUTION': '',
'PMM_QA_GIT_BRANCH': os.getenv('PMM_QA_GIT_BRANCH') or 'v3',
'SETUP_TYPE': setup_type_value
'SETUP_TYPE': setup_type_value,
'PGSM_BRANCH': pgsm_branch
}

# Ansible playbook filename
Expand Down
2 changes: 1 addition & 1 deletion pmm_qa/scripts/database_options.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
},
"PDPGSQL": {
"versions": ["11", "12", "13", "14", "15", "16", "18", "17"],
"configurations": {"CLIENT_VERSION": "3-dev-latest", "USE_SOCKET": "", "SETUP_TYPE": ""}
"configurations": {"CLIENT_VERSION": "3-dev-latest", "USE_SOCKET": "", "SETUP_TYPE": "", "PGSM_BRANCH": ""}
},
"SSL_PDPGSQL": {
"versions": ["11", "12", "13", "14", "15", "16", "17"],
Expand Down