Summary
The user requests that reference tasks automatically retrieve the latest version without manually setting the version parameter in the reference_task decorator for their CI/CD processes. They mention that they can obtain the latest task version using FlyteRemote and inquire about using the {{ registration.version }}
macro for this purpose. The user notes that when they try to register a workflow containing a reference task using flytectl register
, it only works if they pass a specific version, which contradicts their goal. They provide examples of commands used and highlight that using a normal task instead of a reference task works with a new version. The user seeks guidance on the correct way for a CI/CD process to fetch the latest task for a reference task.
nuhaj
and if I take out the reference task and use a ask defined in the workflow (a normal task) it works with a new version
flytectl register files --archive flyte-package.tgz --version "1" -p test -d development
nuhaj
The intention is the CICD to grab the latest version of reference tasks and workflows in a workflow. If I try flytectl register
on my workflow which contains a reference task, it only works if I pass it the version which defeats what I am trying to do.
pyflyte --pkgs test package -f
flytectl register files --archive flyte-package.tgz --version "ADKDdgdgTEfg" -p test -d development
What would be the correct way for a CICD to fetch the latest task for a reference task
project="test",
domain="development",
name="simple.print_date",
version="{{ registration.version }}",
)
def print_date() -> str:
...
@workflow
def test()-> str:
return print_date()```
david.espejo
<@U073L5Y9GJD> looks like that macro is supported by flytectl register
only at the time
nuhaj
a complete example would be more helpful. What are the prerequisites for the macro to work? The task and workflow are registered using pyflyte register,I get.
RPC Failed, with Status: StatusCode.INVALID_ARGUMENT```
blaketastic2
Or am I not understanding what you are trying to achieve
blaketastic2
Can you use the {{ registration.version }}
macro as described here - https://docs.flyte.org/projects/cookbook/en/v0.3.66/auto/core/flyte_basics/reference_task.html#reference-task
nuhaj
wrap the reference_task decorator? Not sure if thats possible
project="myproject",
domain="development",
name="mytask.test",
version="1234556",
)```
nuhaj
Hello, we would like for reference tasks to grab the latest version. The version parameter in the reference_task decorator is required, for our CICD we do not want to manually set this and our workflows and tasks are preregistered. I am able to grab the latest task version using FlyteRemote.