-
Notifications
You must be signed in to change notification settings - Fork 29
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
Allow K8 CPU/memory request/limit to be different values #318
Conversation
memory: '12Gi', | ||
cpu: '6', | ||
memory_limit: '12Gi', | ||
memory_request: '12Gi', | ||
cpu_limit: '6', | ||
cpu_request: '6', |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it. Yea looking this over again ctr_hash
is supposed to mimic what we read out of a YAML.
Can we reset this so we ensure backward comparability/convienience. Then maybe add some test cases similar to correctly parses container with no restart_policy
where we delete and or modify what's in ctr_hash
appropriately?
I guess I'm interested in
- when they're all 3 nil
- when they're all 3 set
- when they're all 3 different
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So backwards compatibility is there, the batch_spec
tests prove that. What's not backwards compatible is what we pass to the Container
class, but that doesn't change the YAML. I think the issue here is the actual testing is testing the wrong thing or in the wrong way. The actual YAML keys of cpu
and memory
still work so apps like what we have for Jupyter and RStudio won't have to change for this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For backwards compatibility, I think I found a way to do it in helper tests:
I will work on the other interesting tests.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added some extra test cases, so now the majority of helper tests look at cpu
and memory
and the extra tests validate when no limits of any kind are set and also validate when cpu
and memory
differ from the _limit
keys.
Fixes #316
If the new
_limit
or_request
are not specified the oldcpu
andmemory
values are used.