2.0.0b35

Environment

Package: flyte

class Environment(
    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']],
)
Parameter Type Description
name str Name of the environment
depends_on List[Environment] Environment dependencies to hint, so when you deploy the environment, the dependencies are also deployed. This is useful when you have a set of environments that depend on each other.
pod_template Optional[Union[str, PodTemplate]] Pod template to use for the environment.
description Optional[str] Description of the environment.
secrets Optional[SecretRequest] Secrets to inject into the environment.
env_vars Optional[Dict[str, str]] Environment variables to set for the environment.
resources Optional[Resources] Resources to allocate for the environment.
interruptible bool Whether the environment is interruptible and can be scheduled on spot/preemptible instances
image Union[str, Image, Literal['auto']] Docker image to use for the environment. If set to “auto”, will use the default image.

Methods

Method Description
add_dependency() Add a dependency to the environment.
clone_with()

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],
    kwargs: **kwargs,
) -> Environment
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]
kwargs **kwargs