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

chore: Add georeplication variable check (PROJQUAY-4363) #1499

Merged
merged 2 commits into from
Aug 30, 2022

Conversation

ibazulic
Copy link
Member

Previously, we didn't check for the presence of QUAY_DISTRIBUTED_STORAGE_PREFERENCE when FEATURE_STORAGE_REPLICATION was set to true. In certain situations, this would cause issues with what storage backend is being used during pushes. With this change, Quay will not allow execution unless preferred storage engine is explicitly defined.

Previously, we didn't check for the presence of `QUAY_DISTRIBUTED_STORAGE_PREFERENCE` when `FEATURE_STORAGE_REPLICATION` was set to `true`. In certain situations, this would cause issues with what storage backend is being used during pushes. With this change, Quay will not allow execution unless preferred storage engine is explicitly defined.
Previously, we didn't check for the presence of `QUAY_DISTRIBUTED_STORAGE_PREFERENCE` when `FEATURE_STORAGE_REPLICATION` was set to `true`. In certain situations, this would cause issues with what storage backend is being used during pushes. With this change, Quay will not allow execution unless preferred storage engine is explicitly defined.
@ibazulic ibazulic changed the title chore: Add georeplication variable check chore: Add georeplication variable check (PROJQUAY-4363) Aug 29, 2022
@@ -318,6 +318,14 @@ def _request_end(resp):
else:
docker_v2_signing_key = JsonWebKey.generate_key("RSA", 2048, is_private=True)

# Check if georeplication is turned on and whether env. variables exist:
if os.environ.get("QUAY_DISTRIBUTED_STORAGE_PREFERENCE") is None and app.config.get(
Copy link
Contributor

Choose a reason for hiding this comment

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

For my knowledge, why is one read from the config and the other from the environment variable? Is QUAY_DISTRIBUTED_STORAGE_PREFERENCE meant to be set somewhere else?

Copy link
Member Author

Choose a reason for hiding this comment

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

@bcaton85 the FEATURE_STORAGE_REPLICATION only enables the storagereplication worker. The QUAY_DISTRIBUTED_STORAGE_PREFERENCE is set as an env. variable to override default value for the storage engine that is used in a specific DC. You'd always want to use a local storage solution in the DC where Quay is running.

Copy link
Contributor

@bcaton85 bcaton85 left a comment

Choose a reason for hiding this comment

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

LGTM

@ibazulic ibazulic merged commit f4828fd into quay:master Aug 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants