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

[Core feature] support pod plugin for ContainerTasks #3055

Closed
2 tasks done
flixr opened this issue Nov 7, 2022 · 3 comments
Closed
2 tasks done

[Core feature] support pod plugin for ContainerTasks #3055

flixr opened this issue Nov 7, 2022 · 3 comments
Labels
enhancement New feature or request

Comments

@flixr
Copy link
Contributor

flixr commented Nov 7, 2022

Motivation: Why do you think this is important?

ContainerTasks currently don't support the pod plugin so we can't use it to control the pod and e.g. mount additional volumes or inject env vars and secrets.

Goal: What should the final outcome look like, ideally?

ContainerTask supports specifying pod spec.

Describe alternatives you've considered

Not using flyte...

Propose: Link/Inline OR Additional context

No response

Are you sure this issue hasn't been raised already?

  • Yes

Have you read the Code of Conduct?

  • Yes
@flixr flixr added enhancement New feature or request untriaged This issues has not yet been looked at by the Maintainers labels Nov 7, 2022
@hamersaw
Copy link
Contributor

hamersaw commented Nov 7, 2022

To add a little more context here - this issue is very similar to the existing request to add Pod configuration to python tasks. However, this should apply specifically to the ContainerTask, so something like:

calculate_ellipse_area_shell = ContainerTask(
    name="ellipse-area-metadata-shell",
    ...
    pod=PodConfig(),
)

@flixr
Copy link
Contributor Author

flixr commented Nov 16, 2022

Actually I think this should be labeled as a bug not a feature...
Here is a simple repro:

Run this workflow and check the logs which should print the POD_SPEC_VAR env var:

from flytekit import workflow, ContainerTask
from flytekitplugins.pod import Pod
from kubernetes.client.models import V1Container, V1PodSpec, V1EnvVar

def gen_pod():
    pod_spec_var = V1EnvVar(name="POD_SPEC_VAR", value="yay")
    primary_container = V1Container(name="primary", env=[pod_spec_var])
    pod_spec = V1PodSpec(containers=[primary_container])
    return Pod(pod_spec=pod_spec, primary_container_name="primary")

print_env = ContainerTask(
    name="container_env_test",
    image="ubuntu:22.04",
    task_config=gen_pod(),
    command=["env"]
)

@workflow
def wf():
    print_env()

@hamersaw hamersaw removed the untriaged This issues has not yet been looked at by the Maintainers label Mar 31, 2023
@hamersaw
Copy link
Contributor

Closing as completed in this PR.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants