flyteorg/flyte

[Core feature] Override task `secret_requests` using `with_overrides`

Open

#5,085 创建于 2024年3月21日

在 GitHub 查看
 (7 评论) (0 反应) (1 负责人)Python (378 fork)batch import
backloggeddocumentationenhancementflytekitgood first issue

仓库指标

Star
 (3,705 star)
PR 合并指标
 (平均合并 3天 8小时) (30 天内合并 114 个 PR)

描述

Motivation: Why do you think this is important?

Not being able to generally override properties of a task using with_overrides is not intuitive and in this case is forcing me to have multiple copies of identical code.

Goal: What should the final outcome look like, ideally?

I would like to do something like this:

@workflow
def run():
    data = get_data()
    overrides = { 
        "secret_requests": [
            Secret(key="username", group="db"),
            Secret(key="password", group="db"),
        ],
    }
    common.generic_task(**params).with_overrides(**overrides)

It would be most intuitive to have anything passed into with_overrides override the equivalently named property of the task, however it appears here that properties are being handled explicitly. There is also the ability to override task_config but there is no documentation for how this will behave.

Describe alternatives you've considered

Create separate tasks with identical logic with different secrets attached. This works but is not DRY.

Propose: Link/Inline OR Additional context

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes

贡献者指南