FastAPIAppEnvironment
This class represents an environment for a FastAPI application within the Flyte ecosystem. It manages the FastAPI application instance, handles its lifecycle, and integrates it with a Uvicorn server. The class ensures the FastAPI application's state is picklable for Flyte's serialization needs and provides a mechanism to serve the application.
Attributes
| Attribute | Type | Description |
|---|---|---|
| app | fastapi.FastAPI | The FastAPI application instance that this environment manages. |
| type | str = "FastAPI" | A string indicating the type of the application environment, which is 'FastAPI' for this class. |
| uvicorn_config | `uvicorn.Config | None` = null |
Constructor
Signature
def FastAPIAppEnvironment() - > null
Methods
container_command()
@classmethod
def container_command(
serialization_context: [SerializationContext](../../../models/serializationcontext.md?sid=flyte_models_serializationcontext)
) - > list[str]
Returns a list of strings representing the container command. This method is typically used to define how the application should be executed within a container.
Parameters
| Name | Type | Description |
|---|---|---|
| serialization_context | [SerializationContext](../../../models/serializationcontext.md?sid=flyte_models_serializationcontext) | The context used for serialization, providing necessary information for command generation. |
Returns
| Type | Description |
|---|---|
list[str] | A list of strings representing the container command. |