Skip to main content

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

AttributeTypeDescription
appfastapi.FastAPIThe FastAPI application instance that this environment manages.
typestr = "FastAPI"A string indicating the type of the application environment, which is 'FastAPI' for this class.
uvicorn_config`uvicorn.ConfigNone` = 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

NameTypeDescription
serialization_context[SerializationContext](../../../models/serializationcontext.md?sid=flyte_models_serializationcontext)The context used for serialization, providing necessary information for command generation.

Returns

TypeDescription
list[str]A list of strings representing the container command.