Skip to content
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

db: Replace Postgres database with an in-app Sqlite db for Quay during fresh install of OMR #152

Merged
merged 8 commits into from
Jun 27, 2024

Conversation

harishsurf
Copy link
Contributor

@harishsurf harishsurf commented May 15, 2024

feat: Sqlite database migration work for OMR is split into two parts (each with its own PR):

  1. Fresh Install (this PR)
  2. Upgrade from Postgres to Sqlite (db: Modify upgrade cmd to migrate database from Postgres to Sqlite #153)

This PR only deals with fresh Install - It changes the underlying database for Quay which currently runs as a separate Postgres container to a file based Sqlite database. The Sqlite database file is stored in a volume mounted to the Quay container.
Note:

  • The changes are only related to the ./mirror-registry install flow
  • This PR needs the alembic migration changes (PR) to land on quay repo before merging this

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 15, 2024
@harishsurf harishsurf added the ok-to-test Indicates a non-member PR verified by an org member that is safe to test. label May 15, 2024
@harishsurf harishsurf marked this pull request as ready for review May 15, 2024 20:59
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label May 15, 2024
- name: Create Sqlite Storage named volume
containers.podman.podman_volume:
state: present
name: sqlite-storage
Copy link
Contributor

Choose a reason for hiding this comment

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

It should use the name that is provided by the user.

.env Outdated
@@ -1,7 +1,6 @@
EE_IMAGE=quay.io/quay/mirror-registry-ee:latest
EE_BASE_IMAGE=registry.redhat.io/ansible-automation-platform-22/ee-minimal-rhel8:1.0.0-249
EE_BUILDER_IMAGE=registry.redhat.io/ansible-automation-platform-22/ansible-builder-rhel8:1.1.0-103
POSTGRES_IMAGE=registry.redhat.io/rhel8/postgresql-10:1-203.1669834630
QUAY_IMAGE=registry.redhat.io/quay/quay-rhel8:v3.8.15
QUAY_IMAGE=quay.io/omr-sqlite/omrrepo:workingsqlite
Copy link
Contributor

Choose a reason for hiding this comment

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

It should be a Quay image that we maintain. Ideally from redhat.redhat.io, but a nightly build from quay.io/projectquay/quay would work too.

@dmage dmage added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels May 16, 2024
@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels May 29, 2024

- name: Debug systemctl status output
debug:
var: systemctl_status.stdout_lines
Copy link
Collaborator

Choose a reason for hiding this comment

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

Can you make sure it exits at the end of this rescue block? Right now it will continue the rest of the tasks since we are handling the error

Copy link
Contributor Author

Choose a reason for hiding this comment

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

added a fail task:

  - name: Fail the playbook due to Quay not becoming alive
      fail:
        msg: "Quay did not become alive. Check debug logs above for details." 

@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels May 30, 2024
@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels May 31, 2024
@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Jun 3, 2024
@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Jun 3, 2024
@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Jun 3, 2024
@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Jun 10, 2024
@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Jun 10, 2024
without this, multiple workers tend to write simultaneously
causing concurrent write issues
When podman runs containers in rootless mode, it remaps the container's
UIDs to the host UIDs assigned to the user. For example, the container's
UID 1001 is no longer 1001 on the host; it will be remapped to something
like 101000. Therefore, we need to use podman unshare to assign the
correct owner UID to the directory.
@harishsurf harishsurf added ok-to-test Indicates a non-member PR verified by an org member that is safe to test. and removed ok-to-test Indicates a non-member PR verified by an org member that is safe to test. labels Jun 27, 2024
@harishsurf harishsurf merged commit 082ad3a into quay:main Jun 27, 2024
8 checks passed
@harishsurf harishsurf deleted the fresh-install branch August 9, 2024 14:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ok-to-test Indicates a non-member PR verified by an org member that is safe to test.
Development

Successfully merging this pull request may close these issues.

3 participants