Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pkg/stack/testmode_env.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,7 @@ func testModeEnv(nodes []manifest.ResolvedPiriNode) map[string]string {
"SMELT_IPNI_ADMIN_PORT": "3002",
"SMELT_IPNI_P2P_PORT": "3003",
"SMELT_UPLOAD_PORT": "80",
"SMELT_UPLOAD_POSTGRES_PORT": "5432",

// Piri shared infra — only used when any node declares postgres/s3,
// but harmless to set unconditionally (compose ignores unknown
Expand Down
7 changes: 5 additions & 2 deletions systems/upload/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ Mock w3infra replacement for upload coordination.
## Services

- **upload** - Handles upload coordination, blob allocation, and UCAN processing
- **postgres** - Sprue's metadata store; isolated to this system (separate from any piri-postgres)

## Ports

| Host Port | Container Port | Service | Description |
|-----------|----------------|---------|-------------|
| 15060 | 80 | upload | Upload service API |
| 15061 | 5432 | postgres | Sprue metadata store (psql from host, debugging) |

## Configuration

Expand All @@ -24,15 +26,16 @@ TODO: Switch to PEM file loading.
## Standalone Usage

```bash
# Requires indexer, dynamodb-local, piri to be running
# Requires indexer, minio, piri to be running
cd systems/upload
docker compose up -d
```

## Dependencies

- indexer (service_healthy)
- dynamodb-local (service_healthy)
- minio (service_healthy)
- postgres (service_healthy)
- piri (service_healthy)

## Used By
Expand Down
32 changes: 30 additions & 2 deletions systems/upload/compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ services:
depends_on:
indexer:
condition: service_healthy
dynamodb-local:
condition: service_healthy
minio:
condition: service_healthy
postgres:
condition: service_healthy
healthcheck:
test: ["CMD", "curl", "-sf", "http://localhost:80/health"]
start_interval: 1s
Expand All @@ -46,3 +46,31 @@ services:
restart: unless-stopped
networks:
- storacha-network

# Postgres for sprue's metadata stores. Sprue runs goose migrations on
# startup, so no init sidecar is needed — the `sprue` database created by
# POSTGRES_DB is enough. Separate from `piri-postgres` (which is generated
# from smelt.yml when piri nodes use db: postgres).
postgres:
image: postgres:16-alpine
ports:
- "${SMELT_UPLOAD_POSTGRES_PORT:-15061:5432}"
environment:
- POSTGRES_USER=sprue
- POSTGRES_PASSWORD=sprue
- POSTGRES_DB=sprue
volumes:
- upload-postgres-data:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U sprue -d sprue"]
start_interval: 1s
interval: 5s
timeout: 3s
retries: 10
start_period: 10s
restart: unless-stopped
networks:
- storacha-network

volumes:
upload-postgres-data:
37 changes: 14 additions & 23 deletions systems/upload/config/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,20 @@ mailer:
smtp_auth_user: "upload"
smtp_auth_secret: "secret"

dynamodb:
endpoint: "http://dynamodb-local:8000"
region: "us-west-1"
agent_index_table: "agent-index"
blob_registry_table: "blob-registry"
consumer_table: "consumer"
customer_table: "customer"
delegation_table: "delegation"
space_metrics_table: "space-metrics"
admin_metrics_table: "admin-metrics"
replica_table: "replica"
revocation_table: "revocation"
storage_provider_table: "storage-provider"
subscription_table: "subscription"
space_diff_table: "space-diff"
upload_table: "upload"

s3:
endpoint: "http://minio:9000"
region: "us-west-1"
agent_message_bucket: "agent-message"
delegation_bucket: "delegation"
upload_shards_bucket: "upload-shards"
storage:
type: "postgres"

postgres:
dsn: "postgres://sprue:sprue@postgres:5432/sprue?sslmode=disable"
max_conns: 10
min_conns: 0

s3:
endpoint: "http://minio:9000"
region: "us-west-1"
agent_message_bucket: "agent-message"
delegation_bucket: "delegation"
upload_shards_bucket: "upload-shards"

log:
level: "info"