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

Fix: Handle overriding of container image in backend #4858

Merged
merged 22 commits into from
Feb 21, 2024

Conversation

fg91
Copy link
Member

@fg91 fg91 commented Feb 7, 2024

Tracking issue

#4543

Why are the changes needed?

The container_image task node override, among others, is currently broken (doesn't work with pyflyte register and only once with pyflyte run, see tracking issue.

What changes were proposed in this pull request?

Add container_image to TaskNodeOverride proto, set override in v1alpha1.NodeSpec in flytepropeller and actually apply the image override in the pod spec.

How was this patch tested?

  • Ran flyteadmin and flytepropeller on my dev machine. Was able to override container image in flytekit and confirm overridden image in the pod in the cluster.

    I tested this for normal python function tasks, kubeflow pytorch elastic tasks, map tasks, and array node map tasks.

  • Added unit tests.

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

flyteorg/flytekit#2176

Docs link

@fg91 fg91 force-pushed the fg91/fix/handle-container-image-override-backend branch from 8df6fe5 to eb687b8 Compare February 9, 2024 19:09
Copy link

codecov bot commented Feb 9, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (1ae5a8f) 58.92% compared to head (53f1f4d) 58.94%.

Files Patch % Lines
...ks/pluginmachinery/flytek8s/plugin_exec_context.go 0.00% 2 Missing ⚠️
...propeller/pkg/apis/flyteworkflow/v1alpha1/nodes.go 0.00% 2 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4858      +/-   ##
==========================================
+ Coverage   58.92%   58.94%   +0.01%     
==========================================
  Files         645      645              
  Lines       55380    55398      +18     
==========================================
+ Hits        32635    32652      +17     
- Misses      20161    20163       +2     
+ Partials     2584     2583       -1     
Flag Coverage Δ
unittests 58.94% <77.77%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@fg91 fg91 force-pushed the fg91/fix/handle-container-image-override-backend branch from f8b37d5 to bd96c79 Compare February 9, 2024 20:39
@fg91 fg91 changed the title [WIP] Fix: Handle overriding of container image in backend Fix: Handle overriding of container image in backend Feb 9, 2024
@fg91 fg91 marked this pull request as ready for review February 9, 2024 20:44
@dosubot dosubot bot added size:L This PR changes 100-499 lines, ignoring generated files. bug Something isn't working labels Feb 9, 2024
@fg91 fg91 self-assigned this Feb 9, 2024
@dosubot dosubot bot added size:XL This PR changes 500-999 lines, ignoring generated files. and removed size:L This PR changes 100-499 lines, ignoring generated files. labels Feb 9, 2024
@fg91 fg91 requested review from jeevb and hamersaw February 9, 2024 21:48
@fg91
Copy link
Member Author

fg91 commented Feb 9, 2024

@hamersaw @jeevb I tagged you because I saw that both of you recently touched overriding of either extended resources or caching. Do you think I should rather tag somebody else though?

@fg91 fg91 force-pushed the fg91/fix/handle-container-image-override-backend branch from 7f934cb to faf3d3e Compare February 15, 2024 14:50
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
@fg91 fg91 force-pushed the fg91/fix/handle-container-image-override-backend branch from 4b0979d to 53f1f4d Compare February 15, 2024 15:38
@fg91 fg91 requested a review from pingsutw February 15, 2024 16:31
Copy link
Member

@pingsutw pingsutw left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thank you!

@dosubot dosubot bot added the lgtm This PR has been approved by a maintainer label Feb 16, 2024
@hamersaw hamersaw merged commit e39acc7 into master Feb 21, 2024
49 checks passed
@hamersaw hamersaw deleted the fg91/fix/handle-container-image-override-backend branch February 21, 2024 02:34
yubofredwang pushed a commit to yubofredwang/flyte that referenced this pull request Mar 26, 2024
* Add container image to TaskNodeOverrides proto

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Add container image override to v1alpha1.NodeSpec

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Override container image in pod

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Add unit test for creation of task node with image override

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Add unit test for building a pod with container image override

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Re-generate flytidl

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Mock GetContainerImage for ExecutableNode

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Make dask tests pass

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Lint

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Make kubeflow tests pass

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Make spark tests pass

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Make ray tests pass

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Fix remaining flyteplugins tests

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Add container test for image overriding

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Add container image override test for  pytorch jobs

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Add ray test for container image overriding

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Re-generate flyteidl

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Add comment about container_image to TaskNodOverride proto

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Re-generate flyteidl

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Re-generate propeller

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Lint

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

* Re-generate flyteidl

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>

---------

Signed-off-by: Fabio Graetz <fabiograetz@googlemail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working lgtm This PR has been approved by a maintainer size:XL This PR changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants