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

25 Commits

Author SHA1 Message Date
OpenShift Cherrypick Robot
1c85c563b9 chore: use isinstance to check instance type (#2070)
Co-authored-by: Oleg Bulatov <oleg@bulatov.me>
2023-07-31 23:43:41 +02:00
Flavian Missi
5987534718 endpoints/v2: handle generic proxy related errors (#1213)
also add upstream registry to proxy cache key. if a user changes their
mind about what registry to proxy, we shouldn't try to reuse the token.
2022-03-30 15:30:05 +02: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
Flavian Missi
fe4d66b030 feat: pull-thru proxy cache (#1053)
introduces the possibility to pull images from external registries
through Quay, storing them locally for faster subsequent pulls.

Closes PROJQUAY-3030 and PROJQUAY-3033
2022-03-23 17:20:00 +01:00
Kenny Lee Sin Cheong
033c1aafa1 ui: display manifest list manifest sizes (PROJQUAY-3196) (#1115)
Display individual manifest size in manifest list view.
Also fixes a non-cluster Redis cache bug.

TODO: This requires making extra individiual requests to get the
children manifests. They should probably be cached.
2022-03-01 16:07:28 -05:00
mosen
fca67e7729 feat: mypy type annotations (PROJQUAY-740) (#455)
* Add dev dependencies mypy and typing

* Add makefile target `types-test`, not yet included in `test` target.

* Generate stubs for imported modules to avoid mypy complaining about missing types.

* Remove generated stubs as there are way too many and they cause tons of mess in the repo. Switched to ignoring untyped modules for now, to concentrate on Quay-only type checking.

* mypy config changed to ignore missing imports

* ignore property decorator as it is not supported by mypy

* mypy annotations for many configuration variables

* re-generate mypy_stubs directory as its necessary in some classes for base classes to prevent mypy errors

* util/registry/queuefile referred to non existent definition of Empty class in multiprocessing.queues

* ignore type checking for things like monkey patching and exported/re-imported objects that 
mypy does not allow.

* Adjust mypy config to warn us about unreachable return paths and useless expressions.

* Add the __annotations__ property to INTERNAL_ONLY_PROPERTIES so that it is not part of the config schema testing

* Remove redundant dependencies `typing` and `typing-extensions` which are NOOP after Python 3.5

* Remove mypy-extensions which only provides a TypedDict implementation but has not been updated since 2019.

* updated mypy to 0.910 which requires all types packages to be installed manually.

* exclude local-dev from type checking until core team can suggest an outcome for __init__.py duplicate packages

* re-add typing dependency which will be needed until Python 3.9

* ignore .mypy_cache

* add mypy stub for features module to replace inline definitions

* import annotations eager evaluation in billing.py as it was required to reference a class declared later in the module.

* remove the type definition of V1ProtocolSteps/V2ProtocolSteps to make tox happy
2021-10-25 09:56:26 +02:00
Kenny Lee Sin Cheong
ccf6ada16a cache: handle uncaught redis exception (PROJQUAY-2614) (#907)
- Handles uncaught client exceptions so that Quay is able to fallback to
querying the database.
- Also updates the redis library version to address
https://github.com/Grokzen/redis-py-cluster/issues/370
2021-10-13 10:41:23 -04:00
Syed Mushtaq Ahmed
3dde364615 cache: py2 compatibility, kwargs after named args (PROJQUAY-2101) (#859)
Fix compaitbily with the py2 quayio branch. move the kwargs at the
end of the call
2021-08-03 10:34:44 -04:00
Kenny Lee Sin Cheong
0999baa29e chore: fix rediscluster cache config key name (PROJQUAY-2101) (#849)
Look for "rediscluster" instead of "redis-cluster" in the cache config.
2021-07-23 15:40:29 -04:00
Kenny Lee Sin Cheong
cd6871c14f cache: add support for redis cluster mode (PROJQUAY-2101) (#810)
Adds support to use redis in cluster mode when using redis instead of
memcached for caching.
2021-07-22 12:25:46 -04:00
Syed Mushtaq Ahmed
b33f125c58 modelcache: Add read and write endpoints to Redis (PROJQUAY-1939) (#795)
Adds `read_client` and `write_client` to Redis ModelCache to separate out read
and write calls to different endpoints
2021-05-20 16:04:36 -04:00
Syed Mushtaq Ahmed
df4ad94527 modelcache: Make ModelCache TTL configurable (PROJQUAY-1878) (#765)
Adds a configuration option to modify the cache expiry timeout
for ModelCache objects

Co-authored-by: Syed <syed@apache.org>
2021-04-28 10:46:32 -04:00
Alec Merdler
1180ea99fa cache: remove GlobalLock from redis model cache (PROJQUAY-1902) (#755)
Remove GlobalLock from Redis model cache implementation in
favor of 'nx=True' when setting the key.

Signed-off-by: Alec Merdler <alecmerdler@gmail.com>
2021-04-19 19:06:18 -07:00
Alec Merdler
780685c490 cache: add Redis model cache implementation (PROJQUAY-788) (#444)
Adds implementation of DataModelCache interface backed by Redis.
All containers in a Quay cluster deployment will share a single
model cache, rather than each container using its own cache.

Signed-off-by: Alec Merdler <alecmerdler@gmail.com>
2021-04-15 10:31:42 -07:00
Kurtis Mullins
bd7252c536 [PROJQUAY-1021] task: Update "Black" to version 20.8b1 2020-11-30 18:48:19 -05:00
Joseph Schorr
a7210edc6a Turn off ignore_exc in memcache cache to fix an NPE (#472)
The PooledCache implementation incorrectly returns `None` instead of
the default if an exception occurs, but `None` is a valid cached value,
so we instead catch the exceptions ourselves now and skip the caching
code if we encounter an exception
2020-07-08 14:41:36 -04:00
Joseph Schorr
1b083d7d51 Add caching support for app registry show package call (#460) 2020-06-26 12:36:59 -04:00
Joseph Schorr
9a9608de3f Adds a pre-disconnect option to memcache (#459)
Add a config option for configuring whether to pre-disconnect from the
DB before making a memcache call
2020-06-25 16:08:36 -04:00
Joseph Schorr
8c39691538 Ensure we are passing an int for the memcache pool size (#458) 2020-06-25 13:10:17 -04:00
Joseph Schorr
a25ed4cb9e Change memcache implementation to use a connection pool (#457) 2020-06-25 11:46:53 -04:00
Joseph Schorr
8ff86175b8 Fix handling of client connections in pymemcache cache (#433)
pymemcache is apparently not thread safe, so our reuse of the client
was causing the occasional hang on read. This change has us open a new
connection per request, and then close it once complete. We also make
sure to close the DB connection before making the memcache connection,
in case the memcache connection takes a bit of time

We should investigate switching to the PooledClient library for reusing
connections (safely) once we verify this change works
2020-06-10 13:19:23 -04:00
Joseph Schorr
9833713b0c Add caching for app registry listing package API (#374)
Fixes https://issues.redhat.com/browse/PROJQUAY-670
2020-05-18 11:07:11 -04:00
alecmerdler
3dd5f045ff fix all the docstrings 2020-02-05 19:55:07 -08:00
Tom McKay
e6ae94db8b 'make black' results 2019-12-02 12:23:08 -05:00
Jimmy Zelinskie
9c0dd3b722 initial import for Open Source 🎉 2019-11-12 11:09:47 -05:00