From 45050d59325337514aaffcd69f05702edea0ca0c Mon Sep 17 00:00:00 2001 From: Benjamin Capodanno Date: Wed, 26 Aug 2026 16:00:43 -0700 Subject: [PATCH] build(dev): replace 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. 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 --- bin/localstack-init.sh | 4 ---- docker-compose-dev.yml | 23 ++++++++++++----------- settings/.env.template | 2 +- 3 files changed, 13 insertions(+), 16 deletions(-) delete mode 100755 bin/localstack-init.sh diff --git a/bin/localstack-init.sh b/bin/localstack-init.sh deleted file mode 100755 index 1a00cfcbc..000000000 --- a/bin/localstack-init.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/sh -echo "Initializing local S3 bucket..." -awslocal s3 mb s3://score-set-csv-uploads-dev -echo "S3 bucket 'score-set-csv-uploads-dev' created." \ No newline at end of file diff --git a/docker-compose-dev.yml b/docker-compose-dev.yml index 9835cff4e..925c30f0d 100644 --- a/docker-compose-dev.yml +++ b/docker-compose-dev.yml @@ -103,17 +103,19 @@ services: volumes: - mavedb-redis-dev:/data - localstack: - image: localstack/localstack:latest + # AWS mock. + moto: + image: motoserver/moto:latest ports: - - "4566:4566" - env_file: - - settings/.env.dev - environment: - - SERVICES=s3:4566 # We only need S3 for MaveDB - volumes: - - mavedb-localstack-dev:/var/lib/localstack - - "./bin/localstack-init.sh:/etc/localstack/init/ready.d/localstack-init.sh" + - "5001:5000" + + moto-init: + # One-shot: create the upload bucket once moto is up (moto has no auto-create). + # A raw PUT is all it takes; --retry-all-errors waits out moto's startup. + image: curlimages/curl:latest + depends_on: + - moto + command: -sf --retry 10 --retry-all-errors --retry-delay 1 -X PUT http://moto:5000/score-set-csv-uploads-dev seqrepo: image: biocommons/seqrepo:2024-12-20 @@ -124,4 +126,3 @@ volumes: mavedb-data-dev: mavedb-redis-dev: mavedb-seqrepo-dev: - mavedb-localstack-dev: diff --git a/settings/.env.template b/settings/.env.template index 585bd354f..4574c6dd4 100644 --- a/settings/.env.template +++ b/settings/.env.template @@ -105,7 +105,7 @@ GNOMAD_DATA_VERSION=v4.1 AWS_ACCESS_KEY_ID=test AWS_SECRET_ACCESS_KEY=test -S3_ENDPOINT_URL=http://localstack:4566 +S3_ENDPOINT_URL=http://moto:5000 UPLOAD_S3_BUCKET_NAME=score-set-csv-uploads-dev ####################################################################################################