PostgreSQL upgrade to v18. Closes #3272#3293
PostgreSQL upgrade to v18. Closes #3272#3293NikhilRaikwar wants to merge 4 commits intointelowlproject:developfrom
Conversation
…oject#3272 (intelowlproject#3275) * Upgrade Postgres to 17-alpine and fix volume mount (intelowlproject#3272) * Upgrade Postgres to 18-alpine as requested
This fixes the issue from GreedyBear#766 where mounting to /var/lib/postgresql causes Docker to create an anonymous volume at /var/lib/postgresql/data (hardcoded in PostgreSQL Dockerfile). Changes: - Mount directly to /var/lib/postgresql/data - Remove PGDATA env var (using PostgreSQL default) - Prevents shadow anonymous volumes Tested with docker inspect - confirmed single volume mount.
|
This pull request has been marked as stale because it has had no activity for 10 days. If you are still working on this, please provide some updates or it will be closed in 5 days. |
|
This pull request has been closed because it had no updates in 15 days. If you're still working on this fell free to reopen. |
…into upgrade/postgres-18-v7
|
this change requires proof that if works as expected and should be merged only when ready for the next major |
|
Hi @mlodic, I apologize for the previous confusion. I’ve been testing the setup locally to make sure it aligns with the PostgreSQL 18 requirements you mentioned. In my local environment, I changed the mount to: I verified that data is preserved after a full restart. Here are the outputs from my terminal: Postgres Logs: Persistence Check (after restart): Container Inspect: "Destination": "/var/lib/postgresql"This configuration seems to resolve the initialization issues by letting the image manage its own subdirectories. Please let me know what you think of this approach. If it looks good, I'll push the changes. |
Description
Upgrades the PostgreSQL Docker image from version 16 to version 18 for the upcoming IntelOwl v7.0.0 release.
This PR includes:
postgres.override.ymlto usepostgres:18-alpinepostgres_data_v18to prevent conflicts with v6 dataPGDATAenvironment variable (using PostgreSQL defaults)Related PRs/Issues
Technical Details
What Changed
Files Modified:
docker/postgres.override.ymlpostgres:16-alpine→postgres:18-alpinepostgres_data→postgres_data_v18(for v6/v7 isolation)postgres_data_v18:/var/lib/postgresql/datadocker/env_file_postgres_templatePGDATAvariable (uses PostgreSQL's default/var/lib/postgresql/data)Why These Changes?
Volume Isolation: Using a new volume name (
postgres_data_v18) ensures users' v6 data remains untouched during the upgrade. This prevents accidental data loss and allows for safe rollback if needed.Anonymous Volume Prevention: The configuration prevents the issue documented in GreedyBear#766 where mounting to a parent directory causes Docker to create shadow anonymous volumes, leading to data loss.
Testing
docker compose configMigration Guide
Users can follow the comprehensive 12-step migration guide in the documentation PR to safely migrate their data from PostgreSQL 16 to 18.
Type of change
Checklist
developdumpplugincommand and added it in the project as a data migration. ("How to share a plugin with the community")test_files.zipand you added the default tests for that mimetype in test_classes.py.FREE_TO_USE_ANALYZERSplaybook by following this guide.urlthat contains this information. This is required for Health Checks (HEAD HTTP requests).get_mocker_response()method of the unittest class. This serves us to provide a valid sample for testing.DataModelfor the new analyzer following the documentation# This file is a part of IntelOwl https://github.com/intelowlproject/IntelOwl # See the file 'LICENSE' for copying permission.(N/A - only modified Docker configuration files)Ruff) gave 0 errors. If you have correctly installed pre-commit, it does check these checks and adjustments on your behalf.testsfolder). All the tests (new and old ones) gave 0 errors. (Infrastructure change - validated withdocker compose config)DeepSource,Django Doctorsor other third-party linters have triggered any alerts during the CI checks, I have solved those alerts.Important Rules