-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(slurm_ops): set correct permissions on files owned by Slurm #40
Conversation
Adds logic to create slurmrestd user at install time. slurmrestd cannot be the SlurmUser or SlurmdUser, so we must create a dedicated user similar to how the slurmrestd charm currently creates the user + group. Signed-off-by: Jason C. Nucciarone <[email protected]>
pyfakefs seemingly doesn't work for JWTKeyManager, so we need to manually mock the user and group for `shutil`. Just sets the user and group to the current user and group running the unit tests. Signed-off-by: Jason C. Nucciarone <[email protected]>
Apply formatting to the TODO messages so that they render nicely within tool windows such as PyCharm's TODO widget. Easy to quickly browse through outstanding items we want to tackle. Signed-off-by: Jason C. Nucciarone <[email protected]>
e7273ad
to
ae0ee9e
Compare
Unit tests are expected to fail because setting config file permissions with |
Signed-off-by: Jason C. Nucciarone <[email protected]>
…g files Changes: - Adds onto `test_config` tests to check the file mode, user, and group of file. - Fake the user and group by reassigning the `_user` and `_group` to the uid and gid of the user running the tests. - Redefines constants at the top of the test module so they can be easily found. Signed-off-by: Jason C. Nucciarone <[email protected]>
I know the problem here. Slurm snap doesn't create a |
The Slurm snap currently does not create a Slurm system user, so the integration tests needs an additional step to add both the slurm group and user. This is something that should be patched in the Slurm snap when the team revisits the snap package. Signed-off-by: Jason C. Nucciarone <[email protected]>
@jedel1043 R4R 🔍 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small question that I have about adduser
. Looks great!
@jedel1043 please sir, might I have another review 🥺👉👈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preemptively approving this, since the discussion in the comment is mostly personal preference IMO.
This PR enables the
slurm_ops
lib to correctly set the user, group, and mode on files owned by Slurm. Originally, we had everything owned byroot
which isn't bad, but it's encourage that files like slurm.conf and jwt_hs256.key are owned by the dedicated system userslurm
instead.The PR adds public
user
andgroup
properties that (a) be used to retrieve theuser
andgroup
for configuration options such asSlurmUser
and (b) pushes down to the configuration managers so thatslurmutils
can assign the proper access permissions to the configuration files.Currently a draft because this PR needs PR charmed-hpc/slurmutils#24 to land since it introduces the mode, user, and group setting features to slurmutils.