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

Allow K8 CPU/memory request/limit to be different values #318

Merged
merged 5 commits into from
Aug 23, 2021
Merged

Conversation

treydock
Copy link
Contributor

Fixes #316

If the new _limit or _request are not specified the old cpu and memory values are used.

Comment on lines 319 to 322
memory: '12Gi',
cpu: '6',
memory_limit: '12Gi',
memory_request: '12Gi',
cpu_limit: '6',
cpu_request: '6',
Copy link
Contributor

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

Copy link
Contributor Author

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.

Copy link
Contributor Author

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:

bdc3c59

I will work on the other interesting tests.

Copy link
Contributor Author

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.

@johrstrom johrstrom merged commit 4802e7b into master Aug 23, 2021
@johrstrom johrstrom deleted the k8-limits branch August 23, 2021 18:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow K8 CPU/memory request/limit to be different values
2 participants