Skip to content

Storage Quickstart

This guide starts a local blobgw object gateway from a source checkout and reads and writes objects with the Python client. It then covers the persistent Docker Compose environment for development.

Prerequisites

  • Go 1.26.8 or newer
  • Python 3.10+ and uv for the client example
  • A checkout of scitrera/memorylayer-storage
  • Docker with Compose, for the persistent environment only

1. Start a disposable gateway

From the repository checkout:

Terminal window
cd blobgw
go run ./cmd/blobgw -addr 127.0.0.1:8080 -domain demo \
-backend local -data-dir /tmp/memorylayer-demo \
-index memory -staging memory -gc-interval 0

This demo keeps the dedup/object index and upload staging in memory, stores chunk data under /tmp/memorylayer-demo, and turns off scheduled GC. The object index lives only in memory, so object refs are lost when you stop the process.

2. Read and write from Python

In another terminal, from the repository root:

Terminal window
uv venv
. .venv/bin/activate
uv pip install ./clients/python
python - <<'PYTHON'
from blobgw_client import BlobGWClient
client = BlobGWClient("http://127.0.0.1:8080")
client.put("demo/hello.txt", b"Hello, MemoryLayer!", "text/plain")
assert client.get("demo/hello.txt") == b"Hello, MemoryLayer!"
print(client.head("demo/hello.txt"))
PYTHON

You can also call the HTTP API directly:

Terminal window
curl -X PUT -H 'Content-Type: text/plain' \
--data-binary 'hello' http://127.0.0.1:8080/v1/objects/demo/hello2.txt
curl http://127.0.0.1:8080/v1/objects/demo/hello2.txt
curl 'http://127.0.0.1:8080/v1/objects?prefix=demo/'

See Object API for the full route list and the rest of the client.

3. Persistent local development

For a development environment that survives restarts, run this from the repository root:

Terminal window
make dev-up # PostgreSQL + blobgw with persistent Docker volumes
make dev-down # stop the services; stored data is retained

make dev-up builds blobgw from docker/Dockerfile.blobgw and starts it with -index postgres against a bundled postgres:16-alpine container. Object data goes to a persistent local volume.

  • Object API: http://127.0.0.1:8080
  • Health endpoints: /healthz and /readyz
  • Published ports bind to localhost only. Set BLOBGW_PORT or POSTGRES_PORT to change them.
  • It uses development credentials and in-memory staging, and it turns off scheduled GC.

Installing the client from a tag

The Python client is published through Git tags, not PyPI. Install it into a virtual environment:

Terminal window
uv pip install "blobgw-client @ git+https://github.com/scitrera/memorylayer-storage.git@clients/python/v0.7.1#subdirectory=clients/python"

Developing on the stack

Terminal window
make build # all eight Go modules
make test # Go tests with the race detector
make test-python # Python client against a real gateway
make check # formatting, vet, build, Go and Python tests, CI/version drift

PostgreSQL-backed tests run when MLFS_TEST_DATABASE_URL and BLOBGW_TEST_DATABASE_URL point to a disposable database. The database from make dev-up works for this. Real FUSE and CSI mount tests also need Linux, /dev/fuse, and mount privileges.

Next steps