Skip to content

build(dev): replace LocalStack with moto for local S3 emulation - #859

Open
bencap wants to merge 1 commit into
release-2026.3.0from
feature/bencap/768-replace-localstack-with-moto
Open

build(dev): replace LocalStack with moto for local S3 emulation#859
bencap wants to merge 1 commit into
release-2026.3.0from
feature/bencap/768-replace-localstack-with-moto

Conversation

@bencap

@bencap bencap commented Aug 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Replaces LocalStack with moto for local S3 emulation. LocalStack archived its Community edition in March 2026 and moved S3 behind a paid token, so docker compose up fails with auth errors for anyone pulling the current image.

Why moto (not S3Mock or Floci)

  • Adobe S3Mock is Java-SDK-first: every boto3 PutObject fails against it (tested 4.6.0 and 5.2.0) because its expect-100-continue handshake drops the connection. It would require path-style + Expect workarounds in our shared s3_client() — which also serves production.
  • moto (Apache-2.0) is built for boto3 and runs the CSV upload/download flow with an unmodified client. It's also multi-service, leaving room for e.g. local Secrets Manager later without another migration.
  • Floci/MiniStack/kumo are young multi-service LocalStack clones — more than we need, less proven with boto3.

Changes

  • docker-compose-dev.yml: localstackmoto + one-shot moto-init (curlimages/curl) that PUTs the upload bucket once moto is up.
  • Deleted bin/localstack-init.sh (and the awslocal dependency).
  • settings/.env.template: S3_ENDPOINT_URL=http://moto:5000.
  • Host port published as 5001:5000.
  • No production code changed; unit tests already mock the S3 client directly.

LocalStack archived its Community edition in March 2026 and moved S3
behind a paid token, so `docker compose up` fails with auth errors for
anyone pulling the current image.

Swap in moto (Apache-2.0), which is built for boto3 and runs the CSV
upload/download flow with an unmodified client -- no path-style or
expect-100-continue workarounds, unlike Adobe S3Mock (Java-SDK-first).
moto has no auto-create, so a one-shot curl container PUTs the upload
bucket once moto is up; this removes the awslocal-based init script.

The app reaches moto at moto:5000 internally; the host port is 5001 to
avoid the macOS AirPlay Receiver on 5000.

Refs #768
@bencap bencap linked an issue Aug 26, 2026 that may be closed by this pull request
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 33022288160

Coverage decreased (-0.2%) to 88.841%

Details

  • Coverage decreased (-0.2%) from the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • 25 coverage regressions across 4 files.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

25 previously-covered lines in 4 files lost coverage.

File Lines Losing Coverage Coverage
src/mavedb/lib/utils.py 11 28.13%
src/mavedb/lib/clinvar/utils.py 6 90.59%
src/mavedb/worker/jobs/external_services/clinvar.py 5 94.95%
src/mavedb/lib/vep.py 3 87.76%

Coverage Stats

Coverage Status
Relevant Lines: 15611
Covered Lines: 13869
Line Coverage: 88.84%
Coverage Strength: 0.89 hits per line

💛 - Coveralls

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.

Replace LocalStack with Floci for local S3 emulation

3 participants