Skip to content

Commit

Permalink
Add pre-checks for Timescale (pgvectorscale)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitabaks committed Sep 19, 2024
1 parent 4f05e24 commit e71a586
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 1 deletion.
2 changes: 1 addition & 1 deletion automation/molecule/default/converge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@
enable_pg_partman: true
enable_citus: "{{ 'false' if ansible_distribution_version == '24.04' else 'true' }}" # TODO Ubuntu 24.04
enable_paradedb: "{{ 'false' if ansible_distribution_release == 'bullseye' else 'true' }}" # pg_search and pg_analytics (no packages for debian 11)
enable_pgvectorscale: "{{ 'true' if ansible_distribution_release in ['bookworm', 'jammy', 'noble'] else 'false' }}" # only deb packages are available
enable_pgvectorscale: true # "{{ 'true' if ansible_distribution_release in ['bookworm', 'jammy', 'noble'] else 'false' }}" # only deb packages are available

Check failure on line 65 in automation/molecule/default/converge.yml

View workflow job for this annotation

GitHub Actions / build

yaml[line-length]

Line too long (164 > 160 characters)

Check failure on line 65 in automation/molecule/default/converge.yml

View workflow job for this annotation

GitHub Actions / build

65:161 [line-length] line too long (164 > 160 characters)
# create extension
postgresql_schemas:
- { schema: "paradedb", db: "postgres", owner: "postgres" } # pg_search must be installed in the paradedb schema.
Expand Down
20 changes: 20 additions & 0 deletions automation/roles/pre-checks/tasks/extensions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,26 @@
- (enable_timescale | default(false) | bool) or (enable_timescaledb | default(false) | bool)
- postgresql_version | string is version(timescale_minimal_pg_version | default(12) | string, '<')

- name: Timescale (pgvectorscale) | Checking PostgreSQL version
run_once: true
ansible.builtin.fail:
msg:
- "The current PostgreSQL version ({{ postgresql_version }}) is not supported by the pgvectorscale."
- "PostgreSQL version must be {{ pgvectorscale_minimal_pg_version | default(15) }} or higher."
when:
- enable_pgvectorscale | default(false) | bool
- postgresql_version | string is version(pgvectorscale_minimal_pg_version | default(15) | string, '<')

- name: Timescale (pgvectorscale) | Checking supported operating system and version
run_once: true
ansible.builtin.fail:
msg:
- "pgvectorscale is not supported on {{ ansible_distribution }} {{ ansible_distribution_release }}."
- "Supported OS: Debian (bookworm), Ubuntu (jammy, noble)."
when:
- enable_pgvectorscale | default(false) | bool
- not (ansible_os_family == "Debian" and ansible_distribution_release in ['bookworm', 'jammy', 'noble'])

- name: ParadeDB | Checking PostgreSQL version
run_once: true
ansible.builtin.fail:
Expand Down

0 comments on commit e71a586

Please sign in to comment.