Hi Team I have a question, my question is from fly...
# flyte-support
a
Hi Team I have a question, my question is from flytekit import task from flytekitplugins.pod import Pod from kubernetes.client.models import V1Container, V1PodSpec, V1EnvVar @task( task_config=Pod( pod_spec=V1PodSpec( containers=[ V1Container( name="primary", env=[V1EnvVar(name="POD_SPEC_VAR", value="example_value")] ) ] ), primary_container_name="primary" ) ) def example_task(): print("Hello") print("Hallo") print("Hola") # To execute the task, you would typically call it within a workflow or directly if running locally. if name == "__main__": example_task() the workflow or task will run inside a pod of one container only(all print statements execute in single pod or container) How can I make to execute three statements in three different containers in a single pod I know its possible from pod template defining in@task(_________) decorator Is there any other methods to do that
t
no you’ll have to do what you suggested. tasks are considered the atomic unit of compute in flyte, so splitting up logic that needs to happen within one task is left up to user code. out of curiosity, what do the prints in the non-primary container represent? what are you trying to do there?
a
sorry, its just an example for my requirement under @task decorator what ever we defined it goiing to be excute inside a pod. mostly it will have only one container in the created pod. but I want to create three containers each function or statement should execute in different container in a pod