Skip to content
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

Draft
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

NucciTheBoss
Copy link
Member

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 by root which isn't bad, but it's encourage that files like slurm.conf and jwt_hs256.key are owned by the dedicated system user slurm instead.

The PR adds public user and group properties that (a) be used to retrieve the user and group for configuration options such as SlurmUser and (b) pushes down to the configuration managers so that slurmutils 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.

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]>
@NucciTheBoss
Copy link
Member Author

NucciTheBoss commented Oct 6, 2024

Unit tests are expected to fail because setting config file permissions with slurmutils is not upstreamed yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant