Skip to content
This repository was archived by the owner on Jul 12, 2023. It is now read-only.

Add requests and limits in Resource#1005

Open
lupasarin wants to merge 15 commits intomasterfrom
configure-cpu-and-memory-resources
Open

Add requests and limits in Resource#1005
lupasarin wants to merge 15 commits intomasterfrom
configure-cpu-and-memory-resources

Conversation

@lupasarin
Copy link

@lupasarin lupasarin commented Aug 16, 2022

Hey, I just made a Pull Request!

Description

Motivation and Context

Have you tested this? If so, how?

Checklist for PR author(s)

  • Changes are covered by unit test
  • All tests pass
  • Code coverage check passes
  • Error handling is tested
  • Errors are handled at the appropriate layer
  • Errors that cannot be handled where they occur are propagated
  • (optional) Changes are covered by system test
  • Relevant documentation updated
  • This PR has NO breaking change to public API
  • This PR has breaking change to public API and it is documented

Checklist for PR reviewer(s)

  • This PR has been incorporated in release note for the coming version
  • Risky changes introduced by this PR have been all considered

@lupasarin lupasarin changed the title [WIP] Add requests and limits in Resource Add requests and limits in Resource Aug 16, 2022
@lupasarin lupasarin marked this pull request as ready for review August 16, 2022 15:45
@codecov
Copy link

codecov bot commented Aug 16, 2022

Codecov Report

Merging #1005 (c7bd4f9) into master (261b2f6) will increase coverage by 0.10%.
The diff coverage is 87.50%.

@@             Coverage Diff              @@
##             master    #1005      +/-   ##
============================================
+ Coverage     92.39%   92.49%   +0.10%     
- Complexity     2131     2134       +3     
============================================
  Files           199      201       +2     
  Lines          8253     8315      +62     
  Branches        501      501              
============================================
+ Hits           7625     7691      +66     
+ Misses          514      508       -6     
- Partials        114      116       +2     

@RRap0so
Copy link
Contributor

RRap0so commented Aug 16, 2022

Good stuff! Should we do some additional checks? Like:

  • Make sure resources requests < resource limit
  • Enforce some kind of reasonable upper limit (without attrition folks might abuse this)
  • Check syntax (gb, G, Mi or default to numeric values)

Copy link
Contributor

@RRap0so RRap0so left a comment

Choose a reason for hiding this comment

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

A couple of additional questions that I have:

  • Do we always need to specify a resource.
  • Are we handling backwards compatibility just fine? (Since we used the styx-scheduler part to trigger this)

Might need someone more versed in Styx. Good stuff!

private void resourceCreate() throws ExecutionException, InterruptedException {
final String id = namespace.getString(parser.resourceCreateId.getDest());
final int concurrency = namespace.getInt(parser.resourceCreateConcurrency.getDest());
final String requestsMemory = namespace.getString(parser.resourceCreateRequestsMemory.getDest());
Copy link
Contributor

Choose a reason for hiding this comment

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

This could be a Double and we default to G to reduce error proneness

@lupasarin
Copy link
Author

Good stuff! Should we do some additional checks? Like:

  • Make sure resources requests < resource limit
  • Enforce some kind of reasonable upper limit (without attrition folks might abuse this)
  • Check syntax (gb, G, Mi or default to numeric values)

Absolutely! upper limit and checks in general was in my TODO list but forgot in the end. Thanks for bringing it up!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants