hello.. new flyte user here.. had a question about...
# flyte-support
p
hello.. new flyte user here.. had a question about how can i configure different tasks to use different images in a workflow? i am aware that i can do this by specifying
Copy code
@task(
    container_image="{{.image.img1.fqn }}:{{.image.img1.version}}"
)
and the value of
image.img1.version
can be specified in a config file.. but how is that config linked to tasks while packaging the workflow?
t
how are you running the packaging flow @plain-carpenter-67621?
you should be able to pass a config file to your pyflyte run/package/register command.
you should also be able to specify additional images to those commands on the command line as options
p
pyflyte --pkgs workflows package --image "my-flyte:v1" -f
t
after registering, run the workflow, and click on the corresponding nodes.
on the right-hand side bar that pops up, click on the task tab. that should bring up the json definition.
the image should be hard-coded there
p
pyflyte --pkgs workflows --config workflows/my.config package -f
would be enough?
t
mind dumping the config here too? (can redact if you need to)
p
Copy code
[sdk]
workflow_packages=core

[images]
task1 = nsaiyed-flyte:v1
task2 = nsaiyed-flyte:v2
also what is this for?
Copy code
[sdk]
workflow_packages=core
t
i think you can delete that
yeah that should be fine.
the config should be respected, and the images should get picked up
you’re following the flytesnacks example right?
p
yep
t
sweet
hopping off for now, will be back on later.
p
i get this error
Copy code
containers with unready status: [ajpsqhm6rzqws2tdrcls-n0-0]|Failed to apply default image tag "{{.image.task1.fqn }}:{{.image.task1.version}}": couldn't parse image reference "{{.image.task1.fqn }}:{{.image.task1.version}}": invalid reference format
tried to specify the config file while serializing the workflow as well, but no luck
pyflyte --pkgs workflows serialize --in-container-config-path workflows/my.config workflows -f .
t
no you shouldn’t need it for the in-container path.
this is weird.
ooh i’m sorry yeah the config file is not respected
😞
we will have to add that, for now you have to use the command line
✌️ 1
👍 1
this syntax
Copy code
pyflyte -c tst.config --pkgs core.flyte_basics package --image a.com/b/c:latest --image task1=nsaiyed-flyte:v1 -f
the first one doesn’t have a name and is the default
p
is passing a default image name mandatory? i am guessing no
i also tried passing it via command line.. but i keep getting the same error
also if i register using the above command you gave as an example, i am not able to trigger the workflow 😞 i get this error
Request failed with status code 500 failed to create workflow in propeller Unauthorized
t
hmm. i think so actually - the default bit.
👍 1
at least we typically always include it, so not sure what the behavior is if you don’t. can always use a dummy image
👍 1
the other bit is weird though
should not have a 500
don’t suppose you have access to the cluster and can dump out the admin logs
we should improve that error message.
p
my cluster is the sandbox cluster.. and killing the container and restarting it seems to have fixed it
t
Nice
Turn it off and on again.
😛 1
p
but still specifying
@task(container_image="{{.image.task2.fqn }}:{{.image.task2.version}}")
throws an error
Copy code
containers with unready status: [axxmntxh2dpm6d742sdp-n0-0]|Failed to apply default image tag "{{.image.task1.fqn }}:{{.image.task1.version}}": couldn't parse image reference "{{.image.task1.fqn }}:{{.image.task1.version}}": invalid reference format
well.. for now i will resort to giving the image name directly since its not able to parse image reference
Copy code
@task(container_image="nsaiyed-flyte:v1")
Thanks a lot for your help
t
let’s do a video call tomorrow.
will be easier to debug over a screenshare
p
sure.. what time?
t
you free now?
p
yep
t
sweet
Copy code
flyte-cli parse-proto -f fdsa.pb -p flyteidl.admin.task_pb2.TaskSpec
p
i have the setup ready if you are available for a call?
t
hey just got in
are you still free?
p
yes
t
hop back on?
👍 1
tar -xfzv flyte-package.tgz
b
@echoing-queen-96254 @billowy-sundown-31926 @tall-lock-23197 we should document how to actually link a
flyte.config
file to a flyte workflow when serializing and registering in this page: https://docs.flyte.org/projects/cookbook/en/latest/auto/core/containerization/multi_images.html
👀 1
t
@broad-monitor-993, since the image config is not being respected, what would we be using
flyte.config
for?
b
@plain-carpenter-67621 Hi, in the config file, while providing image name, are you using underscore? Like image_name or something? That might be the issue..
p
@billowy-sundown-31926 No. example config here
170 Views