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

2018-11-07 Thread Antony Cleave
Try adding a default account and then set a limit of 0 jobs on it.

>From memory I think it is grpjobs

This is the maximum allowed jobs this account can have queued.

This requires limits to be enforced in accountingstorageenforce


Or you could simply add the account to the denyaccount list for the default
partition. However you need to remember to add it again if you ever
override that default on a per partition basis.

Antony





On Mon, 5 Nov 2018, 22:11 Brian Andrus  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
>
>
>


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

2018-11-07 Thread Marcin Stolarek
I had exactly the same requirement - you can find my notes from it here;
https://funinit.wordpress.com/2018/06/07/how-to-use-job_submit_lua-with-slurm/


cheers,
Marcin

wt., 6 lis 2018 o 20:48 Sam Hawarden  napisał(a):

> Hi Yair,
>
>
> You can set maxsubmitjob=0 on an account.
>
>
> The error message isn't helpful beyond the obvious though:
>
>
> ] salloc
> salloc: error: AssocMaxSubmitJobLimit
> salloc: error: Job submit/allocate failed: Job violates accounting/QOS
> policy (job submit limit, user's size and/or time limits)
>
> So the lua script is preferable.
>
> Kind regards,
>
>   Sam
> ​
> --
> *From:* slurm-users  on behalf of
> Yair Yarom 
> *Sent:* Wednesday, 7 November 2018 00:58
> *To:* Slurm User Community List
> *Subject:* Re: [slurm-users] Accounting: set default account with no
> access
>
> Hi,
>
> You can set the maxsubmitjob=0 on that default account. That should
> prevent anyone from using it, but it won't have a specific message like
> with the lua plugin. E.g.
> sacctmgr update account default set maxsubmitjob=0
>
> Regards,
> Yair.
>
>
> On Tue, Nov 6, 2018 at 12:58 AM Renfro, Michael  wrote:
>
>> 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  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
>> >
>> >
>>
>>
>>


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

2018-11-06 Thread Sam Hawarden
Hi Yair,


You can set maxsubmitjob=0 on an account.


The error message isn't helpful beyond the obvious though:


] salloc
salloc: error: AssocMaxSubmitJobLimit
salloc: error: Job submit/allocate failed: Job violates accounting/QOS policy 
(job submit limit, user's size and/or time limits)

So the lua script is preferable.


Kind regards,

  Sam

?

From: slurm-users  on behalf of Yair 
Yarom 
Sent: Wednesday, 7 November 2018 00:58
To: Slurm User Community List
Subject: Re: [slurm-users] Accounting: set default account with no access

Hi,

You can set the maxsubmitjob=0 on that default account. That should prevent 
anyone from using it, but it won't have a specific message like with the lua 
plugin. E.g.
sacctmgr update account default set maxsubmitjob=0

Regards,
Yair.


On Tue, Nov 6, 2018 at 12:58 AM Renfro, Michael 
mailto:ren...@tntech.edu>> wrote:
>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 
> mailto:toomuc...@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
>
>