-
Notifications
You must be signed in to change notification settings - Fork 82
fix: optional Postgres via compose-with-db overlay #276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
zdrapela
wants to merge
7
commits into
docs/pg16-to-pg18-upgrade
from
fix/RHDHBUGS-1865-compose-with-db
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
abb7444
fix: enable optional Postgres via compose-with-db overlay
zdrapela a4a65e6
fix: use compose.override.yaml for Postgres major upgrades
zdrapela f764435
docs: link compose-with-db.yaml in PostgreSQL guide
zdrapela a8039c9
docs: drop compose.override.yaml commit note from upgrade steps
zdrapela 8e359c5
ci: exercise compose-with-db against RHEL PostgreSQL 18
zdrapela 3340b02
fix: clarify POSTGRES_IMAGE belongs in .env
zdrapela 009c4f7
fix: default POSTGRESQL_ADMIN_PASSWORD in upgrade override
zdrapela File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,32 @@ | ||
| # This Compose file is not usable on its own. | ||
| # It needs to be used alongside the default compose.yaml file, | ||
| # since it adds a PostgreSQL db service and makes rhdh wait for it. | ||
| # | ||
| # You can run `[podman|docker] compose -f compose.yaml -f compose-with-db.yaml config` | ||
| # to view the effective merged config. | ||
| # | ||
| # Also configure app-config.local.yaml for Postgres (see docs/rhdh-local-guide/postgresql-guide.md). | ||
|
|
||
| services: | ||
| db: | ||
| container_name: db | ||
| image: "${POSTGRES_IMAGE:-registry.redhat.io/rhel10/postgresql-18:latest}" # dclint disable-line service-image-require-explicit-tag | ||
| volumes: | ||
| - "/var/lib/pgsql/data" | ||
| env_file: | ||
| - path: "./default.env" | ||
| required: true | ||
| - path: "./.env" | ||
| required: false | ||
| environment: | ||
| - POSTGRESQL_ADMIN_PASSWORD=${POSTGRES_PASSWORD:-postgres} | ||
| healthcheck: | ||
| test: ["CMD", "pg_isready", "-U", "postgres"] | ||
| interval: 5s | ||
| timeout: 5s | ||
| retries: 5 | ||
|
|
||
| rhdh: | ||
| depends_on: | ||
| db: | ||
| condition: service_healthy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,18 @@ | ||
| # Temporary override for a PostgreSQL major upgrade. | ||
| # 1. Set POSTGRES_IMAGE in .env to the target major image (must support your | ||
| # current major via POSTGRESQL_PREV_VERSION). | ||
| # 2. Copy this file to compose.override.yaml for a single upgrade boot. | ||
| # 3. After upgrade succeeds, remove POSTGRESQL_UPGRADE (delete compose.override.yaml | ||
| # or strip that env) and recreate db. | ||
| # | ||
| # When using -f compose-with-db.yaml, Compose does not auto-load | ||
| # compose.override.yaml — include it explicitly: | ||
| # podman compose -f compose.yaml -f compose-with-db.yaml -f compose.override.yaml up -d db | ||
| # | ||
| # See docs/rhdh-local-guide/postgresql-guide.md. | ||
|
|
||
| services: | ||
| db: | ||
| environment: | ||
| - POSTGRESQL_ADMIN_PASSWORD=${POSTGRES_PASSWORD:-postgres} | ||
| - POSTGRESQL_UPGRADE=copy |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you add a configuration in the CI matrix to test this? Similar to what we have in
rhdh-local/.github/workflows/test.yml
Lines 42 to 52 in aff3771
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, good catch; added it. I also added the RH registry secret to the repo secrets so I can use the RHEL-based PostgreSQL image.