flyteorg/flyte

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

Open

#5,085 opened on 2024年3月21日

GitHub で見る
 (7 comments) (0 reactions) (1 assignee)Python (378 forks)batch import
backloggeddocumentationenhancementflytekitgood first issue

Repository metrics

Stars
 (3,705 stars)
PR merge metrics
 (平均マージ 3d 8h) (30d で 114 merged PRs)

説明

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

コントリビューターガイド