Skip to content

Devbox daemon #5709

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

Open
wants to merge 10 commits into
base: main
Choose a base branch
from
Open

Devbox daemon #5709

wants to merge 10 commits into from

Conversation

lingdie
Copy link
Collaborator

@lingdie lingdie commented Jul 21, 2025

No description provided.

Copy link

Whoa! Easy there, Partner!

This PR is too big. Please break it up into smaller PRs.

Copy link

gru-agent bot commented Jul 21, 2025

TestGru Assignment

Summary

Link CommitId Status Reason
Detail 95e0923 🚫 Skipped No files need to be tested {"controllers/devbox/Makefile":"File path does not match include patterns.","controllers/devbox/PROJECT":"File path does not match include patterns.","controllers/devbox/api/v1alpha1/devbox_types.go":"File path does not match include patterns.","controllers/devbox/api/v1alpha1/devboxrelease_types.go":"File path does not match include patterns.","controllers/devbox/api/v1alpha1/zz_generated.deepcopy.go":"File path does not match include patterns.","controllers/devbox/cmd/main.go":"File path does not match include patterns.","controllers/devbox/config/crd/bases/devbox.sealos.io_devboxes.yaml":"File path does not match include patterns.","controllers/devbox/config/crd/bases/devbox.sealos.io_devboxreleases.yaml":"File path does not match include patterns.","controllers/devbox/config/crd/bases/devbox.sealos.io_operationrequests.yaml":"File path does not match include patterns.","controllers/devbox/config/crd/kustomization.yaml":"File path does not match include pa…

History Assignment

Tip

You can @gru-agent and leave your feedback. TestGru will make adjustments based on your input

logger.Info(
"Devbox is shutdown, pod is deleted, commit devbox and create a new content id and new record",
"devboxName", devboxName)
devbox.Status.CommitRecords[devbox.Status.ContentID].CommitStatus = devboxv1alpha1.CommitStatusSuccess
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should CommitStatusSuccess be set after the commit actually being done successfully?

// Check if this is a devbox pod by looking for the devbox label, and the devbox is scheduled to the current node
if !r.isDevboxPod(pod) || r.getDevboxNameFromPod(pod) == "" || pod.Spec.NodeName != nodes.GetNodeName() {
return ctrl.Result{}, nil
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can also be rewritten as filters for pod CRUD events

// schedule devbox to node, update devbox status and create a new commit record
// and filter out the devbox that are not in the current node
if devbox.Status.CommitRecords[devbox.Status.ContentID].Node == "" {
// set up devbox node and content id, new a record for the devbox
Copy link
Collaborator

Choose a reason for hiding this comment

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

TODO: scheduling logic?

Copy link
Collaborator

@dinoallo dinoallo left a comment

Choose a reason for hiding this comment

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

I left some suggestions in the code comments

Copy link

codecov bot commented Jul 23, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 61.97%. Comparing base (e3f1248) to head (2b8309d).
Report is 24 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #5709   +/-   ##
=======================================
  Coverage   61.97%   61.97%           
=======================================
  Files           8        8           
  Lines         647      647           
=======================================
  Hits          401      401           
  Misses        200      200           
  Partials       46       46           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants