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

Parse and serialize Step resources as WorkloadResources #140

Merged
merged 2 commits into from
Dec 13, 2023

Conversation

hylje
Copy link
Contributor

@hylje hylje commented Nov 29, 2023

Step will now always populate its resources attribute with a WorkloadResources object, which will additionally always populate its full structure down to the value fields so you can query it easily. Empty resources will serialise back into nothing when outputting back into YAML.

valohai_yaml/objs/step.py Outdated Show resolved Hide resolved
@codecov-commenter
Copy link

codecov-commenter commented Nov 29, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (42856b9) 92.09% compared to head (4bc08ab) 92.10%.

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #140   +/-   ##
=======================================
  Coverage   92.09%   92.10%           
=======================================
  Files          65       65           
  Lines        2088     2114   +26     
  Branches      356      360    +4     
=======================================
+ Hits         1923     1947   +24     
- Misses         81       82    +1     
- Partials       84       85    +1     

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

@hylje hylje force-pushed the leo-step-workload-resources branch from 7c76fbf to bc5b464 Compare November 30, 2023 11:34
@hylje hylje marked this pull request as ready for review November 30, 2023 12:06
@hylje hylje requested review from teroyks, akx and ruksi and removed request for teroyks and akx November 30, 2023 12:06
Copy link
Contributor

@teroyks teroyks left a comment

Choose a reason for hiding this comment

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

Looks legit!

Maybe we should confirm that the devices handling (only adding to the default preset) is ok before merging?

tests/test_workload_resources.py Show resolved Hide resolved
tests/test_workload_resources.py Outdated Show resolved Hide resolved
valohai_yaml/objs/step.py Show resolved Hide resolved
teroyks
teroyks previously approved these changes Dec 1, 2023
Copy link
Contributor

@teroyks teroyks left a comment

Choose a reason for hiding this comment

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

👍 for readability – and also for not rewriting history, so seeing just the changes since the previous review was possible.

teroyks
teroyks previously approved these changes Dec 1, 2023
Copy link
Contributor

@teroyks teroyks left a comment

Choose a reason for hiding this comment

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

Alas, poor functools! I knew him, Horatio

@hylje hylje force-pushed the leo-step-workload-resources branch from b6c6ae1 to 4bc08ab Compare December 1, 2023 12:47
@hylje hylje requested review from teroyks and akx December 1, 2023 13:24
@tokkoro
Copy link
Contributor

tokkoro commented Dec 13, 2023

@akx takes a look of this.

@akx akx enabled auto-merge (squash) December 13, 2023 08:15
Copy link
Member

@akx akx left a comment

Choose a reason for hiding this comment

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

There is some hairiness here, but the hair needs to go somewhere.

@akx akx merged commit fb2c26c into master Dec 13, 2023
6 checks passed
@akx akx deleted the leo-step-workload-resources branch December 13, 2023 08:15
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

Successfully merging this pull request may close these issues.

5 participants