[slurm-users] Accounting: set default account with no access

Renfro, Michael Renfro at tntech.edu
Mon Nov 5 15:53:36 MST 2018


>From https://stackoverflow.com/a/46176694:

>> I had the same requirement to force users to specify accounts and, after finding several ways to fulfill it with slurm, I decided to revive this post with the shortest/easiest solution.
>> 
>> The slurm lua submit plugin sees the job description before the default account is applied. Hence, you can install the slurm-lua package, add "JobSubmitPlugins=lua" to the slurm.conf, restart the slurmctld, and directly test against whether the account was defined via the job_submit.lua script (create the script wherever you keep your slurm.conf; typically in /etc/slurm/):
>> 
>> -- /etc/slurm/job_submit.lua to reject jobs with no account specified
>> 
>> function slurm_job_submit(job_desc, part_list, submit_uid)
>>     if job_desc.account == nil then
>>             slurm.log_error("User %s did not specify an account.", job_desc.user_id)
>>             slurm.log_user("You must specify an account!")
>>             return slurm.ERROR
>>     end
>>     return slurm.SUCCESS
>> end
>> 
>> function slurm_job_modify(job_desc, job_rec, part_list, modify_uid)
>>     return slurm.SUCCESS
>> end
>> 
>> return slurm.SUCCESS

> On Nov 5, 2018, at 4:09 PM, Brian Andrus <toomuchit at gmail.com> wrote:
> 
> All,
> 
> I am trying to figure the best way to require users to explicitly specify an account when submitting jobs (--account= )
> 
> What I was thinking was to create a default account for the users that has no ability to submit any jobs, so if they don't specify, any submission would fail.
> 
> What I'm not seeing is how to set such an option on an account. I was hoping to do something like cluster=none for it's access, but that is not allowed.
> 
> 
> Is there a way to set an account to not have access to submit jobs?
> Alternatively is there an easier way to require the --account= option for jobs?
> 
> 
> Brian Andrus
> 
> 




More information about the slurm-users mailing list