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] Flytekit duplicates env vars when pod template is specified #5809

Open
LucasZanellaMBTI opened this issue Oct 4, 2024 · 6 comments
Open
Assignees

Comments

@LucasZanellaMBTI
Copy link

Describe the bug

Containers in pod spec contain duplicate env vars. We can see this problem occur as soon as we define a pod_template and pass it to task decorator.

Expected behavior

Env vars specified and passed via environment param are not being duplicated

Additional context to reproduce

@task(environment={"MY_ENV_VAR": "bug"}, pod_template=PodTemplate())
def hello_world(name: str) -> str:
  pass
pyflyte run --remote hello.py my_wf

Tested on flytekit v1.11.0 & v1.13.7

We spent some time debugging it and it seems problem is caused in func get_serializable_task of flytekit/tools/translator.py.
There we see the method get_k8s_pod is called multiple times. Unfortunately, each call appends env vars to every container specified in pod_spec.

Screenshots

image

Lucas Zanella [email protected], Mercedes-Benz Tech Innovation GmbH
Provider Information

Copy link

welcome bot commented Oct 4, 2024

Thank you for opening your first issue here! 🛠

@ChengyanOo
Copy link

Hi @LucasZanellaMBTI, I'd love to work on this issue, could you assign this to me?

@LucasZanellaMBTI
Copy link
Author

Hi @ChengyanOo , I'm glad to read that. Unfortunately I cannot assign this PR to anyone as I miss required permissions.

@ChengyanOo
Copy link

Hi @ChengyanOo , I'm glad to read that. Unfortunately I cannot assign this PR to anyone as I miss required permissions.

Thanks for your reply man, do you know who should I contact to figure that out?

@LucasZanellaMBTI
Copy link
Author

We will try to reach out developers via their slack channel.

@ChengyanOo
Copy link

We will try to reach out developers via their slack channel.

Thanks!

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

No branches or pull requests

2 participants