Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] ContainerTask does not accept a task_config #3560

Closed
2 tasks done
vkaiser-mb opened this issue Mar 31, 2023 · 2 comments
Closed
2 tasks done

[BUG] ContainerTask does not accept a task_config #3560

vkaiser-mb opened this issue Mar 31, 2023 · 2 comments
Labels
bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers

Comments

@vkaiser-mb
Copy link

vkaiser-mb commented Mar 31, 2023

Describe the bug

As described in the docu, flytekit.ContainerTask should be able to accept a task_config argument.
Currently this fails with:

Failed with Unknown Exception <class 'TypeError'> Reason: __init__() got multiple values for keyword argument 'task_config'
__init__() got multiple values for keyword argument 'task_config'

Expected behavior

This code should execute without any error message:

from flytekitplugins.pod import Pod
from kubernetes.client.models import V1PodSpec


from flytekit import ContainerTask, workflow, kwtypes, Resources

TC = Pod(
    pod_spec=V1PodSpec(
        containers=[],
        node_selector={"key": "value"},
    )
)

ct_task = ContainerTask(
    name="ellipse-area-metadata-shell",
    task_config=TC,
    input_data_dir="/var/inputs",
    output_data_dir="/var/outputs",
    inputs=kwtypes(a=float, b=float),
    outputs=kwtypes(area=float, metadata=str),
    image="ghcr.io/flyteorg/rawcontainers-shell:v2",
    command=[
        "./calculate-ellipse-area.sh",
        "{{.inputs.a}}",
        "{{.inputs.b}}",
        "/var/outputs",
    ],
    requests=Resources(
        cpu="100m",
        mem="1G",
    ),
)


@workflow
def wf():
    ct_task

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
@vkaiser-mb vkaiser-mb added bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers labels Mar 31, 2023
@welcome
Copy link

welcome bot commented Mar 31, 2023

Thank you for opening your first issue here! 🛠

@vkaiser-mb vkaiser-mb changed the title [BUG] ContainerTask does not accept a tasl_config [BUG] ContainerTask does not accept a task_config Mar 31, 2023
@hamersaw
Copy link
Contributor

Hey @vkaiser-mb, this work is actually done as part of this issue. Basically, we decided to support a pod_template and pod_template_name argument that allows users to set Pod specific configuration on any task type. We don't yet support some plugins (ongoing work), but support for the ContainerTask landed as part of this PR. Updating the documentation is also ongoing work. Closing this as completed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working untriaged This issues has not yet been looked at by the Maintainers
Projects
None yet
Development

No branches or pull requests

2 participants