feat(worker): add S3Storage provider, factory, and public_url#13
Merged
RndmCodeGuy20 merged 1 commit intoJun 17, 2026
Conversation
Implement the S3/MinIO storage backend for the Python worker, mirroring the Go side so a single .env drives both services for local e2e. - s3.py: S3Storage(StorageX) on boto3; path-style + endpoint_url for MinIO, virtual-host URLs for AWS — public_url matches pkg/utils/storagex/s3.go - base.py/gcs.py: add public_url to the StorageX ABC + GCS impl - storage/__init__.py: get_storage(cfg) factory keyed on bucket.provider - main.py: use the factory; drop hardcoded GCS get_storage - config.py: read S3_* env vars first, BUCKET_* fallback (mirrors env.go) - images.py/videos.py: replace hardcoded storage.googleapis.com URLs with storage.public_url(key) so DB URLs are correct under MinIO - pyproject: add boto3, fix readme path, set package-mode = false Closes DEV-49 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Implements the S3/MinIO storage backend for the Python worker — the last piece before a fully-local e2e demo (MinIO in place of GCS).
Mirrors the Go side so a single
.envdrives both services.Changes
s3.py—S3Storage(StorageX)on boto3: path-style +endpoint_urlfor MinIO, virtual-host URLs for AWS.public_urlmatchespkg/utils/storagex/s3.go.base.py/gcs.py— addpublic_urlto theStorageXABC + GCS impl.storage/__init__.py—get_storage(cfg)factory keyed onbucket.provider(gcs/s3, elseValueError).main.py— use the factory; drop the hardcoded GCSget_storage.config.py— readS3_*env vars first,BUCKET_*fallback (mirrorsinternal/config/env.go).images.py/videos.py— replace hardcodedstorage.googleapis.comURLs withstorage.public_url(key)so DB URLs are correct under MinIO.pyproject.toml— add boto3, fix readme path, setpackage-mode = false.Verification
S3Storageimplements every abstract method;public_urlshapes confirmed:http://localhost:9000/b/media/x.jpghttps://b.s3.us-east-1.amazonaws.com/media/x.jpgCloses DEV-49
🤖 Generated with Claude Code