[slurm-users] Accounting: Default Associations for Unknown Accounts

Loris Bennett loris.bennett at fu-berlin.de
Fri Dec 21 00:03:00 MST 2018


Hi Ulf, Sam,

It's maybe worth bearing in mind that just adding users in the fashion
described by Sam may be OK in some cases, but you won't have the ability
to extract statistics on usage of, say, groups or departments.  For that
you would need to add accounts (in the Slurm sense of 'bank accounts' -
for us a Slurm account corresponds to a research group) in a
hierarchical manner.  That way we, for example, can extract usage
information about users, research groups, and departments.

Our solution is just have the script which does various tasks related to
setting up a new user also add the user to Slurm.  However, I am
thinking of moving to a PAM-based solution analogous to pam_mkhomedir.
That way, if a user doesn't actually login to the HPC system after n
weeks, which occasionally happens, we can throw away the user without
having to undo any changes made to the Slurm accounting database.

Cheers,

Loris

Sam Hawarden <sam.hawarden at otago.ac.nz> writes:

> Hi there,
>
> I use the following cron job that runs every night to add new users:
>
> #!/bin/bash
>
> function usersInGrp {
> echo -n $(getent group "$*" | cut -d':' -f 4- | awk -F',' '$1=$1')
> }
>
> for user in $(usersInGrp 'cluster.users'; usersInGrp 'ALT_DOMAIN1+cluster.users'; usersInGrp 'ALT_DOMAIN2+cluster.users'​)
> do
> # Check for existing account.
> if [ "$(sacctmgr -nP show user $user | awk -F'|' '{print $2}')" == "" ];
> then
> # User has no default account. Add one.
> sacctmgr add user $user DefaultAccount=nullAccount
> fi
> done
>
> There's also a relatively simple inverse script to remove users who are no longer in the group.
>
> Regards,
> Sam
>
> ---------------------------------------------------------------------------------------------------------------------------------------------------
> Sam Hawarden
> Assistant Research Fellow
> Pathology Department
> Dunedin School of Medicine
> sam.hawarden(at)otago.ac.nz
> DDI: +64 (0)3 470 3455
> Mb: +64 (0)21 898 895
> Rm 228 Hercus Building
> ---------------------------------------------------------------------------------------------------------------------------------------------------
> From: slurm-users <slurm-users-bounces at lists.schedmd.com> on behalf of Fulcomer, Samuel <samuel_fulcomer at brown.edu>
> Sent: Friday, 21 December 2018 12:02
> To: Slurm User Community List
> Subject: Re: [slurm-users] Accounting: Default Associations for Unknown Accounts 
> Yes, in a way. In thinking about this for Brown (we haven't implemented it, yet), we've the idea of having a Linux cron job periodically query the group membership of the AD
> group granted access to the HPC resource, and adding any new users to the SLURM accounting database. 
>
> We're at the point of using AD for ssh/login authentication via sssd, but still maintain an cluster/internal NIS database for pwent and cluster-specific group info (i.e., only the
> login gateways do AD authentication). Our SLURM associations are updated automatically when the NIS account is created or modified (via webmin).
>
> On Thu, Dec 20, 2018 at 5:46 PM Ulf <mopp at gmx.net> wrote:
>
>  Hello,
>  we think about switch to SLURM. Currently we grant access to the cluster using a active directory group, everyone in this group is allowed to run jobs.
>  So the users are not known to the SLURM accounting database.
>  Is it possible to automatically add every new user to an default account without manually adding the user with "sacctmgr add user user123 Account=test".
>  Regards
>  Ulf
>
>
-- 
Dr. Loris Bennett (Mr.)
ZEDAT, Freie Universität Berlin         Email loris.bennett at fu-berlin.de



More information about the slurm-users mailing list