Skip to content

mulled-build enhancements for dealing with quay.io timeouts/errors#22104

Open
bgruening wants to merge 6 commits intogalaxyproject:devfrom
bgruening:mulled_quay_enhancements
Open

mulled-build enhancements for dealing with quay.io timeouts/errors#22104
bgruening wants to merge 6 commits intogalaxyproject:devfrom
bgruening:mulled_quay_enhancements

Conversation

@bgruening
Copy link
Member

I was getting more and more timeouts during different build-stages of our containers dealing with quay.io API. My suspicion is that this is due to non-ideal handling of API requests to quay.io.

Before this change, mulled --check-published checked tagged images by fetching the full Quay repository metadata and inspecting all tags for that repository. This PR switches to a direct existence check for the exact namespace/repo:tag, reducing the lookup to a single tag in the common case. Some repos returned still some strange error codes for this new API route, so I retained a fallback to the old/current method.

I also tried to keep one session for all of our queries to quay.io.

I have tested this branch on BioContainers/multi-package-containers#3898 and it seems to work more reliably. But who knows, maybe I was just lucky.

@nsoranzo
Copy link
Member

It may be worth using https://pypi.org/project/requests-cache/ ?

@bernt-matthias Would you like to review this one?

@bgruening Let me know if you need help to fix the mypy errors.

bgruening and others added 2 commits March 13, 2026 18:05
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>
tag,
response.status_code,
)
repo_data = quay_repository(namespace, pkg_name, session=session)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How likely is that we end up here? Because we risk calculating this twice, once here then again in mull_targets() in the branch if "push" in command:

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not likely, but I could not find out why a few repos did not return tags.

Any idea how we can refactor it? Or cache the request?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Caching with https://pypi.org/project/requests-cache/ should be easy, you just need to change how you create the session. I'd put the cache file in Galaxy data_dir .

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you think about the latest commit? data_dir does not exist I think if you just run mulled-build from CLI.

Still seems to work on multi-package-containers

Co-authored-by: Björn Grüning <bjoern@gruenings.eu>
) from exc

if not isinstance(data, dict):
raise QuayApiException(f"Unexpected quay.io response type for {url}: {type(data).__name__}")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
raise QuayApiException(f"Unexpected quay.io response type for {url}: {type(data).__name__}")
raise QuayApiException(f"Unexpected quay.io response type for {url}: {type(data)}")

assert pkg_name is not None
assert tag is not None

url = f"{QUAY_REGISTRY_API_ENDPOINT}/{namespace}/{pkg_name}/manifests/{tag}"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't GET /api/v1/repository/{namespace}/{repo}/tag/{tag} be used?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Needs Review

Development

Successfully merging this pull request may close these issues.

3 participants