<#7084 [V2] Read user run context> Pull request op...
# flyte-github
a
#7084 [V2] Read user run context Pull request opened by machichima Tracking issue Why are the changes needed? We should get values from run context provided by user through
with_runcontext
in flyte-sdk What changes were proposed in this pull request? • Add 2 fields in TaskAction CRD:
EnvVars
and
Interruptible
• Store
EnvVars
,
Labels
,
Annotations
,
Interruptible
in CR and pass to pod created • Also store context in input by write the whole input to protobuf How was this patch tested? Start sandbox and test with following flyte-sdk script import flyte env = flyte.TaskEnvironment("custom-context-example") @env.task async def leaf_task() -> str: # Reads run-level context print("leaf sees:", flyte.ctx().custom_context) return flyte.ctx().custom_context.get("trace_id") @env.task async def root() -> str: return await leaf_task() if name == "__main__": flyte.init_from_config() # Base context for the entire run run = flyte.with_runcontext( custom_context={"trace_id": "root-abc", "experiment": "v1"}, env_vars={"foo": "boo"}, labels={"test_label": "test_value"}, annotations={"test_annotation": "test_annotation_value"} ).run(root) print(run.url) • TaskAction CR image • Pod: image Labels Please add one or more of the following labels to categorize your PR: • added: For new features. • changed: For changes in existing functionality. • deprecated: For soon-to-be-removed features. • removed: For features being removed. • fixed: For any bug fixed. • security: In case of vulnerabilities This is important to improve the readability of release notes. Setup process Screenshots Check all the applicable boxes • I updated the documentation accordingly. • All new and existing tests passed. • All commits are signed-off. Related PRs Docs link flyteorg/flyte