Commit graph

2265 commits

Author SHA1 Message Date
Joseph Schorr
2027d13d2b Change tag history call in OCI to not load the contents of the manifest
Just in case that load is slow on the DB
2019-03-08 14:59:33 -05:00
Joseph Schorr
0d6343871e Change the tags query used for OCI to list tags to be shallow
This removes the join on Manifest which was (possibly) causing the prod issue. We also simplify the lookup for pre-OCI as well, a bit.
2019-03-08 14:07:30 -05:00
Joseph Schorr
5d9b522e90 Fix an NPE on the repository API endpoint
Not all tags will have legacy images anymore
2019-03-07 14:40:16 -05:00
Joseph Schorr
23d8ecc3cc
Merge pull request #3401 from quay/fix-oci-tags-ordering
Fix ordering of tags in the OCI model
2019-03-07 13:58:26 -05:00
Joseph Schorr
96072a44c0 Fix ordering of tags in the OCI model
Before this change, we were neglecting to sort the tags by ID, which meant that pagination was broken
2019-03-07 12:53:02 -05:00
Joseph Schorr
b86d389c8e Add ability to restrict V1 push behind a namespace whitelist
Also enables the feature by default with an empty whitelist for QE

Fixes https://jira.coreos.com/browse/QUAY-1342
2019-03-05 17:33:32 -05:00
Joseph Schorr
bdae32630e Fix V1 push for layers already uploaded 2019-03-05 12:13:01 -05:00
Joseph Schorr
b9ec390ff6 Remove pre-defined Quay.io specific contact information
Fixes https://jira.coreos.com/browse/QUAY-1176
2019-02-28 15:40:23 -05:00
Joseph Schorr
1bf2875eca Hide all of the export log APIs when the feature is disabled 2019-02-26 14:41:00 -05:00
Joseph Schorr
66ddf66fb0
Merge pull request #3372 from quay/small-exception-fixes
Small exception fixes
2019-02-18 14:59:46 -05:00
Joseph Schorr
eef4094f56 Catch parsing errors in image API
Fixes https://sentry.io/organizations/coreos/issues/664440779/
2019-02-18 13:02:46 -05:00
Joseph Schorr
166fd671c8 Validate the namespace before looking it up
This will prevent unicode errors when trying to lookup unicode in the database

Fixes https://sentry.io/organizations/coreos/issues/628269769/?project=52148
2019-02-18 12:09:25 -05:00
Joseph Schorr
7690d5d495 Have the V2 registry endpoints raise Unauthorized with the proper header when anonymous access is disabled
Before this change, we'd raise a generic 401, which was breaking containerd and cri-o.

