<#4638 [Core feature] Allow to specify the working...
# flytekit
a
#4638 [Core feature] Allow to specify the working dir for a container image Issue created by vkaiser-mb Motivation: Why do you think this is important? Imagine you have a workflow with 2 tasks A and B. Both tasks have different container images. Currently, the working dir is per default "/root". Both container images dont have this folder accessible. Instead it would be great if you could specify for every image the according working dir that is compatible with the image. You can change the working dir via the CLI, but this has two downsides: • You cant specify different working dirs for task A and task B • Working dir and container depend on each other and therefore should be defined in the same place in code. Note: In the local usecase, the specified working dir can be ignored, similar like the container_image is ignored. Goal: What should the final outcome look like, ideally?
Copy code
@task(container_image=Container(image="imageFoo", working_dir="/home/foo"))
def foo():

@task(container_image=Container(image="imageBar", working_dir="/home/bar"))
def bar():
and
Copy code
@task(container_image=Container(image=ImageSpec(....), working_dir="..."))
def foo():
of course it could be compatible with the old interface and still allow do specify only images if no working dir modification is needed:
Copy code
@task(container_image="imageFoo")
def foo():

@task(container_image=ImageSpec(....))
def foo():
Describe alternatives you've considered To avoid nesting, Imagespec could also have the option of working dir directly:
Copy code
@task(container_image=ImageSpec(base_image="imageFoo", working_dir="/home/foo"))
def foo():
Propose: Link/Inline OR Additional context No response Are you sure this issue hasn't been raised already? ☑︎ Yes Have you read the Code of Conduct? ☑︎ Yes flyteorg/flyte