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

Kueue job priorities #13

Merged
merged 10 commits into from
Apr 24, 2024
Merged

Kueue job priorities #13

merged 10 commits into from
Apr 24, 2024

Conversation

AdrianoKF
Copy link
Collaborator

@AdrianoKF AdrianoKF commented Apr 18, 2024

Scheduling Options (priority classes / Kueue local queue)

Jobs can now specify SchedulingOptions, which include the Kueue local queue and priority class names. The settings are validated upon job submission.

Adds example priority classes (background, development, production) and preemption options to the Kueue cluster queue manifest YAML.

A sample "production" job has been added to simplify the demo of preemption and priority based workload ordering in Kueue.

Refactorings

The runner.py module was broken up into a proper package jobs.runner, since its size was growing to a point where readability was hampered.

Breaking Changes

If you have previously set up Kueue in your cluster with the single-clusterqueue-setup.yaml manifest, you will have to reapply these resources.

Closes #9, #10

Jobs can now specify `SchedulingOptions`, which include the Kueue
local queue and priority class names.

Adds example priority classes (background, development, production)
and preemption options to the cluster queue manifest.

A sample "production" job has been added to simplify the demo of
preemption and priority based workload ordering in Kueue.
The `runner.py` module was growing to a point where readability was hampered.

This commit splits it up into the `jobs.runner` package, with submodules
grouped by execution platform.

Also, introduces a `KubernetesNamespaceMixin` to simplify determining the
current or desired namespace for a workload.
@AdrianoKF AdrianoKF linked an issue Apr 23, 2024 that may be closed by this pull request
1 task
Comment on lines -144 to +160
resources: ResourceOptions | None
resources: ResourceOptions | None = None
"""Resource requests for this job in Kubernetes format (see https://kubernetes.io/docs/concepts/configuration/manage-resources-containers/#resource-units-in-kubernetes)"""
image: ImageOptions | None
image: ImageOptions | None = None
scheduling: SchedulingOptions | None = None
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How do we handle if these are not set?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Up to the implementation of the runners to decide. Some might throw an error, whereas others might completely ignore an option that was passed because it is not applicable (e.g., resource limits when executing locally).

Comment on lines +1 to +3
import logging

from kubernetes import client
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we name the runner directory runners since it contains multiple runners?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I kept it as runner so imports of the types would remain stable, but I'm open to renaming it as well.

@AdrianoKF AdrianoKF merged commit 3787545 into main Apr 24, 2024
2 checks passed
@AdrianoKF AdrianoKF deleted the 9-job-priorities branch April 24, 2024 10:14
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.

Implement Job Preemption Implement submission of multiple jobs in multiple queues with different priorities
3 participants