Ticket 18887 - Pattern Match for Allow/Deny Accounts/Groups
Summary: Pattern Match for Allow/Deny Accounts/Groups
Status: OPEN
Alias: None
Product: Slurm
Classification: Unclassified
Component: Limits (show other tickets)
Version: 23.02.7
Hardware: Linux Linux
: 5 - Enhancement
Assignee: Unassigned Developer
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2024-02-06 13:39 MST by Paul Edmon
Modified: 2024-08-16 17:15 MDT (History)
1 user (show)

See Also:
Site: Harvard University
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
NoveTech Sites: ---
Nvidia HWinf-CS Sites: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Tzag Elita Sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed:
Target Release: 25.05
DevPrio: ---
Emory-Cloud Sites: ---


Attachments

Note You need to log in before you can comment on or make changes to this ticket.
Description Paul Edmon 2024-02-06 13:39:11 MST
We have a bunch of accounts that all have similar headers that we want to block from specific partitions. For instance we want to block or permit group_* and all the groups of that pattern. Is there a way to do this in Slurm with out listing out all the groups? Could a pattern match functionaliyy be added via either * or regex?
Comment 1 Ricard Zarco Badia 2024-02-07 02:38:55 MST
Hello Paul,

I've checked and currently there isn't any type of name expansion logic when parsing names from partition configuration options like AllowGroups or AllowAccounts. 

However, an option to simplify your list (taking into account the current limitations) would be to make use of the account hierarchy. AllowAccounts also works for all subaccounts down the hierarchy [1], so if you are working with those, you could just join all your desired accounts under other parent accounts and just use those as a filter. This depends entirely on your needs, but it might be more work than just specifying the full group/account list in the partition configuration. 

Best regards, Ricard.

[1] https://slurm.schedmd.com/slurm.conf.html#OPT_AllowAccounts
Comment 2 Paul Edmon 2024-02-07 08:04:27 MST
That won't really work for our fairshare set up as we are using classic 
fairshare and have no intention of moving to Fair Tree. Nesting also 
doesn't work with in our fairshare policy and schema.  It would be good 
to add this feature for greater flexibility for those who can't do nesting.

-Paul Edmon-

On 2/7/2024 4:38 AM, bugs@schedmd.com wrote:
>
> *Comment # 1 <https://bugs.schedmd.com/show_bug.cgi?id=18887#c1> on 
> bug 18887 <https://bugs.schedmd.com/show_bug.cgi?id=18887> from Ricard 
> Zarco Badia <mailto:ricard@schedmd.com> *
> Hello Paul,
>
> I've checked and currently there isn't any type of name expansion logic when
> parsing names from partition configuration options like AllowGroups or
> AllowAccounts.
>
> However, an option to simplify your list (taking into account the current
> limitations) would be to make use of the account hierarchy. AllowAccounts also
> works for all subaccounts down the hierarchy [1], so if you are working with
> those, you could just join all your desired accounts under other parent
> accounts and just use those as a filter. This depends entirely on your needs,
> but it might be more work than just specifying the full group/account list in
> the partition configuration.
>
> Best regards, Ricard.
>
> [1]https://slurm.schedmd.com/slurm.conf.html#OPT_AllowAccounts
> ------------------------------------------------------------------------
> You are receiving this mail because:
>
>   * You reported the bug.
>
Comment 4 Ricard Zarco Badia 2024-02-07 09:02:03 MST
Hello Paul,

We are evaluating the viability of this. Just to make the scope very clear, would something like "AllowAccounts=account*,account2*,..." be sufficient for your needs? 

I want to make clear that I'm specifically talking about the AllowAccounts option and only name suffix expansion, without going into more regex-like features.

Best regards, Ricard.
Comment 5 Paul Edmon 2024-02-07 09:05:43 MST
Yes, a star would be fine. It would be great to do that for 
AllowAccounts, AllowGroups, DenyAccounts, DenyGroups, as they all have 
the same problem of listing out a huge number of groups when a pattern 
match would do.

A regex would give more flexibility but is likely more work, a * would 
work fine for our situation.

-Paul Edmon-

On 2/7/2024 11:02 AM, bugs@schedmd.com wrote:
>
> *Comment # 4 <https://bugs.schedmd.com/show_bug.cgi?id=18887#c4> on 
> bug 18887 <https://bugs.schedmd.com/show_bug.cgi?id=18887> from Ricard 
> Zarco Badia <mailto:ricard@schedmd.com> *
> Hello Paul,
>
> We are evaluating the viability of this. Just to make the scope very clear,
> would something like "AllowAccounts=account*,account2*,..." be sufficient for
> your needs?
>
> I want to make clear that I'm specifically talking about the AllowAccounts
> option and only name suffix expansion, without going into more regex-like
> features.
>
> Best regards, Ricard.
> ------------------------------------------------------------------------
> You are receiving this mail because:
>
>   * You reported the bug.
>
Comment 7 Ricard Zarco Badia 2024-02-08 03:42:44 MST
Hello Paul,

We can implement a basic name expansion for names ending with "*" for the Allow/DenyAccounts option, but this won't be added in the short term and will most likely be for the next major release of Slurm.

I will be changing the severity level to 5 (enhancement).

Best regards, Ricard.
Comment 8 Paul Edmon 2024-02-12 08:09:00 MST
Thanks!

-Paul Edmon-

On 2/8/24 5:42 AM, bugs@schedmd.com wrote:
> Ricard Zarco Badia <mailto:ricard@schedmd.com> changed bug 18887 
> <https://bugs.schedmd.com/show_bug.cgi?id=18887>
> What 	Removed 	Added
> Severity 	4 - Minor Issue 	5 - Enhancement
> Target Release 	--- 	24.08
>
> *Comment # 7 <https://bugs.schedmd.com/show_bug.cgi?id=18887#c7> on 
> bug 18887 <https://bugs.schedmd.com/show_bug.cgi?id=18887> from Ricard 
> Zarco Badia <mailto:ricard@schedmd.com> *
> Hello Paul,
>
> We can implement a basic name expansion for names ending with "*" for the
> Allow/DenyAccounts option, but this won't be added in the short term and will
> most likely be for the next major release of Slurm.
>
> I will be changing the severity level to 5 (enhancement).
>
> Best regards, Ricard.
> ------------------------------------------------------------------------
> You are receiving this mail because:
>
>   * You reported the bug.
>