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

22 Commits

Author SHA1 Message Date
Daniel Messer
a5ab170773 cache: handle cache value size limit in memcached (PROJQUAY-7239) (#2914)
* handle cache value size limit in memcached
* only print cache value for redis in debug logs on redis errors

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-24 10:26:53 +02:00
Kenny Lee Sin Cheong
be4edd02a3 cache: add caching for manifest requests (PROJQUAY-6482) (#2522) 2024-03-04 16:56:56 -05:00
Sunandadadi
6fc77823da Revert "api: add caching for get_repository method (PROJQUAY-6472)" (#2517)
Revert "api: add caching for get_repository method (PROJQUAY-6472) (#2515)"

This reverts commit 9c89e843f3.
2023-12-01 09:07:19 -05:00
Sunandadadi
9c89e843f3 api: add caching for get_repository method (PROJQUAY-6472) (#2515)
* api: add caching for get_repository method (PROJQUAY-6472)

* fixing formatting

* using pickle to serialize and deserialize objects

* adding model_cache parameter to lookup_repository func for interface and registry_proxy_model

* adding test

* formatting fix
2023-11-30 12:46:28 -05: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
Oleg Bulatov
7a487644e1 chore: use isinstance to check instance type (#2068) 2023-07-31 15:15:25 +00: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
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
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