Ticket 19634 - job_desc->environment empty in salloc job_submit (C plugin) but populated for sbatch
Summary: job_desc->environment empty in salloc job_submit (C plugin) but populated for...
Status: RESOLVED INFOGIVEN
Alias: None
Product: Slurm
Classification: Unclassified
Component: slurmctld (show other tickets)
Version: 23.11.5
Hardware: Linux Linux
: 4 - Minor Issue
Assignee: Marcin Stolarek
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2024-04-18 11:37 MDT by Ryan Cox
Modified: 2024-04-29 03:59 MDT (History)
2 users (show)

See Also:
Site: BYU - Brigham Young University
Slinky Site: ---
Alineos Sites: ---
Atos/Eviden Sites: ---
Confidential Site: ---
Coreweave sites: ---
Cray Sites: ---
DS9 clusters: ---
Google sites: ---
HPCnow Sites: ---
HPE Sites: ---
IBM Sites: ---
NOAA SIte: ---
NoveTech Sites: ---
Nvidia HWinf-CS Sites: ---
OCF Sites: ---
Recursion Pharma Sites: ---
SFW Sites: ---
SNIC sites: ---
Tzag Elita Sites: ---
Linux Distro: ---
Machine Name:
CLE Version:
Version Fixed:
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments

Note You need to log in before you can comment on or make changes to this ticket.
Description Ryan Cox 2024-04-18 11:37:14 MDT
In the job submit plugin, job_submit() has job_desc->environment set to NULL if a job is submitted through salloc but it is populated correctly if submitted through sbatch.  Is this intentional? If so, is there some other way to access the job's environment from job_submit()?  The environment variables do make it through to the job launch for both sbatch and salloc.
Comment 2 Marcin Stolarek 2024-04-19 01:23:42 MDT
Ryan,

That's in fact expected and documented behavior, take a look at[1]:

>NOTE: Only sbatch sends the environment to slurmctld. salloc and srun do not send 
>the environment to slurmctld, so job_desc.environment is not available in the 
>job_submit plugin for these jobs.

When job is run by salloc/srun task lanuch request is send from the client to slurmd, not from slurmctld.

Let me know if that's more clear for you or if you have additional questions on that.

cheers,
Marcin
[1]https://slurm.schedmd.com/job_submit_plugins.html#lua
Comment 3 Marcin Stolarek 2024-04-29 03:59:31 MDT
I'll go ahead and close the case as information given.
Should you have any question spelase reopen.

cheers,
Marcin