hello.. new flyte user here.. had a question about...
# ask-the-community
n
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?
y
how are you running the packaging flow @Nada Saiyed?
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
n
pyflyte --pkgs workflows package --image "my-flyte:v1" -f
y
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
n
pyflyte --pkgs workflows --config workflows/my.config package -f
would be enough?
y
mind dumping the config here too? (can redact if you need to)
n
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
y
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?
n
yep
y
sweet
hopping off for now, will be back on later.
n
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 .
y
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
n
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
y
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.
n
my cluster is the sandbox cluster.. and killing the container and restarting it seems to have fixed it
y
Nice
Turn it off and on again.
😛 1
n
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
y
let’s do a video call tomorrow.
will be easier to debug over a screenshare
n
sure.. what time?
y
you free now?
n
yep
y
sweet
Copy code
flyte-cli parse-proto -f fdsa.pb -p flyteidl.admin.task_pb2.TaskSpec
n
i have the setup ready if you are available for a call?
y
hey just got in
are you still free?
n
yes
y
hop back on?
👍 1
tar -xfzv flyte-package.tgz
n
@Marc Paquette @Smriti Satyan @Samhita Alla 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
s
@Niels Bantilan, since the image config is not being respected, what would we be using
flyte.config
for?
s
@Nada Saiyed Hi, in the config file, while providing image name, are you using underscore? Like image_name or something? That might be the issue..
n
@Smriti Satyan No. example config here
166 Views