cuddly-jelly-27016
03/19/2025, 3:08 AMmap_task with a custom pod definition. I am able to have my definition work with a regular @task and with @dynamic, but not when using a map_task as with the example. This is with flytekit and propeller set to 1.15.0.
@task(
task_config=Pod(
pod_spec=V1PodSpec(
containers=[
V1Container(
name="primary",
resources=V1ResourceRequirements(
requests={"cpu": ".5", "memory": "500Mi"},
limits={"cpu": ".5", "memory": "500Mi"},
),
)
],
init_containers=[
V1Container(
image="alpine",
name="init",
command=["/bin/sh"],
args=["-c", 'echo "I\'m a customizable init container"'],
resources=V1ResourceRequirements(
limits={"cpu": ".5", "memory": "500Mi"},
),
)
],
),
),
)
def map_pod_task(int_val: int) -> str:
return str(int_val)
@task
def coalesce(list_of_strings: List[str]) -> str:
coalesced = ", ".join(list_of_strings)
return coalesced
@workflow
def map_pod_workflow(list_of_ints: List[int]) -> str:
mapped_out = map_task(map_pod_task)(int_val=list_of_ints)
coalesced = coalesce(list_of_strings=mapped_out)
return coalesced
I've tried many permutations of this with no luck. The array node items enter Unknown state and hang indefinitely.
This is the error in propeller:
{"json":{"exec_id":"azfq9cmbljzrkpqhp6r6","ns":"redacted-development","res_ver":"24222531","routine":"worker-19","wf":"redacteddevelopmentredacted.workflows.v2.run_batch"},"level":"error","msg":"Error when trying to reconcile workflow. Error [worker error(s) encountered: [0]: failed at Node[n0]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [sidecar]: [BadTaskSpecification] invalid TaskSpecification, primary container [primary] not defined\n[1]: failed at Node[n1]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [sidecar]: [BadTaskSpecification] invalid TaskSpecification, primary container [primary] not defined\n[2]: failed at Node[n2]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [sidecar]: [BadTaskSpecification] invalid TaskSpecification, primary container [primary] not defined\n]. Error Type[*errors.errorString]","ts":"2025-03-19T025845Z"}
E0319 025845.803081 1 workers.go:103] error syncing redacted-development/azfq9cmbljzrkpqhp6r6': worker error(s) encountered: [0]: failed at Node[n0]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [sidecar]: [BadTaskSpecification] invalid TaskSpecification, primary container [primary] not defined
[1]: failed at Node[n1]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [sidecar]: [BadTaskSpecification] invalid TaskSpecification, primary container [primary] not defined
[2]: failed at Node[n2]. RuntimeExecutionError: failed during plugin execution, caused by: failed to execute handle for plugin [sidecar]: [BadTaskSpecification] invalid TaskSpecification, primary container [primary] not defined
### Expected behavior
When providing a custom pod definition to a map_task, I would expect the task to execute successfully.
### Additional context to reproduce
No response
### Screenshots
No response
### Are you sure this issue hasn't been raised already?
• Yes
### Have you read the Code of Conduct?
• Yes
flyteorg/flytecuddly-jelly-27016
03/20/2025, 7:18 PM