[slurm-users] [External] How to detect Job submission by srun / interactive jobs

Yair Yarom irush at cs.huji.ac.il
Tue May 19 07:10:57 UTC 2020


Hi,

We have here a job_submit_limit_interactive plugin that limits interactive
jobs and can force a partition for such jobs. It also limits the number of
concurrent interactive jobs per user by using the license system. It's
written in c, so compilation is required. It can be found in:
https://github.com/irush-cs/slurm-plugins

Note that while it depends on what exactly you're trying to avoid, users
can somewhat easily circumvent this by e.g. submitting an sbatch of a
jupyter notebook.

Best regards,
    Yair.


On Mon, May 18, 2020 at 6:25 PM Florian Zillner <fzillner at lenovo.com> wrote:

> Hi Stephan,
>
> From the slurm.conf docs:
> ---
> BatchFlag
> Jobs submitted using the sbatch command have BatchFlag set to 1. Jobs
> submitted using other commands have BatchFlag set to 0.
> ---
> You can look that up e.g. with scontrol show job <jobid>. I haven't
> checked though how to access that via lua. If you know, let me know, I'd be
> interested as well.
>
> Example:
> # scontrol show job 128922
> JobId=128922 JobName=sleep
>    ...
>    JobState=RUNNING Reason=None Dependency=(null)
>    Requeue=1 Restarts=0 BatchFlag=0 Reboot=0 ExitCode=0:0
>    RunTime=00:00:54 TimeLimit=00:30:00 TimeMin=N/A
>
> Cheers,
> Florian
>
> -----Original Message-----
> From: slurm-users <slurm-users-bounces at lists.schedmd.com> On Behalf Of
> Stephan Roth
> Sent: Montag, 18. Mai 2020 16:04
> To: slurm-users at lists.schedmd.com
> Subject: [External] [slurm-users] How to detect Job submission by srun /
> interactive jobs
>
> Dear all,
>
> Does anybody know of a way to detect whether a job is submitted with
> srun, preferrably in job_submit.lua?
>
> The goal is to allow interactive jobs only on specific partitions.
>
> Any recommendation or best practice on how to handle interactive jobs is
> welcome.
>
> Thank you,
> Stephan
>
>

-- 

  /|       |
  \/       | Yair Yarom | Senior DevOps Architect
  []       | The Rachel and Selim Benin School
  [] /\    | of Computer Science and Engineering
  []//\\/  | The Hebrew University of Jerusalem
  [//  \\  | T +972-2-5494522 | F +972-2-5494522
  //    \  | irush at cs.huji.ac.il
 //        |
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.schedmd.com/pipermail/slurm-users/attachments/20200519/dd5b6003/attachment-0001.htm>


More information about the slurm-users mailing list