Skip to content

[PULP-2416] Stream proxied S3 and Azure artifacts - #8364

Open
dralley wants to merge 5 commits into
pulp:mainfrom
dralley:streaming-fix-backup
Open

dralley wants to merge 5 commits into
pulp:mainfrom
dralley:streaming-fix-backup

Conversation

@dralley

@dralley dralley commented Nov 20, 2026

Copy link
Copy Markdown
Contributor

Avoid unnecessary buffering of large files by taking advantage of a streaming API in forked django-storages.

closes #7806

📜 Checklist

  • Commits are cleanly separated with meaningful messages (simple features and bug fixes should be squashed to one commit)
  • A changelog entry or entries has been added for any significant changes
  • Follows the Pulp policy on AI Usage
  • (For new features) - User documentation and test coverage has been added

See: Pull Request Walkthrough

@dralley dralley closed this Nov 20, 2026
@dralley dralley reopened this Nov 20, 2026
@dralley
dralley force-pushed the streaming-fix-backup branch 4 times, most recently from 06d090a to 68994ae Compare November 25, 2026 06:29
@dralley
dralley marked this pull request as ready for review November 25, 2026 06:29
@dralley
dralley requested a review from mdellweg November 25, 2026 06:30
@dralley dralley changed the title [PULP-2416] Stream proxied S3 and Azure artifacts [DO NOT MERGE][PULP-2416] Stream proxied S3 and Azure artifacts Nov 25, 2026
@dralley
dralley marked this pull request as draft November 25, 2026 06:34
@dralley

dralley commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

I'll leave this as draft just to make sure nobody merges it.

@dralley dralley changed the title [DO NOT MERGE][PULP-2416] Stream proxied S3 and Azure artifacts [PULP-2416] Stream proxied S3 and Azure artifacts Nov 25, 2026
@dralley
dralley force-pushed the streaming-fix-backup branch 2 times, most recently from 2afcda8 to 679196c Compare November 25, 2026 16:43
@dralley
dralley marked this pull request as ready for review December 1, 2026 03:57
@dralley
dralley force-pushed the streaming-fix-backup branch from 679196c to 92c46a0 Compare December 1, 2026 04:03
Serve proxied artifacts without buffering the remote files. django-storages
buffers files to provide a seekable interface, but this is unnecessary
for the streaming use case.

Keep synchronous storage I/O off the content application event loop.

closes pulp#7806

Assisted By: Codex (GPT-5) Terra 5.6
Bundle the backend source in the pulpcore distribution and retain
optional provider dependencies for S3, Azure, and GCS deployments.
Move the vendored backends under Pulp's package namespace so they cannot
collide with an independently installed django-storages package.

Update built-in backend mappings, test settings, and operator guidance to
use the new import paths while preserving legacy Domain storage_class values.

Assisted By: Codex (GPT-6)
Map the vendored compatibility path to Pulp's S3 backend so the S3
runner's configured storage passes the redirect backend check. Add
regression coverage for backend identification and validation.

Assisted By: Codex (GPT-6)
@dralley
dralley force-pushed the streaming-fix-backup branch from 92c46a0 to 799c348 Compare December 1, 2026 04:07
as compatibility identifiers.
If your deployment overrides `DOMAIN_STORAGE_BACKENDS` or configures object storage in
`STORAGES`, update implementation paths from `storages.backends.*` to
`pulpcore.vendor.storages.backends.*` to select the bundled code.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Realistically users shouldn't be tweaking the storage backends, but we expose it, so we should probably remove this whole comment but still have a changelog entry mentioning that any overridden values ought to be changed back / left alone unless you really know what you're doing. Do you agree?


- **Supported**: We support (test) Amazon S3 and Azure.
- **Untested**: Other backends provided by `django-storages` may work as well, but we provide no guarantee.
- **Untested**: Other vendored backends may work, but we provide no guarantee.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Note to self: fix

Other backends aren't vendored.

Comment thread pulpcore/responses.py
through Pulp when object-storage redirects are disabled. Django storage
streams are synchronous, so open and close run in worker threads; reads
are dispatched there by `_sendfile()`. Preserve cleanup after errors or
early response termination.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

We could maybe get native async with something based on obstore

Or if we were to update the vendored django-storages for it. I think the blocker is that boto3 hasn't supported it historically but it's being worked on.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I believe the previous implementation would have been blocking in the executor as the executor isn't natively going to throw it to a separate thread.

This branch has not been deployed

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Content app OOMs serving large S3 artifacts with REDIRECT_TO_OBJECT_STORAGE=False

1 participant