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

Richard Liu

02/28/2024, 10:20 PM
Hi team 👋 – wondering what options are available for overriding the default
image_config
when using pyflyte – ideally via environment variable like
FLYTE_INTERNAL_IMAGE
or
~/.flyte/config.yaml
. In particular, when running
Copy code
pyflyte --verbose run --remote hello-world/example.py hello_world_wf

Running example.hello_world_wf with ...
image_config=ImageConfig(default_image=Image(name='default', fqn='<http://cr.flyte.org/flyteorg/flytekit|cr.flyte.org/flyteorg/flytekit>', tag='py3.9-1.10.2'), ...
This is for a bare-bones workflow
Copy code
from flytekit import task, workflow

@task
def say_hello(name: str) -> str:
    return f"Hello, {name}!"

@workflow
def hello_world_wf(name: str = 'world') -> str:
    res = say_hello(name=name)
    return res
I'd expect when
FLYTE_INTERNAL_IMAGE=foo
then the above command would run using
foo
as the image. Digging into the code https://github.com/flyteorg/flytekit/blob/e394af0be9f904fbf8be675eaa8b8cdc24311ced/flytekit/configuration/__init__.py#L287-L290 it looks like
FLYTE_INTERNAL_IMAGE
never gets looked at and it runs using the flyte.org image instead
we'd like to override this via env var or config.yaml, so that it does not need to be manually passed in CLI via
--image
every time
c

Chris Grass

02/28/2024, 10:53 PM
you can take a look at pod templates, which should expose a property allowing you to set the image value
r

Richard Liu

02/29/2024, 12:53 AM
drafted a quick PR to give a particular idea of what my concern/question is https://github.com/flyteorg/flytekit/pull/2223/files
cc @Samhita Alla thanks for the question here, just responded!
5 Views