The page you navigated to () does not exist, so we brought you to the closest page to it.
You have switched from the to the variant of this site. There is no equivalent of . We have taken you to the closest page in the variant.
ConnectorEnvironment
Package: flyte.app
Configure a connector environment for custom Flyte connectors.
Example — single-file connector:
connector = flyte.app.ConnectorEnvironment(
name="my-connector",
image=image,
include=["my_connector.py"],
)Example — connector inside a package:
connector = flyte.app.ConnectorEnvironment(
name="my-connector",
image=image,
include=["my_connector"],
)Parameters
class ConnectorEnvironment(
name: str,
depends_on: List[Environment],
pod_template: Optional[Union[str, PodTemplate]],
description: Optional[str],
secrets: Optional[SecretRequest],
env_vars: Optional[Dict[str, str]],
resources: Optional[Resources],
interruptible: bool,
image: Union[str, Image, Literal['auto'], None],
type: str,
port: int | flyte.app._types.Port,
args: *args,
command: Optional[Union[List[str], str]],
requires_auth: bool,
scaling: Scaling,
domain: Domain | None,
links: List[Link],
include: List[str],
parameters: List[Parameter],
cluster_pool: str,
timeouts: Timeouts,
)| Parameter | Type | Description |
|---|---|---|
name |
str |
|
depends_on |
List[Environment] |
|
pod_template |
Optional[Union[str, PodTemplate]] |
|
description |
Optional[str] |
|
secrets |
Optional[SecretRequest] |
|
env_vars |
Optional[Dict[str, str]] |
|
resources |
Optional[Resources] |
|
interruptible |
bool |
|
image |
Union[str, Image, Literal['auto'], None] |
|
type |
str |
|
port |
int | flyte.app._types.Port |
|
args |
*args |
|
command |
Optional[Union[List[str], str]] |
|
requires_auth |
bool |
|
scaling |
Scaling |
|
domain |
Domain | None |
|
links |
List[Link] |
|
include |
List[str] |
List of file paths to connector modules. Each path is converted to a Python module name and passed to the connector process via --modules. For example, "my_connector/connector.py" becomes module "my_connector.connector". |
parameters |
List[Parameter] |
|
cluster_pool |
str |
|
timeouts |
Timeouts |
Properties
| Property | Type | Description |
|---|---|---|
endpoint |
None |
Methods
| Method | Description |
|---|---|
add_dependency() |
Add a dependency to the environment. |
clone_with() |
|
container_args() |
|
container_cmd() |
|
get_port() |
|
on_shutdown() |
Decorator to define the shutdown function for the app environment. |
on_startup() |
Decorator to define the startup function for the app environment. |
server() |
Decorator to define the server function for the app environment. |
add_dependency()
def add_dependency(
env: Environment,
)Add a dependency to the environment.
| Parameter | Type | Description |
|---|---|---|
env |
Environment |
clone_with()
def clone_with(
name: str,
image: Optional[Union[str, Image, Literal['auto']]],
resources: Optional[Resources],
env_vars: Optional[dict[str, str]],
secrets: Optional[SecretRequest],
depends_on: Optional[List[Environment]],
description: Optional[str],
interruptible: Optional[bool],
kwargs: **kwargs,
) -> AppEnvironment| Parameter | Type | Description |
|---|---|---|
name |
str |
|
image |
Optional[Union[str, Image, Literal['auto']]] |
|
resources |
Optional[Resources] |
|
env_vars |
Optional[dict[str, str]] |
|
secrets |
Optional[SecretRequest] |
|
depends_on |
Optional[List[Environment]] |
|
description |
Optional[str] |
|
interruptible |
Optional[bool] |
|
kwargs |
**kwargs |
container_args()
def container_args(
serialize_context: flyte.models.SerializationContext,
) -> typing.List[str]| Parameter | Type | Description |
|---|---|---|
serialize_context |
flyte.models.SerializationContext |
container_cmd()
def container_cmd(
serialize_context: flyte.models.SerializationContext,
parameter_overrides: list[flyte.app._parameter.Parameter] | None,
) -> typing.List[str]| Parameter | Type | Description |
|---|---|---|
serialize_context |
flyte.models.SerializationContext |
|
parameter_overrides |
list[flyte.app._parameter.Parameter] | None |
get_port()
def get_port()on_shutdown()
def on_shutdown(
fn: Callable[..., None],
) -> Callable[..., None]Decorator to define the shutdown function for the app environment.
This function is called after the server function is called.
This decorated function can be a sync or async function, and accepts input parameters based on the Parameters defined in the AppEnvironment definition.
| Parameter | Type | Description |
|---|---|---|
fn |
Callable[..., None] |
on_startup()
def on_startup(
fn: Callable[..., None],
) -> Callable[..., None]Decorator to define the startup function for the app environment.
This function is called before the server function is called.
The decorated function can be a sync or async function, and accepts input parameters based on the Parameters defined in the AppEnvironment definition.
| Parameter | Type | Description |
|---|---|---|
fn |
Callable[..., None] |
server()
def server(
fn: Callable[..., None],
) -> Callable[..., None]Decorator to define the server function for the app environment.
This decorated function can be a sync or async function, and accepts input parameters based on the Parameters defined in the AppEnvironment definition.
| Parameter | Type | Description |
|---|---|---|
fn |
Callable[..., None] |