1
0
mirror of https://github.com/quay/quay.git synced 2026-01-26 06:21:37 +03:00

104 Commits

Author SHA1 Message Date
OpenShift Cherrypick Robot
1463ec2e35 [redhat-3.12] ci: fixing app type import (PROJQUAY-8991) (#4036)
ci: fixing app type import

Co-authored-by: bcaton <bcaton@redhat.com>
2025-06-11 09:09:16 -04:00
OpenShift Cherrypick Robot
7785b4defb [redhat-3.12] registry: index manifest artifact type for filtering (PROJQUAY-7471) (#3040)
registry: index manifest artifact type for filtering (PROJQUAY-7471)

Previous assumption made use of the config media type only, which is not the case
if a manifest's artifact type is explicitly set. i.e the config's media type and
artifact type are different, and the artifact type take precedence for filtering.

Co-authored-by: Kenny Lee Sin Cheong <kenny.lee28@gmail.com>
2024-07-17 14:41:55 +00:00
Sunandadadi
6688bcca09 backend: implement basic functionality (PROJQUAY-7076) (#2984)
* database: adding subject_backfilled index to manifest table (PROJQUAY-7360) (#2963)

adding subject_backfilled index to manifest table

* Rebasing with main

* updating cypress data

* fixing conflicts and rebasing with latest code

* adding tests

* Forcing an empty commit.

* Forcing an empty commit.

* skip_locked test fix

* adding tests

* minor fixes

---------

Co-authored-by: Brandon Caton <bcaton@redhat.com>
2024-06-27 16:48:39 -04:00
Brandon Caton
7ef664a646 autoprune: Registry level autopruning (PROJQUAY-7392) (#2950)
Allows for adding a default autopruning policy that will be applied to all namespaces.
2024-06-26 16:43:31 -04:00
Daniel Messer
e73d096b28 api: OCI compliant tag listing and pagination (PROJQUAY-6931) (#2884)
implement OCI compliant pagination and tag listing

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-13 11:28:02 +02:00
Kenny Lee Sin Cheong
4546163e83 registry: implements the OCI 1.1 referrers API (PROJQUAY-7280) (#2597)
* registry: implements the OCI 1.1 referrers API

Migrations:
- Adds a subject column for lookup
- Adds a subject_backfilled column to track status of the backfilling
of existing manifests
- Adds a manifest_json column making use of postgres' JSONB support,
for future use.

Manifestsubjectbackfillworker: Indexes existing manifests for possible
existing subject field.

* Deprecate IGNORE_UNKNOWN_MEDIATYPES

* Cleanup
2024-06-07 13:28:13 -04:00
Marcus Kok
dbfb47d6fb marketplace: change redhatsubscriptions model to return a list of customer ids (PROJQUAY-7129) (#2868)
* marketplace: change redhatsubscriptions model to return a list of customer ids (PROJQUAY-7129)

* Use list comprehension in model and expect to return None if no rows are
returned

* fix behavior for reconciler and fix unit test for reconciler
2024-05-09 11:51:06 -04:00
Marcus Kok
a69a450736 marketplace: change api call to return array of customer ids (PROJQUAY-7129) (#2867)
Changes marketplace api handler to now return a list of all web customer ids for a user.

Allows quay.io to keep track of all web customer ids instead of just personal types.
2024-05-09 09:31:02 -04:00
Sunandadadi
12aece5e87 logs: increase usage logs worker timeout (PROJQUAY-7008) (#2817) 2024-04-15 10:22:27 -04:00
Brandon Caton
d2a1fedab4 quota: refactor, tests, and optimizations (PROJQUAY-6735) (#2712)
Adds the following changes:
- Additional logging
- Moving checks before expensive DB calls
- Additional tests
2024-03-06 09:06:38 -05:00
Harish Govindarajulu
0be8cb7cb1 Add auto-prune tests + fix namespace autoprune policy UI issue (PROJQUAY-6773) (#2717)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2024-03-04 15:29:27 +00:00
Harish Govindarajulu
98811f5397 feat: Add auto-prune policy at repository level (PROJQUAY-6354) (#2691)
* feat: Add support for auto pruning at repository level (PROJQUAY-6354)

* Add repositoryautoprunepolicy table to alembic migration script

* Add repository auto-prune policy endpoints

* Add UI for repository auto-pruning policies

* case: apply repo auto-prune policy when no namespace policy given

* case: both namespace and repo pruning policy are given

* Add tests for repository autoprune endpoint

* Add cypress test for repository auto-prune

* Add repo auto-prune policy clean-up for repository deletion

* Add repository auto pruning tables to quay db snapshot for cypress tests

* Address review comments

* Add more tests + fix CI + reformat files

* Address review comments #2

---------

Signed-off-by: harishsurf <hgovinda@redhat.com>
2024-02-27 15:02:57 +05:30
Marcus Kok
2a4ac09306 billing: marketplace UI (PROJQUAY-6551) (#2595)
* billing: marketplace UI

adds UI in billing section for managing user and org-bound skus

add more unit tests for org binding

changed endpoint for bulk attaching skus to orgs
2024-01-11 11:48:38 -05:00
Marcus Kok
26451766ad marketplace: make sure customer id from api is returned as an int (PROJQUAY-233) (#2590)
* make sure customer id from api is returned as an int
2024-01-08 15:41:34 -05:00
Marcus Kok
1c893baba5 marketplace: update reconciliationworker to use webCustomerId instead of ebsAccountNumber (PROJQUAY-233) (#2582)
* update reconciliationworker to use webCustomerId instead of
ebsAccountNumber

* fix reconciler where it was incorrectly using the ebsAccountNumber to
  create subscriptions
* add job to reconciler so that it reconciles different ids between the
  database and the user api
* separate skus to be used by billing and skus to be used by reconciler
2024-01-05 16:15:37 -05:00
Marcus Kok
79723f1ce3 marketplace: add exception handling for reconciler (PROJQUAY-233) (#2560)
* add exception handling for reconciler
2023-12-15 12:32:44 -05:00
Brandon Caton
fa8aaa328f autoprune: background worker (PROJQUAY-6095) (#2402)
Implementation of the background worker for namespace auto-pruning.

Co-authored-by: Sunanda Dadi <Sunandadadi@users.noreply.github.com>
2023-10-16 16:45:20 -04:00
Brandon Caton
0e496b46a5 autoprune: add initial setup for the autoprune feature (PROJQUAY-6094) (#2277)
Adds the auto-prune worker, database models, and feature flag.
2023-10-05 13:37:36 -04:00
Oleg Bulatov
84fa795ae7 chore: fix isort config and remove isort: skip_file (#2196)
* chore: pass config to isort as it doesn't always detect it

* chore: mark package "test" as local, not stdlib

* chore: remove "isort: skip_file"

* chore: fix app in test_load_security_information

* chore: fix app in test_notification

* chore: fix app in test_index_report
2023-09-21 11:46:03 -04:00
Brandon Caton
d453882bd0 quota: fixing registry total worker failing to start (PROJQUAY-6010) (#2217)
Fixes import in the registry total worker.
2023-09-08 13:10:56 -04:00
Marcus Kok
e44783fe19 billing: Assign SKU to org (PROJQUAY-5363) (#1989)
* add migration for orgrhskus table

* add endpoints for managing and listing skus bound to an org

* create checks in billing flow to look for org-bound skus

* refactor RH marketplace api objects to be more usable in tests

* update cypress test db data and exclude it from pre-commit hook formatting
2023-08-25 14:52:54 -04:00
Kenny Lee Sin Cheong
5f63b3a7bb chore: drop deprecated tables and remove unused code (PROJQUAY-522) (#2089)
* chore: drop deprecated tables and remove unused code

* isort imports

* migration: check for table existence before drop
2023-08-25 12:17:24 -04:00
Kenny Lee Sin Cheong
0ea4826956 secscan: garbage collect manifests (#1663)
Garbage collect manifests no longer referenced in Quay from the
security scanner service.

Also moved quota related code from data/registry_model/ to data/model/
to avoid circular dependencies.
2023-07-06 11:59:47 -04:00
Marcus Kok
de8c48fa28 marketplace: fixing allowed repo count (PROJQUAY-5513) (#1891)
* Aggregate stripe plans and subscriptions.

* Validate end date for subscriptions when fetching from marketplace.

* Check subscription returned from stripe api is non-null value when
finding stripe plan for sku.
2023-05-25 10:46:58 -04:00
Brandon Caton
6cf0a3531b quota: calculating registry size (PROJQUAY-5476) (#1879)
Allows superusers to trigger a calculation of the deduplicated registry size. A superuser can go to the organization panel of the superuser page and select Calculate to queue a calculation of the registry total. The total will only be calculated when requested. Includes warning to user of increase of database load when running calculation.
2023-05-24 17:10:40 -04:00
Brandon Caton
e6f2dc3354 quota: excluding robots from quota total (PROJQUAY-5469) (#1871)
Adding quotatotalworker to config services / excluding robots from quota total
2023-05-10 14:54:57 -04:00
Marcus Kok
0a1c7fb22e marketplace: add reconciler (PROJQUAY-5320) (#1817)
marketplace: add reconciler (PROJQUAY-5320)
* check RH marketplace after stripe for private repo creation / changing visibility
* add reconciliation worker that creates RH subscriptions in marketplace for pre-existing stripe customers
2023-05-08 09:48:17 -04:00
Kenny Lee Sin Cheong
c0efc75207 storagereplication: add retry logic without exhausting queue retries (PROJQUAY-4793) (#1832)
Allow the replication worker to retry immediately without having to
wait and exhaust the queueitem's retries. This addresses transient
unreliable storage service issues.
2023-05-04 16:43:40 -04:00
Brandon Caton
a2c379d47c quota: Include blob deduplication in totals (PROJQUAY-3942) (#1751)
Allows for only unique blobs are counted at the namespace and repository level. Calculation includes manifest list sizes.
Add's the following internal configurations that default to true:
QUOTA_INVALIDATE_TOTALS: Invalidates calculated totals when FEATURE_QUOTA_MANAGEMENT is set to false
RESET_CHILD_MANIFEST_EXPIRATION: Resets the expiry for child manifests on push of the manifest list for immediate GC eligibility
PERMANENTLY_DELETE_TAGS: Enables features related to the permanent deletion of tags outside the configured time machine window
2023-05-01 16:40:01 -04:00
Kenny Lee Sin Cheong
2e5f25726a storagereplication: sleep on unexpected exception for retry (PROJQUAY-4792) (#1792) 2023-03-27 12:06:10 -04:00
Oleg Bulatov
15ea8350db repomirror: Use skopeo list-tags to get repo tags (PROJQUAY-2179) (#1427)
* repomirror: Use skopeo list-tags to get repo tags

`skopeo inspect foo` returns infromation about the image `foo:latest`,
and repository tags. Quay needs only list of tags, so it should use
`skopeo list-tags` that doesn't fail if `foo:latest` doesn't exist.

* Update type hints

* On local-dev Quay does not provide valid TLS certificate
2022-10-12 09:45:04 -04:00
Brandon Caton
679380b99f mirror: Rollback failed tags (PROJQUAY-4322) (#1496)
Currently Quay creates tags for Docker V2 schema 1 manifests in manifest lists. This makes it appear a tag was mirrored successfully when it had actually failed. This change rolls back those failed tags when the sync fails.
2022-08-29 09:18:00 -04:00
Brandon Caton
30298699fc mirror: Default mirror rollback to false (PROJQUAY-4296) (#1490)
Adds the `REPO_MIRROR_ROLLBACK` option to specify whether the mirror will rollback the state of the repo on failure of any one of the tags. Defaults to false. Adds additional `PARTIAL_SYNC` error status which logs the tags that failed to sync to the console.
2022-08-23 14:27:22 -04:00
Brandon Caton
9eb4fb6aa4 Revert workqueue refactor (#1456)
Currently the prometheus and GC workers are not running correctly.
Reverting the following commits:
- 4e1a985e70
- dac183a1ef
- 68a0d9eaf0
- af1aacea08
- f334b80098
2022-07-22 13:11:39 -04:00
Kenny Lee Sin Cheong
26a334f5d8 mirroring: fix mirror claims for multiple processes (PROJQUAY-3982) (#1433)
Previous logic for claiming mirror ("locking") relied on the value
returned from updating the database row. Since this was always being
updated with a new expiration time, it would always succeed, even when
another process had already claimed the same mirror.
2022-07-11 11:15:04 -04:00
Oleg Bulatov
dac183a1ef Replace app with singletons.config and workqueues (#1399)
Where it is possible, instead of importing app, import only required
packages.
2022-06-20 12:07:13 +02:00
Oleg Bulatov
af1aacea08 Remove app from GunicornWorker (#1394)
Quay uses GunicornWorker to run background workers in the development
environment. It is not expected to serve any HTTP server.
2022-06-17 13:34:05 +02:00
Oleg Bulatov
f334b80098 Reduce memory usage by notificationworker (#1370) 2022-06-16 18:44:13 +02:00
Oleg Bulatov
5eaf0584db chore: Run mypy as CI job (#1363)
* Run mypy as CI job

* Fix peewee.pyi and configure pyright
2022-06-13 11:01:17 +02:00
Kenny Lee Sin Cheong
f3c3916bc7 secscan: add option to skip recent manifest batch lock (PROJQUAY-3501) (#1299)
Having only one worker index recent manifest doesn't keep up with the
rate new manifests being pushed, given the time it takes for an index
request to complete. Adding the option to bypass the global lock
allows for more workers, but also increase the chance of duplicate work.
2022-05-03 11:21:23 -04:00
Kenny Lee Sin Cheong
72c8d7a3c5 secscan: fix config reference (PROJQUAY-3501) (#1283) 2022-04-25 11:49:21 -04:00
Kenny Lee Sin Cheong
ed77147b21 secscan: split indexing of recent manifest into separate background operation (PROJQUAY-3501) (#1281)
Index recent manifests in a separate background process, allowing the
main process to correctly select random slabs from the entire table
set and marking them completed in the allocator (rbtree). This avoids
the worker having to start iterating from the beginning of the table
whenever it is restarted.
2022-04-25 11:21:45 -04:00
Kenny Lee Sin Cheong
a9e1b71a2c secscan: fix missing import (PROJQUAY-3501) (#1261) 2022-04-19 16:07:32 -04:00
Kenny Lee Sin Cheong
922892d1af secscan: configure global lock (PROJQUAY-3501) (#1255) 2022-04-19 15:06:52 -04:00
Kenny Lee Sin Cheong
d719dfadc5 secscan: optimize deduplicating manifests for indexing in securityworker (PROJQUAY-3501) (#1247)
Acquire lock on recent manifests batch to prevent multiple workers
from working on the same set.
2022-04-19 11:34:53 -04:00
Brandon Caton
d2e758dad5 mirror: Get all tags during rollback (PROJQUAY-3146) (#1244)
During a rollback the mirror worker checks for new tags that were created in the repository in the time that the mirror operation has been running. If it encounters older tags that have been updated it will attempt to create a new tag that will point to the previous manifest. Currently for large lists of tags this will fail since we only retrieve the 100 latest tags. The mirror worker will never reach the tags that have been updated and will never recreate them, leading to the behavior of deleting tags during a rollback.
2022-04-14 09:11:48 -04:00
Kenny Lee Sin Cheong
dd1eab5238 Revert "secscan: add a global lock on security worker runs (PROJQUAY-3501) (#1226)" (#1232)
This reverts commit 9d89b6fa47.
2022-04-06 11:27:06 -04:00
Kenny Lee Sin Cheong
9d89b6fa47 secscan: add a global lock on security worker runs (PROJQUAY-3501) (#1226)
Add a global lock on security worker iterations, based on the value of
the current pagination token. This is to avoid multilple worker
processes possibly doing work on the same set of manifests.
2022-04-05 13:26:06 -04:00
Brandon Caton
ef91c57c23 format: Updating black to resolve click dependency issue (PROJQUAY-3487) (#1209)
Currently the CI breaks due to a dependency of black, `click`, breaking with it's latest release with `ImportError: cannot import name '_unicodefun' from 'click'`. Since black does not pin it's version of click it pulls in the latest version containing the breaking change and fails the CI check. This updates black with the patch. [See the original issue here.](https://github.com/psf/black/issues/2964) The rest of the changes are format updates introduced with the latest version of black.
2022-03-29 15:34:57 -04:00
Brandon Caton
0d3ecb132e imagemirror: Add unsigned registries mirror option (PROJQUAY-3106) (#1085)
Currently when attempting to mirror a registry containing unsigned images the mirror will fail due to not finding the source signature. This is caused by the updated version of Skopeo blocking unsigned images by default. This allows users to specify the ability to pull unsigned images per-repository. The Skopeo version is also now pinned.
2022-02-04 13:10:19 -05:00