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

[guidance request] slurm_kill_job authorization #353

Closed
gongwei-130 opened this issue Nov 18, 2024 · 2 comments
Closed

[guidance request] slurm_kill_job authorization #353

gongwei-130 opened this issue Nov 18, 2024 · 2 comments

Comments

@gongwei-130
Copy link

Details
Slurm Version: 21.08.5
Python Version: 3.9.20
Cython Version: 3.0.11
PySlurm Branch: v21.08.4
Linux Distribution:Ubuntu 22.04.3 LTS

Issue

I am building a service with pyslurm to submit job, I need to run the service with admin privilege so that it could submit as different user. Anyway to slurm_kill_job with user_id as submit so that slurm knows which user is trying to kill job and only admin user could kill other users's job.

@tazend
Copy link
Member

tazend commented Nov 26, 2024

Hi,

I'm not sure if I understand correctly here. So you have a service that runs with admin privileges, and you submit jobs for other users. Right now it sounds like that all of your jobs are running with the "admin" user, but you want a way so slurm knows which of those jobs are tied to a specific user, so they can kill their own jobs. This setup will not really work out I believe.

If you really want to submit jobs for other users, you should submit the job with the users UID and GID, like described here in my comment: #351 (comment)

This way, the job is already launched with the User credentials, and the User can easily kill their own jobs. Since this requires root permission, and if you don't want to run your entire service with root, you might need to put the job-submission logic into a seperate script and give your service-user sudo permissions to execute it.

Within this script, you can then for example submit the job with the specific UID of the user. Or, instead of providing the UID/GID with the job-submit description, you can drop your privileges to the User and submit the job like usual.

The latter is for example done in the Galaxy Project, which also submits jobs on the behalf of users (here is the script which does this: https://github.com/galaxyproject/galaxy/blob/dev/scripts/drmaa_external_runner.py

@tazend
Copy link
Member

tazend commented Dec 12, 2024

Since there haven't been any updates here, I'll go ahead and close the issue.

@tazend tazend closed this as completed Dec 12, 2024
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

No branches or pull requests

2 participants