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

[multikueue] Make the MultiKueue adapter part of the jobframework #2373

Merged

Conversation

trasc
Copy link
Contributor

@trasc trasc commented Jun 6, 2024

What type of PR is this?

/kind feature

What this PR does / why we need it:

Make the MultiKueue adapter part of the jobframework, and:

  • Allow all the code relating to a job's integration with Kueue to be kept in one place (pkg/controller/jobs/...).
  • Make use if the jobframework's integrationManager capabilities to collect available adapter implementations.

Which issue(s) this PR fixes:

Fixes #2350

Special notes for your reviewer:

Does this PR introduce a user-facing change?

None

@k8s-ci-robot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@k8s-ci-robot k8s-ci-robot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 6, 2024
@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Jun 6, 2024
@trasc
Copy link
Contributor Author

trasc commented Jun 6, 2024

/test all

@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Jun 6, 2024
Copy link

netlify bot commented Jun 6, 2024

Deploy Preview for kubernetes-sigs-kueue canceled.

Name Link
🔨 Latest commit d2b0344
🔍 Latest deploy log https://app.netlify.com/sites/kubernetes-sigs-kueue/deploys/6672b09009a64f0009b183cf

@trasc trasc force-pushed the multikueue-adapter-in-framework branch from 30f9b69 to 91cb893 Compare June 6, 2024 14:01
@trasc
Copy link
Contributor Author

trasc commented Jun 6, 2024

/test all

@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 6, 2024
@trasc trasc force-pushed the multikueue-adapter-in-framework branch from 91cb893 to 69ad097 Compare June 6, 2024 15:15
@trasc trasc changed the title WIP: [multikueue] Make the MultiKueue adapter part of the jobframework Jun 6, 2024
@k8s-ci-robot k8s-ci-robot added release-note-none Denotes a PR that doesn't merit a release note. and removed do-not-merge/release-note-label-needed Indicates that a PR should not merge because it's missing one of the release note labels. labels Jun 6, 2024
@trasc trasc marked this pull request as ready for review June 6, 2024 15:19
@k8s-ci-robot k8s-ci-robot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 6, 2024
@k8s-ci-robot k8s-ci-robot requested a review from mimowo June 6, 2024 15:19
@trasc
Copy link
Contributor Author

trasc commented Jun 6, 2024

/cc @tenzen-y

@tenzen-y
Copy link
Member

tenzen-y commented Jun 7, 2024

/cc @tenzen-y

ACK

@mimowo
Copy link
Contributor

mimowo commented Jun 13, 2024

/assign

@tenzen-y
Copy link
Member

/hold
Let's discuss the MultiKueue features in #2349 before moving something.

@k8s-ci-robot k8s-ci-robot added the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 13, 2024
@trasc trasc force-pushed the multikueue-adapter-in-framework branch 3 times, most recently from 80ae069 to f3fb4ca Compare June 18, 2024 07:19
@k8s-ci-robot k8s-ci-robot added size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. and removed size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jun 18, 2024
@trasc trasc force-pushed the multikueue-adapter-in-framework branch from f3fb4ca to a9f3211 Compare June 18, 2024 07:58
@k8s-ci-robot k8s-ci-robot added size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. and removed size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. labels Jun 18, 2024
pkg/controller/jobframework/integrationmanager.go Outdated Show resolved Hide resolved
pkg/controller/jobframework/integrationmanager.go Outdated Show resolved Hide resolved
pkg/controller/jobframework/integrationmanager.go Outdated Show resolved Hide resolved
pkg/controller/jobs/job/job_multikueue_adapter.go Outdated Show resolved Hide resolved
pkg/controller/jobs/jobset/jobset_multikueue_adapter.go Outdated Show resolved Hide resolved
pkg/controller/jobs/job/job_multikueue_adapter_test.go Outdated Show resolved Hide resolved

gotManagersJobSets := &jobsetapi.JobSetList{}
if err := managerClient.List(ctx, gotManagersJobSets); err != nil {
t.Errorf("unexpected list manager's jobsets error %s", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

If the List returns an error we can interrupt the test with t.Failure, then we don't need to use `else below.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I prefer to continue and check the worker's list as well.

Copy link
Contributor

Choose a reason for hiding this comment

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

as in the other comment

pkg/util/api/api.go Outdated Show resolved Hide resolved
Copy link
Contributor

@alculquicondor alculquicondor left a comment

Choose a reason for hiding this comment

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

I like this overall

/approve
/hold
I'll leave the LGTM to @mimowo

pkg/controller/jobframework/interface.go Outdated Show resolved Hide resolved
@@ -100,7 +102,7 @@ func (b *batchJobAdapter) SyncJob(ctx context.Context, localClient client.Client
return remoteClient.Create(ctx, &remoteJob)
}

func (b *batchJobAdapter) DeleteRemoteObject(ctx context.Context, remoteClient client.Client, key types.NamespacedName) error {
func (b *multikueueAdapter) DeleteRemoteObject(ctx context.Context, remoteClient client.Client, key types.NamespacedName) error {
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't look like this needs to be part of the interface. Maybe the interface only needs to return an empty object (batchv1.Job in this case). And the rest can be implemented by the admission check.

But it can be also left for a follow up.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Let's keep this for a potential follow-up.

(Keeping it as is could be useful if we plan to support composable jobs )

We could also create an utils generic func like:

func DeleteByKey[T client.Object](ctx, client, key ..)

but the added value may not be that big.

)

type jobsetAdapter struct{}
type multikueueAdapter struct{}
Copy link
Contributor

Choose a reason for hiding this comment

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

I agree that the prefix is redundant.

pkg/util/api/api.go Outdated Show resolved Hide resolved
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: alculquicondor, trasc

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 18, 2024
@trasc
Copy link
Contributor Author

trasc commented Jun 19, 2024

/retest

(test infra issue)

@mimowo
Copy link
Contributor

mimowo commented Jun 19, 2024

I like this overall

/approve /hold I'll leave the LGTM to @mimowo

Cool, just two nits like this: #2373 (comment) and I'm happy to lgtm.
/hold cancel

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Jun 19, 2024
@mimowo
Copy link
Contributor

mimowo commented Jun 19, 2024

Thanks!
/lgtm

@k8s-ci-robot k8s-ci-robot added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Jun 19, 2024
@k8s-ci-robot
Copy link
Contributor

LGTM label has been added.

Git tree hash: c267c010a5fd9c76d750c3a7eb87f5a00392e2cd

@k8s-ci-robot k8s-ci-robot merged commit 3f46a78 into kubernetes-sigs:main Jun 19, 2024
16 checks passed
@k8s-ci-robot k8s-ci-robot added this to the v0.8 milestone Jun 19, 2024
@trasc trasc deleted the multikueue-adapter-in-framework branch June 19, 2024 10:33
Copy link
Member

@tenzen-y tenzen-y left a comment

Choose a reason for hiding this comment

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

everything looks good to me.
Thank you for driving this refactoring!

Fiona-Waters pushed a commit to Fiona-Waters/kueue that referenced this pull request Jun 25, 2024
…bernetes-sigs#2373)

* [multikueue] Make the MultiKueue adapter part of the jobframework

* Review Remarks

* Review Remarks

* Review Remarks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. release-note-none Denotes a PR that doesn't merit a release note. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Make the multikueue jobAdapter a part of the jobFramework.
5 participants