with_servecontext
Create a serve context with custom configuration. This function allows you to customize how an app is served, including overriding environment variables, cluster pool, logging, and other deployment settings.
def with_servecontext(
mode: ServeMode | None = None,
version: Optional[str] = None,
copy_style: CopyFiles = "loaded_modules",
dry_run: bool = False,
project: str | None = None,
domain: str | None = None,
env_vars: dict[str, str] | None = None,
parameter_values: dict[str, dict[str, str | flyte.io.File | flyte.io.Dir]] | None = None,
cluster_pool: str | None = None,
log_level: int | None = None,
log_format: LogFormat = "console",
interactive_mode: bool | None = None,
copy_bundle_to: pathlib.Path | None = None,
deactivate_timeout: float | None = None,
activate_timeout: float | None = None,
health_check_timeout: float | None = None,
health_check_interval: float | None = None,
health_check_path: str | None = None,
raw_data_path: str | None = None
) - > _Serve
Create a serve context with custom configuration. This function allows you to customize how an app is served, including overriding environment variables, cluster pool, logging, and other deployment settings.
Parameters
| Name | Type | Description |
|---|---|---|
| mode | `ServeMode | None` = None |
| version | Optional[str] = None | An optional version override for the app deployment. |
| copy_style | CopyFiles = "loaded_modules" | The code bundle copy style. Options are "loaded_modules", "all", or "none". |
| dry_run | bool = False | If True, the app will not actually be deployed. |
| project | `str | None` = None |
| domain | `str | None` = None |
| env_vars | `dict[str, str] | None` = None |
| parameter_values | `dict[str, dict[str, str | flyte.io.File |
| cluster_pool | `str | None` = None |
| log_level | `int | None` = None |
| log_format | LogFormat = "console" | The optional log format, either "console" or "json". |
| interactive_mode | `bool | None` = None |
| copy_bundle_to | `pathlib.Path | None` = None |
| deactivate_timeout | `float | None` = None |
| activate_timeout | `float | None` = None |
| health_check_timeout | `float | None` = None |
| health_check_interval | `float | None` = None |
| health_check_path | `str | None` = None |
| raw_data_path | `str | None` = None |
Returns
| Type | Description |
|---|---|
_Serve | Serve context manager with configured settings |