Compute Service
The compute service is the primary FastAPI application in CAS Backend. It serves authenticated API traffic, coordinates annotation and query workflows, and composes shared core services, data managers, and external integrations such as BigQuery, Cloud SQL, and Vertex AI Matching Engine.
What Lives Here
main.py: FastAPI application entrypointrouters/: HTTP route definitionsschemas/: request and response modelsdependencies/: FastAPI dependency providers, including auth and service wiringservices/: domain logic for compute workflowsclients/: clients for external compute-facing integrationsentrypoint.sh: container startup command
Public Entrypoints
Local process:
python -m cellarium.cas_backend.apps.compute.mainASGI app:
cellarium.cas_backend.apps.compute.main:applicationContainer entrypoint:
cellarium/cas_backend/apps/compute/entrypoint.sh
Dependencies
The compute service depends on:
cellarium.cas_backend.core.appfor common FastAPI service wiringcellarium.cas_backend.core.authfor authentication helperscellarium.cas_backend.core.data_managersfor BigQuery and warehouse accesscellarium.cas_backend.core.dbfor quota, user, and metadata persistenceVertex AI Matching Engine and other configured Google Cloud resources for production workloads
Local Development
Create settings/.env and install dependencies, then run:
poetry run python -m cellarium.cas_backend.apps.compute.main
Useful commands during development:
make test
poetry run pytest tests/unit -k compute
The service publishes OpenAPI docs at http://localhost:8000/api/docs when running locally.
Deployment Notes
The compute image is built from deploy/docker/Dockerfile.compute and deployed through the shared Cloud Run
workflows. Deployment flavor and Cloud Run sizing live under deploy/cloudrun/.