https://flyte.org logo
#ask-the-community
Title
# ask-the-community
n

Nicholas Roberson

07/19/2023, 3:56 PM
I am trying to override the base container image that a task is using to not inherit from the parent workflow that is calling it, using
Copy code
.with_overrides(
   container_image=base_container_image_url_str
)
is not working. I have access to the base container url string. Any ideas here? I cant seem to get the image to update and have looked into
ImageSpec
but cant seem to get that working at the moment. Is there a way to set this in the
@task(task_config=...)
?
f

Fabio Grätz

07/19/2023, 4:18 PM
@task
itself has a
container_image
arg, can you use this one? You can pass a string.
This page might be helpful 🙂
n

Nicholas Roberson

07/19/2023, 4:25 PM
I have tried calling the function with
Copy code
@task(
    container_image="<container image url"
)
but have not been successful. Would running this in
map_task
affect this at all?
I am able to pull the URL for the image, log it to confirm that I am setting it, but cannot seem to get it to apply.
f

Fabio Grätz

07/19/2023, 4:26 PM
I can’t say whether map task has an effect here 🤔
n

Nicholas Roberson

07/19/2023, 4:27 PM
Hmmmm, yeah I can try to remove map_task and try this without it, however I really cant move away from my final implementation needing to use it.
f

Fabio Grätz

07/19/2023, 4:27 PM
Here it says this:
Copy code
Image reference is specified, but the version is derived from the default images version container_image="<http://docker.io/redis:{{.image.default.version}}|docker.io/redis:{{.image.default.version}}>,

Both the FQN and the version are derived from the default image container_image="{{.image.default.fqn}}:spark-{{.image.default.version}},

The images themselves are parameterizable in the config in the following format:
{{.image.<name>.<attribute>}}
Wondering whether having a var
{{..
is actually required.
But I would also first try without map task to rule it out this has any effect.
n

Nicholas Roberson

07/19/2023, 4:29 PM
@Xinzhou Liu fyi
x

Xinzhou Liu

07/19/2023, 4:39 PM
could it be that this format
{{.image.<name>.<attribute>}}
doesn’t support digest
<image_name>@sha256:<hash>
?
n

Nicholas Roberson

07/19/2023, 6:39 PM
@Fabio Grätz @Ketan (kumare3) any ideas ^
k

Ketan (kumare3)

07/19/2023, 7:02 PM
I think it may not support that
x

Xinzhou Liu

07/19/2023, 8:22 PM
got it thanks
It seems that
@task(container_image=<image_name>@sha256:<hash>)
works however. I think it could be useful to support digest in `map_task`’s
with_overrides
as well since digest is more specific. Can it be added to the roadmap?
s

Samhita Alla

07/20/2023, 7:01 AM
cc @Eduardo Apolinario (eapolinario)
e

Eduardo Apolinario (eapolinario)

07/20/2023, 5:36 PM
@Xinzhou Liu, currently it doesn't support that format. Mind opening a gh issue? @Nicholas Roberson, from the thread it's not clear if this is the issue you're seeing.