I am trying to override the base container image t...
# flyte-support
q
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=...)
?
c
@task
itself has a
container_image
arg, can you use this one? You can pass a string.
This page might be helpful 🙂
q
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.
c
I can’t say whether map task has an effect here 🤔
q
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.
👍 1
c
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.
q
@thousands-car-79657 fyi
t
could it be that this format
{{.image.<name>.<attribute>}}
doesn’t support digest
<image_name>@sha256:<hash>
?
q
@cool-lifeguard-49380 @freezing-airport-6809 any ideas ^
f
I think it may not support that
t
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?
t
cc @high-accountant-32689
h
@thousands-car-79657, currently it doesn't support that format. Mind opening a gh issue? @quick-barista-52015, from the thread it's not clear if this is the issue you're seeing.
👍 1