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

Kf operators use GetReplicaFunc (Error Handling) #4471

Merged

Conversation

Future-Outlier
Copy link
Member

@Future-Outlier Future-Outlier commented Nov 23, 2023

Describe your changes

  • move GetReplicaFunc to common package
  • make mpi, pytorch, and tensorflow use GetReplicaFunc, for better error handling
  • add error handling about resource type in pytorch and tensorflow (mpi has done it before)

Check all the applicable boxes

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

Related PRs

#4469

#4167

Future Outlier added 8 commits November 22, 2023 13:07
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
… kf-operator-use-get-replica-func

Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
@Future-Outlier Future-Outlier changed the title Kf operators use GetReplicaFunc Kf operators use GetReplicaFunc (Error Handling) Nov 23, 2023
pingsutw
pingsutw previously approved these changes Nov 23, 2023
Copy link

codecov bot commented Nov 23, 2023

Codecov Report

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

Comparison is base (98dd505) 59.73% compared to head (613a7b7) 59.37%.
Report is 18 commits behind head on master.

Files Patch % Lines
flyteplugins/go/tasks/plugins/testing/echo.go 5.00% 94 Missing and 1 partial ⚠️
...ks/pluginmachinery/flytek8s/plugin_exec_context.go 0.00% 75 Missing ⚠️
.../plugins/k8s/kfoperators/common/common_operator.go 1.58% 62 Missing ⚠️
...teplugins/go/tasks/plugins/testing/config_flags.go 16.00% 21 Missing ⚠️
...teadmin/pkg/repositories/transformers/execution.go 64.51% 11 Missing ⚠️
...o/tasks/plugins/k8s/kfoperators/pytorch/pytorch.go 64.28% 6 Missing and 4 partials ⚠️
...lugins/go/tasks/plugins/k8s/kfoperators/mpi/mpi.go 74.28% 5 Missing and 4 partials ⚠️
...s/plugins/k8s/kfoperators/tensorflow/tensorflow.go 83.72% 5 Missing and 2 partials ⚠️
flytepropeller/pkg/controller/controller.go 0.00% 6 Missing ⚠️
flytepropeller/pkg/webhook/init_cert.go 0.00% 6 Missing ⚠️
... and 3 more
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #4471      +/-   ##
==========================================
- Coverage   59.73%   59.37%   -0.36%     
==========================================
  Files         636      638       +2     
  Lines       53855    53960     +105     
==========================================
- Hits        32169    32040     -129     
- Misses      19154    19390     +236     
+ Partials     2532     2530       -2     
Flag Coverage Δ
unittests 59.37% <31.70%> (-0.36%) ⬇️

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.

@dosubot dosubot bot added the size:M This PR changes 30-99 lines, ignoring generated files. label Nov 28, 2023
@hamersaw
Copy link
Contributor

What is the error here that this is fixing?

@hamersaw
Copy link
Contributor

Theses 2 places

Oh, the name indicates the issue is with parsing replica counts. IIUC these should be set by default, so just trying to make sure this function is necessary.

With regards to adding the type checking. I can see the advantage of being safe here, but the GetTaskPhase function is only called on the resource built by this plugin. So as long as it never creates something eradic there will not be an issue.

@Future-Outlier
Copy link
Member Author

Theses 2 places

Oh, the name indicates the issue is with parsing replica counts. IIUC these should be set by default, so just trying to make sure this function is necessary.

With regards to adding the type checking. I can see the advantage of being safe here, but the GetTaskPhase function is only called on the resource built by this plugin. So as long as it never creates something eradic there will not be an issue.

Yes you are right!

@Future-Outlier
Copy link
Member Author

You can consider that use GetReplicaFunc is a kind of refactor, does this convince you?

Future Outlier added 3 commits December 4, 2023 20:48
… kf-operator-use-get-replica-func

Signed-off-by: Future Outlier <eric901201@gmai.com>
Signed-off-by: Future Outlier <eric901201@gmai.com>
@Future-Outlier Future-Outlier merged commit ad0597c into flyteorg:master Dec 4, 2023
43 of 45 checks passed
pvditt pushed a commit that referenced this pull request Dec 13, 2023
* fix bug

Signed-off-by: Future Outlier <eric901201@gmai.com>

* rename

Signed-off-by: Future Outlier <eric901201@gmai.com>

* rename

Signed-off-by: Future Outlier <eric901201@gmai.com>

* add test

Signed-off-by: Future Outlier <eric901201@gmai.com>

* move GetReplicaCount to common package

Signed-off-by: Future Outlier <eric901201@gmai.com>

* merge

Signed-off-by: Future Outlier <eric901201@gmai.com>

* merge

Signed-off-by: Future Outlier <eric901201@gmai.com>

---------

Signed-off-by: Future Outlier <eric901201@gmai.com>
Co-authored-by: Future Outlier <eric901201@gmai.com>
Co-authored-by: Kevin Su <pingsutw@apache.org>
Signed-off-by: Paul Dittamo <pvdittamo@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants