Capacity report (#18)

- pull capacity report via /offers endpoint.
- calculate how many tasks (with resource and constraints) can be fit in the cluster.
examples of using the above 2 features are in aurora-scheduler/australis#33
This commit is contained in:
Tan N. Le 2022-07-28 19:27:53 -07:00 committed by GitHub
parent 5d0998647a
commit 4258634ccf
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 1012 additions and 10 deletions

View file

@ -147,6 +147,8 @@ func NewClient(options ...ClientOption) (*Client, error) {
return nil, errors.New("incomplete Options -- url, cluster.json, or Zookeeper address required")
}
config.url = url
url, err = validateAuroraAddress(url)
if err != nil {
return nil, errors.Wrap(err, "unable to create realis object, invalid url")
@ -841,3 +843,7 @@ func (c *Client) RollbackJobUpdate(key aurora.JobUpdateKey, message string) erro
}
return nil
}
func (c *Client) GetSchedulerURL() string {
return c.config.url
}