Fixes https://jira.coreos.com/browse/QUAY-1332
2019-02-15 15:29:57 -05:00
Joseph Schorr
69c306e740 Have blob mounting use the blob cache 2019-02-14 13:06:18 -05:00
Joseph Schorr
cac5f44d15 Improvements to health checks
- Adds a warning endpoint for warning-only checks
- Changes the default for the disk space check to 1%, instead of 10%
- Removes instance services from the overall health check endpoint
2019-02-04 13:17:59 -05:00
Joseph Schorr
d4c74bc1d3 Optimize listing of logs by changing to bucket by datetime, over which we have an index 2019-01-28 17:45:45 -05:00
Joseph Schorr
9f09d68ad8
Merge pull request #3323 from quay/joseph.schorr/QUAY-1282/log-interfacing
Interface out all action log data model operations
2019-01-28 15:09:25 -05:00
Joseph Schorr
b773a18ed8 Interface out all action log data model operations
This will allow us to reimplement the logs data model against a non-database system in the near future
2019-01-25 15:52:22 -05:00
Joseph Schorr
c0e6660ac9 Switch loading of the manifest contents to be lazy
We don't need the manifest returned by the tags API except for manifest lists, so just load it lazily
2019-01-22 16:50:42 -05:00
Joseph Schorr
bbfb0211dc Fix bug where we weren't properly caching enum values and we were always looking up the media type when constructing manifests 2019-01-22 14:46:38 -05:00
Joseph Schorr
5b4d39daa4 Remove the charset from the content type for manifests 2019-01-12 16:06:11 -05:00
Joseph Schorr
e78b5c5516 Add an additional short circuit to avoid parsing the manifest when not necessary for older Docker clients
We also add tests for this case
2019-01-11 16:37:23 -05:00
Joseph Schorr
7f068c3fc3 Skip parsing the manifest where applicable
Instead of always parsing (like we did previously), we now only parse the manifest if conversion is necessary. This should save significant CPU.
2019-01-11 15:24:21 -05:00
Joseph Schorr
eb9ca8e8a8 Fix handling of four byte utf8 manifests
- Adds the charset: utf-8 to all the manifest responses
- Makes sure we connect to MySQL in utf8mb4 mode, to ensure we can properly read and write 4-byte utf8 strings
- Adds tests for all of the above
2019-01-10 16:34:56 -05:00
Joseph Schorr
b1dd053b02 Fix an NPE when trying to pull a manifest without a legacy image via V1 2019-01-10 13:59:35 -05:00
Joseph Schorr
171c7e5238 Further fixes for unicode handling in manifests
We were occasionally trying to compute schema 2 version 1 signatures on the *unicode* representation, which was failing the signature check. This PR adds a new wrapper type called `Bytes`, which all manifests must take in, and which handles the unicodes vs encoded utf-8 stuff in a central location. This PR also adds a test for the manifest that was breaking in production.
2019-01-09 15:14:41 -05:00
Joseph Schorr
636f65cb81 Disable flaky test on MySQL 2019-01-04 16:37:02 -05:00
Joseph Schorr
e309508776 Change lookup of blobs to not use a subquery, which is murder on MySQL 2019-01-03 15:41:21 -05:00
Joseph Schorr
cdb49dbfd3 Add LogEntry3 table without the extra indexes and switch to writing to it 2019-01-03 13:50:43 -05:00
Joseph Schorr
b6db002729 Fix references to LogEntry model used and add support for a maximum page of results on the logs API 2019-01-02 16:04:15 -05:00
Joseph Schorr
204eb74c4f Put aggregated log query and log exports behind feature flags 2019-01-02 16:04:15 -05:00
Joseph Schorr
4ba4d9141b Put user last accessed updating behind a feature flag 2019-01-02 16:04:15 -05:00
Joseph Schorr
58d7dd07b9 Revert the changes to drop LogEntry2 table definition 2019-01-02 13:29:35 -05:00
Joseph Schorr
442312402f
Merge pull request #3299 from quay/joseph.schorr/QUAY-1233/batch-logs-download
Batch download of logs
2018-12-19 15:38:22 -05:00
Joseph Schorr
9190c046c7 Remove unusable sitemap endpoint
It calls a data model method which is extremely slow and heavy, and it isn't even used anyway
2018-12-18 16:37:09 -05:00
Joseph Schorr
8a212728a3 Implement a worker for batch exporting of usage logs
This will allow customers to request their usage logs for a repository or an entire namespace, and we can export the logs in a manner that doesn't absolutely destroy the database, with every step along the way timed.
2018-12-18 15:33:03 -05:00
Joseph Schorr
9e2c5417b8
Merge pull request #3310 from quay/joseph.schorr/QUAY-1235/drop-logentry2
Remove all references to LogEntry2 from the code
2018-12-18 15:18:22 -05:00
Joseph Schorr
71b7a2b3a2 Make command optional in schema 2 manifests (as per OCI spec) and pull out additional information
Also updates the manifest view page to show the comment or digest if there is no command defined
2018-12-11 17:23:39 -05:00
Joseph Schorr
6a94eba1a2 Remove all references to LogEntry2 from the code
The migration to actually drop the table will go in after this code has been pushed to production
2018-12-11 15:54:16 -05:00
Joseph Schorr
a9b8586423 Make sure list_manifest_layers is not callable for manifest lists 2018-12-11 13:10:24 -05:00
Joseph Schorr
7fa60d5802 Fix manifest UI display for manifests with empty layers
Also fixes the command for schema 2 manifests
2018-12-10 17:10:54 -05:00
Joseph Schorr
4106f5ce51 Fix manifest UI page to properly show the layers of manifests and show manifest lists 2018-12-10 15:33:59 -05:00
Joseph Schorr
3c2e050593 Support pulling of schema2 manifests directly via a manifest list tag
This change ensures that if a manifest list is requested with an accepts header for a *schema 2* manifest, the legacy manifest (if any) is returned as schema 2 if it was pushed as a schema 2 manifest (rather than being auto-converted to schema 1)
2018-12-07 11:57:13 -05:00
Joseph Schorr
c3710a6a5e Add ability for specific geographic regions to be blocked from pulling images within a namespace 2018-12-06 17:14:45 -05:00
Joseph Schorr
63f9043312 Code review small fixes 2018-11-28 12:56:16 +02:00
Joseph Schorr
4e1ff90cb2 Unify the get_layers calls across all implements of manifest schemas to ensure we have a common type returned
Also renames some methods to make it more clear what kind of information they return
2018-11-26 17:58:48 +02:00
Joseph Schorr
180d8847db Fix image replication for images with remote layers 2018-11-26 16:15:48 +02:00
Joseph Schorr
1f03fdb27e Fix pulling of squashed versions of the legacy image in a manifest lists 2018-11-20 16:37:15 +02:00
Joseph Schorr
1e4e424d64 Fix add tag operation in UI on manifests without legacy images 2018-11-20 16:37:15 +02:00
Joseph Schorr
c079add0df Don't return images if a tag does not have a legacy image 2018-11-19 23:33:37 +02:00