FastAPI backend for handling Seqera Platform workflow launches.
- Python 3.9+ (matching the version used by your deployment target)
- uvicorn and other dependencies listed in
requirements.txt
-
Create a virtual environment (recommended):
python3 -m venv .venv source .venv/bin/activate -
Install dependencies:
pip install -r requirements.txt
-
Configure environment variables:
cp .env.example .env # Edit .env with your Seqera Platform credentials -
Run the API locally:
uvicorn app.main:app --reload --host 0.0.0.0 --port 3000 # or: python -m app.main (uses PORT/UVICORN_RELOAD variables)
GET /health— Lightweight health probePOST /api/workflows/launch— Launch a Seqera workflow (send the same payload previously expected by the Express server)POST /api/workflows/{runId}/cancel— Placeholder response for cancelling a runGET /api/workflows/runs— Placeholder list endpoint mirroring the previous Node APIGET /api/workflows/{runId}/logs— Placeholder log endpointGET /api/workflows/{runId}/details— Placeholder details endpointPOST /api/workflows/datasets/upload— Create a Seqera dataset and upload submitted form data as a CSV
Required entries in .env:
SEQERA_API_URL— Seqera Platform API endpoint (e.g.,https://api.seqera.io)SEQERA_ACCESS_TOKEN— API access tokenCOMPUTE_ID— Default compute environment IDWORK_DIR— Default work directoryWORK_SPACE— Seqera workspace identifierALLOWED_ORIGINS— (Optional) comma-separated list of origins allowed via CORS (defaults tohttps://dev.sbp.test.biocommons.org.au)PORT— (Optional) uvicorn port when runningpython -m app.mainUVICORN_RELOAD— (Optional) set totrueto enable reload when running viapython -m app.main
-
Build the image from the repository root:
docker build -t sbp-backend . -
Run the container, passing your
.envfile (or explicit-eoverrides) so the API can reach Seqera:docker run --rm -p 3000:3000 --env-file .env sbp-backend
Override
PORTor uvicorn flags in the env file if you need different bindings. Any value defined in.envbecomes available to the app inside the container.
- Requests fail fast with
500if mandatory environment variables are missing. - Downstream Seqera API failures surface as a
502response with the original error message for easier debugging.