-
Notifications
You must be signed in to change notification settings - Fork 163
remove queues from auto_queues using {Allow,Deny}Qos #4471
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -55,6 +55,9 @@ def dynamic_accounts | |||||
|
|
||||||
| # To be used with dynamic forms. This method stithes together data | ||||||
| # about the queue's availability WRT clusters. | ||||||
| # If the user has no account with access to a given queue, it is excluded. | ||||||
| # If a user has access to a given queue but only with specific accounts, | ||||||
| # data attributes are added to indicate which accounts can *not* be used for that queue. | ||||||
| # | ||||||
| # @return [Array] - the dynamic form options | ||||||
| def queues | ||||||
|
|
@@ -132,13 +135,7 @@ def unique_qos_names | |||||
|
|
||||||
| # do you have _any_ account that can submit to this queue? | ||||||
| def blocked_queue?(queue) | ||||||
| allow_accounts = queue.allow_accounts | ||||||
|
|
||||||
| if allow_accounts.nil? | ||||||
| false | ||||||
| else | ||||||
| allow_accounts.intersection(account_names).empty? | ||||||
| end | ||||||
| (accounts.select {|account| account_allowed?(queue, account)}).none? | ||||||
| end | ||||||
|
|
||||||
| def queues_per_cluster | ||||||
|
|
@@ -152,20 +149,23 @@ def queues_per_cluster | |||||
| end | ||||||
|
|
||||||
| def queue_account_data(queue) | ||||||
| unavailable_accounts = account_names.reject do |account| | ||||||
| unavailable_accounts = account_names.reject do |account| | ||||||
| account_allowed?(queue, account) | ||||||
| end | ||||||
| end.map(&:to_s) | ||||||
| disabled_account_data(unavailable_accounts) | ||||||
| end | ||||||
|
|
||||||
| def account_allowed?(queue, account_name) | ||||||
| return false if queue.deny_accounts.any? { |account| account == account_name } | ||||||
|
|
||||||
| if queue.allow_accounts.nil? | ||||||
| true | ||||||
| else | ||||||
| queue.allow_accounts.any? { |account| account == account_name } | ||||||
| end | ||||||
| # can _this_ account submit to this queue? | ||||||
| def account_allowed?(queue, account) | ||||||
| # This is the simplest possible implementation, and may not reflect the actual behavior of any | ||||||
| # given resource manager. For example, Slurm completely ignores DenyQos when AllowQos exists. | ||||||
| # This behavior is replicated in OOD Core by conditionally setting deny_qos to an empty array. | ||||||
| return false if queue.allow_accounts && !queue.allow_accounts.include?(account.to_s) | ||||||
| return false if queue.deny_accounts.include?(account.to_s) | ||||||
| return false if queue.allow_qos && (queue.allow_qos & account.qos).none? | ||||||
| return false if (queue.deny_qos & account.qos).any? | ||||||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this was wrong. If you have 3 QoS and one of those are denied, you still have access via the other 2 QoS. Only if all of your account's QoS denied should the account be considered denied. |
||||||
|
|
||||||
| true | ||||||
| end | ||||||
|
|
||||||
| def disabled_account_data(disabled_accounts) | ||||||
|
|
||||||
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.
This line is always being returned in the test cases. Somehow the computation of qos is off.