René Persé
10/17/2023, 9:55 AMContainerTask
wich can mount inputs into input_data_dir
but that would require the workaround to write a shell script that reads the input and builds + runs the actual command-line.
@task(task_config=Pod(pod_spec=V1PodSpec(...)))
def pod_task(name: str):
"""how to inject task input `name` into args command-line for my custom docker image sidecar container?"""
Dan Farrell
10/17/2023, 4:24 PMsubprocess.run
?Pryce
10/17/2023, 11:50 PMRené Persé
10/18/2023, 7:31 AM{inputs.message}
in my argument line):
@task(
task_config=Pod(
pod_spec=V1PodSpec(
containers=[
V1Container(
name="notify",
command=["cowsay"],
args=["{inputs.message}"],
image="docker/whalesay",
)
]
)
)
)
def notify(message: str) -> str:
...
Pryce
10/18/2023, 7:49 PMContainerTask
will already override whatever is specified in the entrypoint/cmd of the Dockerfile. So it should look something like this:
notify = ContainerTask(
name="notify",
input_data_dir="/var/inputs",
output_data_dir="/var/outputs",
inputs=kwtypes(exec=float, args=float),
outputs=kwtypes(out=str),
image="ghcr.io/flyteorg/rawcontainers-shell:v2",
command=[
"{{.inputs.exec}}",
"{{.inputs.args}}",
"-o {{.outputs.out}}",
],
)
Perhaps if you could share more specifically what container, commands and expected inputs and outputs are I could assist more specifically. Hope it helps.