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

Feature request: Job priority #93

Open
matthdsm opened this issue Nov 13, 2024 · 12 comments
Open

Feature request: Job priority #93

matthdsm opened this issue Nov 13, 2024 · 12 comments
Labels
enhancement New feature or request

Comments

@matthdsm
Copy link
Collaborator

Hi guys,

Would it be feasible to implement an option for job priority? We've got a workload on our cluster that has to take priority over other batch jobs.

I'm thinking an extra option for the process configuration would be nice?

Cheers
Matthias

@matthdsm
Copy link
Collaborator Author

https://developer.hashicorp.com/nomad/docs/job-specification/job#priority

@abhi18av
Copy link
Member

Good point @matthdsm, I see that there is some correlation between the Nomad server side setting https://developer.hashicorp.com/nomad/docs/configuration/server#job_max_priority

What's the limit you guys are using on the cluster?

@matthdsm
Copy link
Collaborator Author

@tomiles? Any idea?

@tomiles
Copy link
Collaborator

tomiles commented Nov 13, 2024

For now it's just default = 100. The docs say you can set max priority at most to 32766, so makes sense if we implement this we support at most the same max value.

@abhi18av
Copy link
Member

Agreed @tomiles , we'd just need to find a way to inspect this value from a Nomad job, otherwise the mismatch between the job submission priority and the server level setting could lead to underfined behavior.

@matthdsm , could you please do a quick check for this behavior using vanilla nomad job with out-of-bound priority?

@tomiles
Copy link
Collaborator

tomiles commented Nov 13, 2024

I think the API should give you an exemption when you try to run the job with invalid (out of bounds) priority. So we probably don't need to go and replicate checks nomad server does for you, and just properly catch API errors.

@jagedn
Copy link
Collaborator

jagedn commented Nov 15, 2024

@abhi18av are you working in this or do you want I take a look?

@abhi18av abhi18av added the enhancement New feature or request label Nov 18, 2024
@abhi18av
Copy link
Member

Hi dear @jagedn and team 👋

Apologies for the radio silence but I'm afraid, I'll only be able to (consistently) resume my tasks once I'm back home in SA. If anyone can take this forward that'd be great! 🙏

At the moment, I'm in Brazil for organizing training events in different sites. Ideally we will start deploying the plugin and site-specific Nomad clusters in these locations where the trainings are being done as of now.

@jagedn
Copy link
Collaborator

jagedn commented Nov 18, 2024

I founded this endpoint interesting: /v1/job/:job_id/plan

we can run a dummy plan at startup for a job with a very high priority and parse the error from the server
For example using the UI, in our local cluster , I can plan a job with priority = 65535 and the server returns 1 error occurred: * job priority must be between [1, 100]

... but at this point I don't know what's your idea. I mean, do we need to validate the priority of a process before to submit and abort the pipeline ? if exceeded do we need to change it ? ....

@jagedn
Copy link
Collaborator

jagedn commented Nov 18, 2024

meantime I'll implement the priority annotation

@jagedn
Copy link
Collaborator

jagedn commented Nov 18, 2024

@abhi18av You have a great challenge ahead of you:

imagen

@jagedn
Copy link
Collaborator

jagedn commented Nov 18, 2024

@matthdsm I just uploaded 0.3.2-edge2 with a new optional priority directive, in case you want to try it

In case you exceed the max priority configured in the server the job will fail (I think)

https://github.com/nextflow-io/nf-nomad/releases/tag/0.3.2-edge2

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

No branches or pull requests

4 participants