Skip to article frontmatterSkip to article content
Site not loading correctly?

This may be due to an incorrect BASE_URL configuration. See the MyST Documentation for reference.

Fornax Cutouts User Documentation

Getting Started

Prerequisites


Installation

From source

git clone https://github.com/nasa-fornax/fornax-cutouts
cd fornax-cutouts
uv sync

As a library dependency

Add fornax-cutouts to your project’s dependencies. If you are developing against a local clone side-by-side with your service:

# pyproject.toml
[tool.uv.sources]
fornax-cutouts = { path = "../fornax-cutouts", editable = true }

Then run:

uv sync

Minimum Configuration

Fornax Cutouts requires at minimum two environment variables to start:

export CUTOUTS__SOURCE_PATH=/path/to/your/sources
export CUTOUTS__REDIS__HOST=localhost

All other settings have sensible defaults. See Configuration for the full reference.

Using a .env file

The service reads a .env file from the working directory automatically:

# .env
CUTOUTS__SOURCE_PATH=/path/to/your/sources
CUTOUTS__REDIS__HOST=localhost
CUTOUTS__STORAGE__PREFIX=s3://my-bucket/cutouts
CUTOUTS__LOG__LEVEL=info

Starting Redis

If you don’t have Redis running locally, the quickest way is via Docker:

docker run -d -p 6379:6379 valkey/valkey-bundle:9.1

Running the API

fornax-cutouts api

The API will start on http://localhost:8000 by default. Visit http://localhost:8000/docs for the interactive Swagger UI.

For development with auto-reload:

fornax-cutouts api --reload

Running the Worker

In a separate terminal:

fornax-cutouts worker

The worker connects to Redis and begins consuming from the cutouts and high_mem queues.


Verifying the Setup

Check the health endpoint:

curl http://localhost:8000/api/health

Expected response:

{
  "status": "ok",
  "details": "Redis connection successful",
  "timestamp": "2024-01-01T00:00:00Z",
  "environment": "dev"
}

List registered missions (requires at least one source file in CUTOUTS__SOURCE_PATH):

curl http://localhost:8000/api/v0/missions

Project Layout

When using fornax-cutouts as a library, a typical project structure looks like:

my-cutouts-service/
├── sources/               # Mission source files (CUTOUTS__SOURCE_PATH)
│   └── my_mission.py
├── .env                   # Local environment config
└── pyproject.toml

Each .py file under CUTOUTS__SOURCE_PATH is automatically discovered and executed at startup. Any file that uses @cutout_registry.register_source(...) will register its source with the service.


Next Steps