Ticket 14340 - BurstBuffer Lua plugin slurm_bb_data_in and slurm_bb_data_out need additional argument uid and gid
Summary: BurstBuffer Lua plugin slurm_bb_data_in and slurm_bb_data_out need additiona...
Status: RESOLVED FIXED
Alias: None
Product: Slurm
Classification: Unclassified
Component: Burst Buffers (show other tickets)
Version: 21.08.8
Hardware: Linux Linux
: C - Contributions
Assignee: Marshall Garey
QA Contact:
URL:
Depends on:
Blocks:
 
Reported: 2022-06-17 09:58 MDT by Jianjun Xu
Modified: 2022-06-22 14:44 MDT (History)
3 users (show)

See Also:
Site: -Other-
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: 23.02.0pre1
Target Release: ---
DevPrio: ---
Emory-Cloud Sites: ---


Attachments
bug14130_v1.patch (3.34 KB, patch)
2022-06-20 10:59 MDT, Tim Wickberg
Details | Diff

Note You need to log in before you can comment on or make changes to this ticket.
Description Jianjun Xu 2022-06-17 09:58:28 MDT
When using slurm_bb_data_in/out, we need the uid/gid to set the file permissions correctly per job user.  

The code that needs to me changed are 

src/plugins/burst_buffer/lua/burst_buffer_lua.c
74d173
<       uint32_t gid;
958,963d956
<               argc = 4;
<               argv = xcalloc(argc + 1, sizeof (char *)); /* NULL-terminated */
<               argv[0] = xstrdup_printf("%u", stage_out_args->job_id);
<               argv[1] = xstrdup_printf("%u", stage_out_args->uid);
<               argv[2] = xstrdup_printf("%u", stage_out_args->gid);
<               argv[3] = xstrdup_printf("%s", stage_out_args->job_script);
1047d1039
<       stage_out_args->gid = bb_job->group_id;
1359d1350
<       bb_job->group_id = job_ptr->group_id;
2506c2497
<               argc = 4;
---
>               argc = 2;
2509,2511c2500
<               argv[1] = xstrdup_printf("%u", stage_in_args->uid);
<               argv[2] = xstrdup_printf("%u", stage_in_args->gid);
<               argv[3] = xstrdup_printf("%s", stage_in_args->job_script);
---
>               argv[1] = xstrdup_printf("%s", stage_in_args->job_script);



src/plugins/burst_buffer/common/burst_buffer_common.h
179d178
<       uint32_t   group_id;    /* usergroup the job runs as */
Comment 1 Tim Wickberg 2022-06-17 12:06:33 MDT
Hi -

Can you please submit this as a properly-formatted commit? The reverse-patch format pasted in a comment isn't something our review team can work with.
Comment 3 Tim Wickberg 2022-06-20 10:59:04 MDT
Created attachment 25582 [details]
bug14130_v1.patch
Comment 11 Marshall Garey 2022-06-22 14:44:49 MDT
Thanks for the contribution! We modified your patch to pass the UID and GID at the end rather than in the middle. This preserves compatibility with burst_buffer.lua scripts that don't have those parameters.

We also added UID and GID to slurm_bb_[pre_run|post_run].

This is in the master branch and will be part of the 23.02 release.

a2ef333d30 (HEAD -> master, origin/master) NEWS and RELEASE_NOTES for the previous 2 commits
0a03fa27bf burst_buffer/lua - pass uid and gid to slurm_bb_[pre_run|post_run]
7876738b25 burst_buffer/lua - pass uid and gid to slurm_bb_data_[in|out]

Closing