Skip to content

Enhance the status structure of node tasks - #6084

Merged
kubeedge-bot merged 2 commits into
kubeedge:masterfrom
WillardHu:nodetask-status
Apr 21, 2025
Merged

kubeedge-bot merged 2 commits into
kubeedge:masterfrom
WillardHu:nodetask-status

Conversation

@WillardHu

Copy link
Copy Markdown
Collaborator

What type of PR is this?

/kind feature

What this PR does / why we need it:

Which issue(s) this PR fixes:

Fixes #5999

Special notes for your reviewer:

Does this PR introduce a user-facing change?:


@kubeedge-bot kubeedge-bot added do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. kind/feature Categorizes issue or PR as related to a new feature. labels Jan 13, 2025
@kubeedge-bot kubeedge-bot added needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. size/XXL Denotes a PR that changes 1000+ lines, ignoring generated files. labels Jan 13, 2025
@Shelley-BaoYue Shelley-BaoYue added this to the v1.21 milestone Jan 14, 2025
@kubeedge-bot kubeedge-bot removed the needs-rebase Indicates a PR cannot be merged because it has merge conflicts with HEAD. label Jan 17, 2025
@WillardHu
WillardHu force-pushed the nodetask-status branch 6 times, most recently from 57484da to 240a12e Compare February 17, 2025 07:21
@WillardHu
WillardHu force-pushed the nodetask-status branch 4 times, most recently from 8488e1a to 71f80a0 Compare February 26, 2025 10:36
@WillardHu
WillardHu force-pushed the nodetask-status branch 5 times, most recently from 2d37d24 to ca3ba55 Compare March 5, 2025 09:33
@WillardHu WillardHu changed the title [WIP] Enhance the status structure of node tasks Enhance the status structure of node tasks Mar 14, 2025
@kubeedge-bot kubeedge-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Mar 14, 2025
@WillardHu WillardHu closed this Mar 14, 2025
@WillardHu WillardHu reopened this Mar 14, 2025
@WillardHu
WillardHu force-pushed the nodetask-status branch 3 times, most recently from 001aac0 to 2056c04 Compare March 24, 2025 06:13
@WillardHu WillardHu closed this Mar 26, 2025
@WillardHu WillardHu reopened this Mar 26, 2025
Comment on lines +15 to +17
*/
package commons

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

A blank line is needed here

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Comment on lines +61 to +64
if err := RunReconcile(ctx, req, c.handler); err != nil {
logger.Error(err, "failed to run reconcile, do requeue")
return controllerruntime.Result{RequeueAfter: commons.DefaultRequeueTime}, nil
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

There should be an error here. Should we return error instead of nil?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Returning an error here will cause Reconcile to be triggered immediately.

Comment on lines +83 to +89
if err := v1alpha2downstream.Init(ctx); err != nil {
panic(err)
}
v1alpha2upstream.Init(ctx)
} else {
if err := tm.initV1alpha1(); err != nil {
panic(fmt.Errorf("failed to init node task v1alpha1 controller, err: %v", err))

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I checked similar devicecontroller and edgecontroller and found that they all exited through klog.Exitf().
https://github.com/kubeedge/kubeedge/blob/master/cloud/pkg/devicecontroller/devicecontroller.go#L67
https://github.com/kubeedge/kubeedge/blob/master/cloud/pkg/edgecontroller/edgecontroller.go#L35
Can we also use klog.Exitf() here to better preserve log information?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Exit() will interrupt all resource release processes, which is dangerous behavior. Currently, panic error is better. The best way should be for the beehive framework to support the Start() to return an error and handle it.

Comment thread edge/pkg/common/message/nodetask.go Outdated
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Are there extra spaces added?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@@ -0,0 +1,95 @@
package image

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it seems we need add copyright here?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

Comment thread pkg/util/slices/slices_test.go Outdated
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0
http://www.apache.org/licenses/LICENSE-2.0

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

ditto

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done.

@WillardHu WillardHu closed this Mar 28, 2025
@WillardHu WillardHu reopened this Mar 28, 2025
@WillardHu
WillardHu requested a review from wbc6080 March 28, 2025 06:57
@WillardHu WillardHu closed this Apr 15, 2025
@WillardHu WillardHu reopened this Apr 15, 2025
@WillardHu
WillardHu force-pushed the nodetask-status branch 2 times, most recently from 2efbbdd to dd2213c Compare April 16, 2025 07:34
@WillardHu WillardHu changed the title Enhance the status structure of node tasks [WIP]Enhance the status structure of node tasks Apr 16, 2025
Comment thread edge/pkg/common/message/nodetask.go Outdated
@@ -1,5 +1,5 @@
/*
Copyright 2023 The KubeEdge Authors.
Copyright 2025 The KubeEdge Authors.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This date should not need to be changed.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

Done

Comment thread hack/generate-crds.sh
CRD_OUTPUTS=build/crds
DEVICES_VERSION=v1beta1
OPERATIONS_VERSION=v1alpha1
OPERATIONS_VERSION=v1alpha2

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Now we still use v1alpha1 by default? Will there be a problem with changing this to v1alpha2?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

My original idea was to gradually transition to v1alpha2, but it seems that there are not many users using node jobs now, so it's ok to use v1alpha2 by default. I just need to adjust the definition of feature-gate. Do we need to use v1alpha2 by default?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

The node jobs of the v1alph2 have been used as the default.

Signed-off-by: WillardHu <wei.hu@daocloud.io>
…ome lint issue

Signed-off-by: WillardHu <wei.hu@daocloud.io>

@Shelley-BaoYue Shelley-BaoYue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

/approve
Related issue #6293 is used to track the CI failure.
/assign @wbc6080 @tangming1996

@kubeedge-bot

Copy link
Copy Markdown
Collaborator

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: Shelley-BaoYue

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

The pull request process is described here

Details 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

@wbc6080

wbc6080 commented Apr 21, 2025

Copy link
Copy Markdown
Collaborator

/lgtm

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. kind/feature Categorizes issue or PR as related to a new feature. lgtm Indicates that a PR is ready to be merged. 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.

Enhance the status structure of node tasks

5 participants