Skip to content
Star
478
Star
478

S3 (Garage)

This guide shows you how to work with AWS S3 using Garage as a local emulator. This lab demonstrates a data pipeline using Boto3, PyArrow, and Delta Lake (delta-rs).

  1. Setup Environment:

    Open VS Code in the project folder and execute this command in the Command Palette:

    Terminal window
    > Dev Containers: Reopen in Container
  2. Run the Example:

    Terminal window
    python main.py
  1. main.py:

    • Open: Open main.py.
    • Breakpoints: Set breakpoints in the code.
    • Run: Press F5 to start debugging.
  2. Tests:

    • Open: Open a test file (e.g., tests/components/test_s3_boto.py).
    • Breakpoints: Set breakpoints in the test code.
    • Run: Use the VS Code Testing tab and click the Debug Test icon next to the test you want to debug.
  • Individually: Run tests individually from the VS Code Testing tab.
  • All tests: Run the automated script:
    Terminal window
    scripts/run_tests.sh
  • Check Buckets: Verify that bronze and silver buckets were created.
    Terminal window
    aws s3 ls --profile garage
  • Check Content: Verify the files in the silver bucket.
    Terminal window
    aws s3 ls s3://silver --recursive --profile garage
Terminal window
docker compose down -v
IssueSolution
Garage API not readyEnsure the garage container is running and wait a few seconds for the API to initialize. Check logs with docker logs garage.
Port 3900 in useStop any other service using port 3900 or change the mapping in docker-compose.yml.