-
Notifications
You must be signed in to change notification settings - Fork 318
Add ability to specify default resource requests/limits for tasks via pyflyte run
and pyflyte register
#3229
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
base: master
Are you sure you want to change the base?
Conversation
Code Review Agent Run Status
|
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3229 +/- ##
===========================================
- Coverage 89.81% 42.83% -46.98%
===========================================
Files 136 289 +153
Lines 6599 25599 +19000
Branches 0 2932 +2932
===========================================
+ Hits 5927 10966 +5039
- Misses 672 14514 +13842
- Partials 0 119 +119 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Code Review Agent Run Status
|
Code Review Agent Run #85e95aActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Changelist by BitoThis pull request implements the following key changes.
|
Code Review Agent Run #f176edActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
4bb75b7
to
8291b77
Compare
Signed-off-by: redartera <[email protected]>
8291b77
to
59d0aec
Compare
Code Review Agent Run #a4a15bActionable Suggestions - 0Review Details
Bito Usage GuideCommands Type the following command in the pull request comment and save the comment.
Refer to the documentation for additional commands. Configuration This repository uses Documentation & Help |
Why are the changes needed?
When registering tasks with Flyte, users often need flexibility to specify resource requirements at registration time without modifying code. This is particularly useful in scenarios where:
Currently, the only options are to specify resources explicitly in task definitions or rely on cluster-level defaults, which lacks flexibility for selective overrides.
What changes were proposed in this pull request?
This PR introduces the ability to specify default resources for tasks that don't have resources explicitly defined. The implementation:
default_resources
parameter toSerializationSettings
that, if set, applies to tasks with unspecified resources--default-resources
for bothpyflyte run
andpyflyte register
commandsExample CLI usage:
How was this patch tested?
Added comprehensive unit tests:
tests/flytekit/unit/interaction/test_click_types.py
tests/flytekit/unit/core/test_serialization.py
covering:@task
decorators@dynamic
workflow tasks@eager
tasksmap_task
functionspyflyte register
andpyflyte run --remote
Check all the applicable boxes
Summary by Bito
This PR adds a new CLI feature with '--default-resources' option to 'pyflyte run' and 'pyflyte register' commands, enabling users to specify default resource requests and limits for tasks. The implementation spans CLI commands, configuration settings, and repository functions to ensure proper propagation of default settings while preserving explicitly defined resources. These changes enhance resource management flexibility without requiring task code modifications.Unit tests added: True
Estimated effort to review (1-5, lower is better): 4