Skip to main content

with_runcontext

Launch a new run with the given parameters as the context.

def with_runcontext(
mode: Mode | None = None,
name: Optional[str] = None,
service_account: Optional[str] = None,
version: Optional[str] = None,
copy_style: CopyFiles = "loaded_modules",
dry_run: bool = False,
copy_bundle_to: pathlib.Path | None = None,
interactive_mode: bool | None = None,
raw_data_path: str | None = None,
run_base_dir: str | None = None,
overwrite_cache: bool = False,
project: str | None = None,
domain: str | None = None,
env_vars: Dict[str, str] | None = None,
labels: Dict[str, str] | None = None,
annotations: Dict[str, str] | None = None,
interruptible: bool | None = None,
log_level: int | None = None,
log_format: LogFormat = "console",
reset_root_logger: bool = False,
disable_run_cache: bool = False,
queue: Optional[str] = None,
notifications: Notification | Tuple[Notification, ...] | None = None,
custom_context: Dict[str, str] | None = None,
cache_lookup_scope: CacheLookupScope = "global",
preserve_original_types: bool = False,
debug: bool = False,
_tracker: Any = None
) - > _Runner

Launch a new run with the given parameters as the context.

Parameters

NameTypeDescription
mode`ModeNone` = None
nameOptional[str] = NoneThe name to use for the run
service_accountOptional[str] = NoneThe service account to use for the run context
versionOptional[str] = NoneThe version to use for the run, if not provided, it will be computed from the code bundle
copy_styleCopyFiles = "loaded_modules"The copy style to use for the run context
dry_runbool = FalseIf true, the run will not be executed, but the bundle will be created
copy_bundle_to`pathlib.PathNone` = None
interactive_mode`boolNone` = None
raw_data_path`strNone` = None
run_base_dir`strNone` = None
overwrite_cachebool = FalseIf true, the cache will be overwritten for the run
project`strNone` = None
domain`strNone` = None
env_vars`Dict[str, str]None` = None
labels`Dict[str, str]None` = None
annotations`Dict[str, str]None` = None
interruptible`boolNone` = None
log_level`intNone` = None
log_formatLogFormat = "console"Log format to set for the run. If not provided, it will be set to the default log format
reset_root_loggerbool = FalseIf true, the root logger will be preserved and not modified by Flyte.
disable_run_cachebool = FalseIf true, the run cache will be disabled. This is useful for testing purposes.
queueOptional[str] = NoneThe queue to use for the run. This is used to specify the cluster to use for the run.
notifications`NotificationTuple[Notification, ...]
custom_context`Dict[str, str]None` = None
cache_lookup_scopeCacheLookupScope = "global"Scope to use for the run. This is used to specify the scope to use for cache lookups. If not specified, it will be set to the default scope (global unless overridden at the system level).
preserve_original_typesbool = FalseIf true, the type engine will preserve original types (e.g., pd.DataFrame) when guessing python types from literal types. If false (default), it will return the generic flyte.io.DataFrame. This option is automatically set to True if interactive_mode is True unless overridden explicitly by this parameter.
debugbool = FalseIf true, the task will be run as a VSCode debug task, starting a code-server in the container so users can connect via the UI to interactively debug/run the task.
_trackerAny = NoneThis is an internal only parameter used by the CLI to render the TUI.

Returns

TypeDescription
_Runnerrunner