Auto_queues not changing when using auto_accounts if account names contain underscores

Hello,

We fairly recently upgraded from OOD 3 to 4.1.6.

We use auto_accounts and auto_queues and on OOD v3 this worked just fine. Our account names contain merely lowercase letters and underscores.

Since the upgrade to 4.1.6, changing account in the auto_accounts box no longer adjusts auto_queues to show the partitions defined via AllowAccounts for that partition in slurm.conf if the user is in more than one account containing underscores (when they are in just one it does work). I.e.:

  • User is in account and account_one - fine, partitions with AllowAccounts=account_one appear when selecting account_one, and disappear again when selecting account

  • User is in account, account_one and account_two - partitions don’t dynamically adjust, not for account_one or account_two - only those partitions for account appear, nothing changes when you select either account_one or account_two

    We’ve seen some things that give us insight but not a fix:

  1. data-alias

Perhaps useful when using custom defined dropdowns, but as far as I’m aware not that useful here. In fact, using the F12 inspector on 4.1.6 we can see that automatically data-alias-account2 appears to be set but isn’t working.

  1. Automatic Attributes Support Accounts with Special Characters

    Doesn’t appear to be the case for us :frowning:

  2. This PR: Normalize dynamic batch connect tokens with underscores (#4251) by bstepanovski · Pull Request #5462 · OSC/ondemand · GitHub

We’ve tried updating to the latest v4.2.3 on a test box and the issue remains.

Note, if we change the account names to remove all underscores so they are simply purely lowercase letters, the issue is resolved. That’s easy to test, but much harder to deploy in production, as there is a tranche of documentation etc. for our facility based around the account names with underscores.

Our hunch is that this is considered fixed but tests only have scope for cluster names containing underscores?

Hi and welcome!

It definitely sounds like you have identified a gap in the current testing, would you mind sharing the relevant lines from sacctmgr -nP show users withassoc format=account,qos where user=<USER> cluster=<CLUSTER> and scontrol show part -o -M <CLUSTER>? You can see the test fixtures that we added as part of the data alias feature in Allow special characters in auto_accounts by adding data-alias by Bubballoo3 · Pull Request #4673 · OSC/ondemand · GitHub to get an idea of what we would need.

It sounds like the situation you describe is absolutely one we would like to support, and while the tests do include multiple accounts with special characters, there is only one with an underscore, so that may be the missing piece. Once we have your output from sacctmgr and scontrol, that should allow us to replicate the bug and eventually add it into the fixtures to ensure it stays fixed.

Thanks so much for alerting us to this!

Hi Braeden,

Hopefully this is enough…

Example of affected account (redacted to exemplar UID, cluster name etc. but in the same format):

$ sacctmgr -nP show users withassoc format=account,qos where user=ab123456 cluster=cluster
pilot|normal,ood
pilot_gpu|normal,ood
pilot_vip_gpu|normal,ood

$ scontrol show part -o -M cluster
PartitionName=gpu AllowGroups=ALL AllowAccounts=pilot_gpu,sys-admins (etc.)
...
PartitionName=vip AllowGroups=ALL AllowAccounts=pilot_vip_gpu,sys-admins (etc.)

If it helps, an unaffected account would be in just the pilot account or pilot and one of pilot_gpu or pilot_vip_gpu; affected accounts are in pilot and two or more partitions containing underscores. The sys-admins Slurm account is in AllowAccounts for all partitions so our admin team can submit to any partition for testing etc. Users are scoped to a limited number of accounts that match to accompanying partitions. All partitions are named using just lowercase, no spaces or special characters.

Hope that’s enough?

That was enough for me to replicate the issue! Interestingly enough, it works fine on latest but not either of the recent releases (4.1.6 or 4.2.3). It appears to just be the auto_queues widget that is broken, the correct HTML for the select widget should be

<select class="form-select" name="batch_connect_session_context[auto_queues]" id="batch_connect_session_context_auto_queues">
    <option data-option-for-auto-accounts-pilot="false" data-alias-account0="pilot_vip_gpu" data-option-for-auto-accounts-account0="false" value="gpu" style="">gpu</option>
    <option data-option-for-auto-accounts-pilot="false" data-alias-account1="pilot_gpu" data-option-for-auto-accounts-account1="false" value="vip" style="display: none;" disabled="">vip</option>
</select>

But, as you note, the buggy HTML sets both aliases as account2 and breaks

<select class="form-select" name="batch_connect_session_context[auto_queues]" id="batch_connect_session_context_auto_queues">
    <option data-option-for-auto-accounts-pilot="false" data-alias-account2="pilot_vip_gpu" data-option-for-auto-accounts-account2="false" value="gpu" disabled="" style="display: none;">gpu</option>
    <option data-option-for-auto-accounts-pilot="false" data-alias-account2="pilot_gpu" data-option-for-auto-accounts-account2="false" value="vip" disabled="" style="display: none;">vip</option>
</select>

The fact that this is working on master means that the solution is certainly within reach, it must have been fixed by something that was not explicitly a bug fix and so was not backported. Now that we are aware of it though, you can expect it to be fixed in the next round of patches coming in September.

In the meantime, you could use the data-alias feature to define a global attribute to fill the gap. Something like

global_bc_form_items:
  global_auto_queues:
    widget: select
    options:
      - [ 'gpu', 'gpu', data-alias-account0: "pilot_vip_gpu", data-option-for-auto-accounts-account0: "false" ]
      - [ 'vip', 'vip', data-alias-account1: "pilot_gpu", data-option-for-auto-accounts-account1: "false" ]

in your ondemand.yml file. That at least lets you keep a single definition for your shim, but does not get around having to update each app to use the new form item. I would be happy to answer any questions or provide any help with that if you would like! I’ve also created auto_queues generates invalid data-alias HTML with multiple accounts with underscores · Issue #5615 · OSC/ondemand · GitHub to track this going forward. Thanks so much for bringing this to our attention!