flyteorg / flyteorg/flyte

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

Open
#5,085 7 comments 0 reactions 1 assignee Claimed by @asd0300 View on GitHub
backlogged documentation enhancement flytekit good first issue
Dominant language
Go
Stars
7.5k
Forks
886
Avg merge
1d 14h
Merged PRs (30d)
120

Description

### 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:

```python
@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](https://github.com/flyteorg/flytekit/blob/3642ec6771985f504c2b6a9dfd2598a84219ac58/flytekit/core/node.py#L126) 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?

- [X] Yes

### Have you read the Code of Conduct?

- [X] Yes

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.