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

37 Commits

Author SHA1 Message Date
Ryan Wallace
a06cc6fa43 chore: update all black versions to 24.4.2 and run make black (#4754)
* chore(pre-commit): match black version with requirements-dev

* run `make black` against repo

* ci: switch to black 24.4.2

* fix: py312

* fix: flake8 errors

* fix: flake8 conflicts

* chore: add git blame ignore revs file
2025-12-19 11:29:53 -06:00
jbpratt
08153b6660 chore: CI runtime improvements (#4586)
* chore: update ci to use new large ubuntu 24.04 runner

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-Authored-By: Dave O'Connor <doconnor@redhat.com>

* fix: add libfreetype6-dev for Ubuntu 24.04 compatibility

The reportlab package requires FreeType development headers to build.
On Ubuntu 24.04, this dependency is not pulled in transitively and
must be explicitly installed. This fixes the "cannot find ft2build.h"
build error.

Added libfreetype6-dev to all jobs that install system dependencies
in CI.yaml and CI-nightly.yaml workflows.

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-Authored-By: Dave O'Connor <doconnor@redhat.com>

* chore: set the TEST_DATETIME to a static value

this caused an issue in xdist when generating test names

Signed-off-by: Brady Pratt <bpratt@redhat.com>

* chore: cache pip packages in CI

Signed-off-by: Brady Pratt <bpratt@redhat.com>

* chore: run registry tests with -n auto

Signed-off-by: Brady Pratt <bpratt@redhat.com>

* chore: run psql with -n auto

Signed-off-by: Brady Pratt <bpratt@redhat.com>

* chore: add file locking to prevent parallel test db init race condition

When running pytest -n auto with multiple workers, both workers would
simultaneously execute populate_database(), causing duplicate key
violations on shared tables like imagestoragelocation:

Worker 1: Check if User "devtable" exists → No → Start populating
Worker 2: Check if User "devtable" exists → No → Start populating
Both: INSERT INTO imagestoragelocation (name) VALUES ('local_eu')
Result: IntegrityError - duplicate key violation

Solution: Wrap init_db_path fixture with FileLock to ensure only one
worker initializes the database at a time. The lock file is created
in pytest's shared temp directory, coordinating across all workers.

- First worker acquires lock and populates database
- Subsequent workers wait at lock, then see database is already
  populated (via User.get() check in populate_database())
- Works for both PostgreSQL and MySQL
- 300-second timeout prevents deadlocks

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>

* chore: run mysql with -n auto

Signed-off-by: Brady Pratt <bpratt@redhat.com>

---------

Signed-off-by: Brady Pratt <bpratt@redhat.com>
Co-authored-by: Dave O'Connor <doconnor@redhat.com>
Co-authored-by: Claude <noreply@anthropic.com>
2025-11-20 09:01:18 -05:00
Shubhra Deshpande
d10032d27c bug: Add configurable timeout to Splunk HEC requests (PROJQUAY-9375) (#4248)
Add configurable timeout to Splunk HEC requests

Co-authored-by: shudeshp <shudeshp@redhat.com>
2025-09-08 14:57:09 -04:00
Brandon Caton
cc5663b5f2 usagelogs: increasing elasticsearch conn timeout (PROJQUAY-9061) (#4246) 2025-09-08 14:22:57 -04:00
Jonathan King
6c358ce3d8 splunk: only raise error when ALLOW_WITHOUT_STRICT_LOGGING is unset (PROJQUAY-8595) (#4082)
Co-authored-by: Jonathan <jonathan@Jonathans-MacBook-Pro.local>
2025-06-18 19:10:54 +00:00
Jonathan King
753977a130 fix: do not fail on splunk errors when flag set (PROJQUAY-8595) (#3757) 2025-06-10 09:14:17 -04:00
Syed Ahmed
723102e641 build: move quay to python 3.12 (PROJQUAY-8800) (#3780)
Move Quay to python version 3.12 and switch out rehash with the resumable hash library.
2025-05-29 09:35:48 -04:00
Marcus Kok
de9f42c2cc chore: Revert "cve: upgrade elasticsearch and elasticsearch-dsl to 8.13.0 (PROJQUAY-6962)" (PROJQUAY-6962) (#3449)
Revert "cve: upgrade elasticsearch and elasticsearch-dsl to 8.13.0 (PROJQUAY-…"

This reverts commit fb95c90574.
2024-12-04 13:06:13 -05:00
Marcus Kok
fb95c90574 cve: upgrade elasticsearch and elasticsearch-dsl to 8.13.0 (PROJQUAY-6962) (#3418)
* upgrade elasticsearch and elasticsearch-dsl to 8.13.0
* update tests and elasticsearch logs to handle new major version
* pinning elasticsearch-transport according to check requirements.txt test
2024-12-02 09:50:42 -05:00
Daniel Messer
99d571a4a6 logs: allow without strict logging (PROJQUAY-7116) (#2846)
* allow to disable strict logging in general

Signed-off-by: dmesser <dmesser@redhat.com>

* add strict logging exceptions for log kinds during reads

Signed-off-by: dmesser <dmesser@redhat.com>

* add strict logging exceptions for log kinds during reads

Signed-off-by: dmesser <dmesser@redhat.com>

* formatting

Signed-off-by: dmesser <dmesser@redhat.com>

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2024-06-17 21:17:39 +02:00
Daniel Messer
3248a72da6 logs: adding support for Splunk HTTP Event collectors as producers (PROJQUAY-7124) (#2855)
adding support for Splunk HTTP Event collectors as producers

Signed-off-by: dmesser <dmesser@redhat.com>
2024-05-31 11:58:15 +02: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
Daniel Messer
e1e8dc8efb audit: ignore errors due to read-only mode in audit logs (PROJQUAY-5598) (#1928)
* ignore errors due to read-only mode in audit logs

Signed-off-by: dmesser <dmesser@redhat.com>

* remove superfluous ReadOnlyMode handling

Signed-off-by: dmesser <dmesser@redhat.com>

* add debug log messae

Signed-off-by: dmesser <dmesser@redhat.com>

---------

Signed-off-by: dmesser <dmesser@redhat.com>
2023-06-16 12:08:27 +02:00
Harish Govindarajulu
3fd695cf86 logs: Add autologin to splunk's connect() to allow retries (PROJQUAY-5621) (#1956)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2023-06-08 13:29:35 -04:00
Oleg Bulatov
f5be32d840 logs: ssl_ca_path should be optional (PROJQUAY-4993) (#1913) 2023-06-02 13:42:27 +02:00
Harish Govindarajulu
490a6b2ce8 logs: Add SSL cert support and test coverage for splunk logging (PROJQUAY-4993) (#1878)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2023-05-19 16:24:13 -04:00
Harish Govindarajulu
be1bddfd6a feat: Allow action logs to be forwarded to Splunk (PROJQUAY-4993) (#1764)
Signed-off-by: harishsurf <hgovinda@redhat.com>
2023-03-30 13:33:55 -04:00
Kenny Lee Sin Cheong
ed86a102ce logs: validate date range is within configuration (PROJQUAY-4959) (#1707) 2023-01-17 12:04:57 -05: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
Oleg Bulatov
cf52f5e371 chore: Use Python 3.9 (#1382)
* Use Python 3.9

* Adapt code for Python 3.9
2022-06-20 14:05:47 +02:00
Oleg Bulatov
68a0d9eaf0 Initialize database and log_model on their import (#1396) 2022-06-17 18:36: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
Flavian Missi
d20542aa45 fix several warnings (#1374)
mostly invalid escape sequences
2022-06-10 11:46:56 +02:00
Kenny Lee Sin Cheong
7d9a49da10 Replace jwkest with authlib (#685)
* Replace jwkest with authlib and PyCrypto with cryptography

Remove pycryptodome dependencies.
Remove post-fork random seed init - python-cryptography's pseudo RNG should be fork safe:
- https://cryptography.io/en/latest/security.html?highlight=fork
- https://cryptography.io/en/latest/hazmat/backends/openssl.html?highlight=fork#os-random-engine

* deps: Pin cryptography to 3.3.1

Latest available version available on RHEL.
As of 3.4, cryptography builds on rust, which is not readily available
on RHEL.
2021-03-15 15:25:23 -04:00
Kurtis Mullins
bd7252c536 [PROJQUAY-1021] task: Update "Black" to version 20.8b1 2020-11-30 18:48:19 -05:00
Kenny Lee Sin Cheong
5e03c4c1b6 Use days instead of weeks to represent a month worth of time (#549)
* Use days instead of weeks to represent a month worth of time

* Returns 400 on bad date ranges
2020-09-09 14:31:44 -04:00
Kenny Lee Sin Cheong
0c65f88a0e json loads fix: given arg should be a str (#527) 2020-08-19 17:47:19 -04:00
Kenny Lee Sin Cheong
27c6e2b99b Reduce log noise from fallbacks in executor (#526) 2020-08-19 16:24:10 -04:00
Kenny Lee Sin Cheong
a16124e6bf Handles out of range pagination token datetime (#517)
Check that "after_datetime" token used for pagination is smaller than the given starting datetime when doing a lookup
2020-08-11 14:49:32 -04:00
Kenny Lee Sin Cheong
ac70f6b5eb Add an extra "metadata" field to Elasticsearch logentries (#504)
* Add an extra "metadata" field to Elasticsearch logentries

The current "metadata_json" field is stored as a text field, and
cannot be searched easily. "metadata" will store the given dict as a
dynamically mapped Object type.

* Remove duplicate "metadata_json" field in Elasticsearch

Instead, json dumps the "metadata" field for the Log datatype.
2020-08-06 12:03:30 -04:00
Kurtis Mullins
f1237bdb29 [PROJQUAY-753] Reduce logging noise (#445) 2020-06-18 13:54:20 -04:00
Kurtis Mullins
38be6d05d0 Python 3 (#153)
* Convert all Python2 to Python3 syntax.

* Removes oauth2lib dependency

* Replace mockredis with fakeredis

* byte/str conversions

* Removes nonexisting __nonzero__ in Python3

* Python3 Dockerfile and related

* [PROJQUAY-98] Replace resumablehashlib with rehash

* PROJQUAY-123 - replace gpgme with python3-gpg

* [PROJQUAY-135] Fix unhashable class error

* Update external dependencies for Python 3

- Move github.com/app-registry/appr to github.com/quay/appr
- github.com/coderanger/supervisor-stdout
- github.com/DevTable/container-cloud-config
- Update to latest mockldap with changes applied from coreos/mockldap
- Update dependencies in requirements.txt and requirements-dev.txt

* Default FLOAT_REPR function to str in json encoder and removes keyword assignment

True, False, and str were not keywords in Python2...

* [PROJQUAY-165] Replace package `bencode` with `bencode.py`

- Bencode is not compatible with Python 3.x and is no longer
  maintained. Bencode.py appears to be a drop-in replacement/fork
  that is compatible with Python 3.

* Make sure monkey.patch is called before anything else (

* Removes anunidecode dependency and replaces it with text_unidecode

* Base64 encode/decode pickle dumps/loads when storing value in DB

Base64 encodes/decodes the serialized values when storing them in the
DB. Also make sure to return a Python3 string instead of a Bytes when
coercing for db, otherwise, Postgres' TEXT field will convert it into
a hex representation when storing the value.

* Implement __hash__ on Digest class

In Python 3, if a class defines __eq__() but not __hash__(), its
instances will not be usable as items in hashable collections (e.g sets).

* Remove basestring check

* Fix expected message in credentials tests

* Fix usage of Cryptography.Fernet for Python3 (#219)

- Specifically, this addresses the issue where Byte<->String
  conversions weren't being applied correctly.

* Fix utils

- tar+stream layer format utils
- filelike util

* Fix storage tests

* Fix endpoint tests

* Fix workers tests

* Fix docker's empty layer bytes

* Fix registry tests

* Appr

* Enable CI for Python 3.6

* Skip buildman tests

Skip buildman tests while it's being rewritten to allow ci to pass.

* Install swig for CI

* Update expected exception type in redis validation test

* Fix gpg signing calls

Fix gpg calls for updated gpg wrapper, and add signing tests.

* Convert / to // for Python3 integer division

* WIP: Update buildman to use asyncio instead of trollius.

This dependency is considered deprecated/abandoned and was only
used as an implementation/backport of asyncio on Python 2.x
This is a work in progress, and is included in the PR just to get the
rest of the tests passing. The builder is actually being rewritten.

* Target Python 3.8

* Removes unused files

- Removes unused files that were added accidentally while rebasing
- Small fixes/cleanup
- TODO tasks comments

* Add TODO to verify rehash backward compat with resumablehashlib

* Revert "[PROJQUAY-135] Fix unhashable class error" and implements __hash__ instead.

This reverts commit 735e38e3c1d072bf50ea864bc7e119a55d3a8976.
Instead, defines __hash__ for encryped fields class, using the parent
field's implementation.

* Remove some unused files ad imports

Co-authored-by: Kenny Lee Sin Cheong <kenny.lee@redhat.com>
Co-authored-by: Tom McKay <thomasmckay@redhat.com>
2020-06-05 16:50:13 -04:00
Joseph Schorr
076d7ddd01 Freeze time in the combined logs model tests to remove flakes (#302) 2020-04-03 11:01:51 -04:00
alecmerdler
3dd5f045ff fix all the docstrings 2020-02-05 19:55:07 -08:00
Joseph Schorr
db2eefcb7e Fix the assertion in lookup of logs by namespace
Adds additional testing and assertions as well

Fixes https://issues.redhat.com/browse/QUAY-2239
2020-01-05 18:15:02 +02: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