I am trying to override the base container image t...
# ask-the-community
n
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
@task
itself has a
container_image
arg, can you use this one? You can pass a string.
This page might be helpful 🙂
n
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
I can’t say whether map task has an effect here 🤔
n
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
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
@Xinzhou Liu fyi
x
could it be that this format
{{.image.<name>.<attribute>}}
doesn’t support digest
<image_name>@sha256:<hash>
?
n
@Fabio Grätz @Ketan (kumare3) any ideas ^
k
I think it may not support that
x
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
cc @Eduardo Apolinario (eapolinario)
e
@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.