-
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
get all available accounts for a user from the scheduler #783
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
71eab2c
get all available accounts for a user from the scheduler
johrstrom de657c0
Update lib/ood_core/job/adapters/slurm.rb
johrstrom d89843f
fix tests and add ENV variable for upcasing
johrstrom baddafa
account for OOD_UPCASE_ACCOUNTS=false
johrstrom 58273c4
move upcase_accounts? to helper
johrstrom 952cd35
add account info object so that we can attribute qos and clusters to …
johrstrom 8b5aa59
rm this testing method
johrstrom 963f049
splat args here
johrstrom 8b72830
fix this comment and move the new api.
johrstrom 3506498
add a newline here
johrstrom 982c904
Merge branch 'master' into accounts
johrstrom 27755b0
account for partitons in the tuple as well
johrstrom File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
module OodCore | ||
module Job | ||
|
||
class AccountInfo | ||
|
||
# The name of the account. | ||
attr_reader :name | ||
alias to_s name | ||
|
||
# The QoS values this account can use. | ||
attr_reader :qos | ||
|
||
# The cluster this account is associated with. | ||
attr_reader :cluster | ||
|
||
# The queue this account can use. nil means there is no queue info | ||
# for this account. | ||
attr_reader :queue | ||
|
||
def initialize(**opts) | ||
orig_name = opts.fetch(:name, 'unknown') | ||
@name = OodCore::Job::Adapters::Helper.upcase_accounts? ? orig_name.upcase : orig_name | ||
@qos = opts.fetch(:qos, []) | ||
@cluster = opts.fetch(:cluster, nil) | ||
@queue = opts.fetch(:queue, nil) | ||
end | ||
|
||
def to_h | ||
instance_variables.map do |var| | ||
name = var.to_s.gsub('@', '').to_sym | ||
[name, send(name)] | ||
end.to_h | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
pzs0715|ascend|partition_a|ascend-default | ||
pzs0714|ascend|partition_b|ascend-default | ||
pzs1124|owens||owens-default,staff,phoenix,geophys,hal,gpt | ||
pzs1118|owens||owens-default | ||
pzs1117|owens||owens-default | ||
pzs1010|owens||owens-default | ||
pzs0715|owens||owens-default | ||
pzs0714|owens||owens-default | ||
pde0006|owens||owens-default | ||
pas2051|owens||owens-default | ||
pas1871|owens||owens-default | ||
pas1754|owens||owens-default | ||
pas1604|owens||owens-default | ||
pzs1124|pitzer||pitzer-default | ||
pzs1118|pitzer||pitzer-default | ||
pzs1117|pitzer||pitzer-default | ||
pzs1010|pitzer||pitzer-default | ||
pzs0715|pitzer||pitzer-default | ||
pzs0714|pitzer||pitzer-default | ||
pde0006|pitzer||pitzer-default | ||
pas2051|pitzer||pitzer-default | ||
pas1871|pitzer||pitzer-default | ||
pas1754|pitzer||pitzer-default | ||
pas1604|pitzer||pitzer-default |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Unfortunately I can't seem to get
sacctmgr
to query per cluster, which is going to be troublesome for upper layers as each adapter object is meant to represent 1 cluster, but here we are returning information for all clusters.