Ticket 9759

Summary: can i pick up --pty from job_submit.lua
Product: Slurm Reporter: Yee-Ting Li <ytl>
Component: ConfigurationAssignee: Marcin Stolarek <cinek>
Status: RESOLVED INFOGIVEN QA Contact:
Severity: 4 - Minor Issue    
Priority: --- CC: cinek, radmer
Version: 20.02.3   
Hardware: Linux   
OS: Linux   
Site: SLAC Alineos Sites: ---
Atos/Eviden Sites: --- Confidential Site: ---
Coreweave sites: --- Cray Sites: ---
DS9 clusters: --- HPCnow Sites: ---
HPE Sites: --- IBM Sites: ---
NOAA SIte: --- OCF Sites: ---
Recursion Pharma Sites: --- SFW Sites: ---
SNIC sites: --- Linux Distro: ---
Machine Name: CLE Version:
Version Fixed: Target Release: ---
DevPrio: --- Emory-Cloud Sites: ---

Description Yee-Ting Li 2020-09-05 22:15:21 MDT
Hi, i would like to force users to not be able to sit on idle nodes. i would like to avoid having a dedicated partition if possible for these interactive jobs. i figured that perhaps we can use job_submit.lua to pick --pty jobs out and (1) give them higher priority and (2) limit the max duration of such jobs by reporting an error to the user.

can you tell me if its possible to do this in job_submit.lua? and which job_desc field is to find such --pty jobs?

cheers,

Yee.
Comment 2 Marcin Stolarek 2020-09-07 02:46:34 MDT
Yee,

This is something you can achieve easily using cli_filter plugin, where you can directly check if --pty was specified.

An example cli_filter lua function checking for that may look like:
>  1 function slurm_cli_pre_submit(options, pack_offset)
>  2         if options.pty == "set" then
>  3                 options.partition="interactive-jobs";
>  4                 slurm.log_info("Partition changed to interactive-jobs");
>  5         end
>  6                 return slurm.SUCCESS
>  7 end
>  8 
>  9 function slurm_cli_setup_defaults(options, cli_type)
> 10         return slurm.SUCCESS
> 11 end
> 12 function slurm_cli_post_submit(options, cli_type)
> 13         return slurm.SUCCESS


As a limitation of cli_filter plugin user can get around that using his own slurm client or substituted configuration. Pros of cli_filter is that it's processing happens on user end, so it doesn't increase job submission (slurmctld process it under job lock) processing time.

Let me know if the solution works for you.

cheers,
Marcin
Comment 3 Marcin Stolarek 2020-09-14 08:50:29 MDT
Is there anything else I can help you with?

cheers,
Marcin
Comment 4 Yee-Ting Li 2020-09-15 02:00:46 MDT
thanks Marcin - we'll have to consider whether its sufficient for this feature to be implemented as a cli_filter. you may close the ticket.