-
Notifications
You must be signed in to change notification settings - Fork 7
Home
The prefect-proxy
is to be thought of as part of the DDP_backend
application. The only reason it has been split off into a separate app in its own repo is because it uses the asynchronous Prefect API, and DDP_backend
runs on Django which is still not fully async. Rather than mark a few Django endpoints as async
and figuring out how sync_to_async()
works, it was easier to move all that functionality into its own FastAPI app.
prefect-proxy
does not use a database. It listens for HTTP requests from DDP_backend
and forwards them to Prefect. It has no knowledge of the users, roles or organizations in DDP_backend
.
The project structure is as follows:
-
schemas.py
describes the message payloads so that Pydantic can validate them -
helpers.py
contains utility functions -
service.py
is where all the work happens -
main.py
is where the FastAPI routes are defined -
flows.py
contains reusable Prefect flow definitions i.e. Python functions decorated with@flow
prefect-proxy
requires certain environment variables to be set in a .env
, the template for which is provided in .env.template
. Any new environment variables which the application may require in future should be listed in .env.template
along with default values which are not secret.