Skip to content

[WIP] Switch database backend to postgresql#691

Draft
jpodivin wants to merge 2 commits into
packit:mainfrom
jpodivin:postgresql
Draft

[WIP] Switch database backend to postgresql#691
jpodivin wants to merge 2 commits into
packit:mainfrom
jpodivin:postgresql

Conversation

@jpodivin

Copy link
Copy Markdown
Collaborator

This is obviously a substantial change. There is no easy way to migrate the trace data we have collected so far, but since we can't properly query it anyway, I don't see that as a much of an issue. That being said, we could export them, if we really want to.

  • arize-phoenix is now installed with asyncpg
  • Database credentials are set to defaults, it's going to run inside cluster with now outside facing API anyway
  • New 150 GB volume for the database
  • phoenix-data is now 2 GB, that should be enough for the runtime, maybe even an overkill
  • Shrinking volumes can be tricky, so we may have to delete the original and create a new one
  • Uses quay.io/sclorg/postgresql-16-c9s container image

RELEASE NOTES BEGIN

Replace Phoenix SQLite backend with Postgresql.

RELEASE NOTES END

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates the Phoenix observability backend from SQLite to PostgreSQL, updating the Docker Compose configuration, OpenShift deployment manifests, and documentation to support the new database service. The review feedback highlights a critical issue where using the official PostgreSQL image on OpenShift will fail due to permission restrictions under non-root execution. To resolve this, it is recommended to switch to the OpenShift-compatible sclorg PostgreSQL image, which requires corresponding updates to environment variables, volume mount paths, and secret keys across both OpenShift and local Compose environments. Additionally, adding a database healthcheck in Docker Compose is suggested to prevent startup race conditions.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread openshift/imagestream-phoenix-db.yml Outdated
Comment thread openshift/deployment-phoenix-db.yml Outdated
Comment thread openshift/deployment-phoenix-db.yml Outdated
Comment thread openshift/deployment-phoenix.yml Outdated
Comment thread compose.yaml Outdated
Comment thread compose.yaml
Comment thread compose.yaml Outdated
jpodivin and others added 2 commits July 17, 2026 16:41
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Jiri Podivin <jpodivin@redhat.com>

@TomasTomecek TomasTomecek left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Overall this looks really good, thanks for updating also the documents.

I'm wondering if we need to do some cleanup of the existing data once we deploy it.

@jpodivin

Copy link
Copy Markdown
Collaborator Author

Overall this looks really good, thanks for updating also the documents.

I'm wondering if we need to do some cleanup of the existing data once we deploy it.

That's the "best" part. There is no way to migrate the data to the new database. So the cleanup is kind of... given.

@mfocko mfocko left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

- ReadWriteOnce
resources:
requests:
storage: 150Gi

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Did it actually utilize most of the 150Gi?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A valid question, I'm not sure about that.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oc exec deploy/phoenix -- df -h /mnt/data
Filesystem                                        Size  Used Avail Use% Mounted on
[redacted, so noone from prodsec comes after me]  150G  6.9G  144G   5% /mnt/data

@opohorel opohorel Jul 20, 2026

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would suggest going with 20Gi, so we have some headroom. we'll still save a huge portion of the allocation freed, and we hopefully don't have to worry about it too soon
edit: I meant this comment for db-data not the phoenix-data

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll revise the PR then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants