FastApi
, PgVector
, Streamlit
, Jupyter
, Django
that we define as python classes and run using phi start
or phi ws up
.
When running Apps using phidata, think of them as infrastructure as code but at a higher level of abstraction. Instead of defining containers, volumes etc. we define the application we want to run. We run Applications as Code instead of Infrastructure as Code.
The same App
can run on docker, AWS (ECS) or Kubernetes (EKS). The App creates the underlying resources like LoadBalancers, Services, Deployments. As the underlying resources become more complex, the concept of Apps become more appealing.
Example
Lets run a Jupyter notebook and PgVector on docker. Copy the following contents to a fileresources.py
and run phi start resources.py
resources.py
- Each App is a pydantic object providing input and type validation.
- Note how the
mount_workspace
automatically mounts the directory - Note how
PgVectorDb
sets the required settings and creates the volume.