Create run with TaskId for lazy task#1198
Conversation
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
| if task_spec.task_template.id.version == "": | ||
| task_spec.task_template.id.version = version | ||
| # Only needed for locally-defined tasks; a fetched task (task_id set) already | ||
| # carries a fully-populated id and is sent by reference, not as a spec. |
There was a problem hiding this comment.
does it work with task override?
There was a problem hiding this comment.
Thanks for noticing. Fixed in c0ab563. I also tested it and put the result in PR description.
Signed-off-by: Alex Wu <c.alexwu@gmail.com>
| pb2: task_definition_pb2.TaskDetails | ||
| max_inline_io_bytes: int = 10 * 1024 * 1024 # 10 MB | ||
| overriden_queue: Optional[str] = None | ||
| overridden: bool = False # Flag if the TaskDetails was overridden |
There was a problem hiding this comment.
Add this var in TaskDetails to flag if the fetched TaskDetail is overridden. If it is overridden, we should still send full TaskSpec to the backend while creating runs.
|
so does |
@kumare3 Right now |
Goal
While creating runs with remote task(lazy task), we should create run request with TaskID instead of TaskSpec. Thus, the user only needs Action_ACTION_CREATE_FLYTE_EXECUTIONS to do such an operation.
p.s. While executing ephemeral runs(create runs with TaskSpec), the user must process Action_ACTION_REGISTER_FLYTE_INVENTORY permission because the BE will create TaskSpec in the DB.
Tests
Add log to see if we are creating run with TaskID or TaskSpec:

Test with this script to run remote task:
The log shows we create run with TaskID

Execute an ephemeral run, the log show we create run with TaskSpec:

Test if task override works by overriding the task Short_name:
The name is overridden:

Rollout plan
The backend permission check changes is till processing. It is ok to merge this PR first as current BE authz logic will not block create run request with TaskID.