Skip to content

feat(worker): add S3Storage provider, factory, and public_url#13

Merged
RndmCodeGuy20 merged 1 commit into
stagingfrom
shantheman/dev-49-python-s3storage-add-storage-abc-and-s3-implementation-to
Jun 17, 2026
Merged

feat(worker): add S3Storage provider, factory, and public_url#13
RndmCodeGuy20 merged 1 commit into
stagingfrom
shantheman/dev-49-python-s3storage-add-storage-abc-and-s3-implementation-to

Conversation

@RndmCodeGuy20

Copy link
Copy Markdown
Owner

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 .env drives both services.

Changes

  • s3.pyS3Storage(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__.pyget_storage(cfg) factory keyed on bucket.provider (gcs/s3, else ValueError).
  • main.py — use the factory; drop the hardcoded GCS get_storage.
  • config.py — read S3_* env vars first, BUCKET_* fallback (mirrors internal/config/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.toml — add boto3, fix readme path, set package-mode = false.

Verification

  • All worker files byte-compile; storage package imports end-to-end in the venv (boto3 + google-cloud-storage coexist).
  • S3Storage implements every abstract method; public_url shapes confirmed:
    • MinIO: http://localhost:9000/b/media/x.jpg
    • AWS: https://b.s3.us-east-1.amazonaws.com/media/x.jpg

Closes DEV-49

🤖 Generated with Claude Code

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>
@RndmCodeGuy20 RndmCodeGuy20 merged commit 58af989 into staging Jun 17, 2026
4 checks passed
@RndmCodeGuy20 RndmCodeGuy20 deleted the shantheman/dev-49-python-s3storage-add-storage-abc-and-s3-implementation-to branch June 17, 2026 00:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant