Hi wondering if there is a way to execute a Contai...
# flyte-support
c
Hi wondering if there is a way to execute a ContainerTask locally (mostly for testing purposes)? Looking into the
execute
method, it seems the only reason it isn't working right now is that the commands here is not substitute things like
{{.inputs.input_parameter}}
into the actual value, e.g.,
Copy code
task = ContainerTask(
    name="something-in-your-own-container",
    input_data_dir="/var/inputs",
    output_data_dir="/var/outputs",
    image="ubuntu:24.04",
    inputs=kwtypes(input_parameter=int),
    outputs=kwtypes(output_parameter=int),
    command=[
        "sh",
        "-c",
        "echo {{.inputs.input_parameter}} > /var/outputs/output_parameter",
    ],
)

task.execute(input_parameter=1)
r
yes if you run locally,
pyflyte run
does a
docker run
for you under the hood. i dont think you can just call
execute()
like in your example tho
f
Ya, it will emulate single container run