Skip to content

Upgrade agent sandbox to v1.0.9 - #507

Merged
volcano-sh-bot merged 1 commit into
volcano-sh:mainfrom
zhzhuang-zju:upgrade
Nov 9, 2026
Merged

volcano-sh-bot merged 1 commit into
volcano-sh:mainfrom
zhzhuang-zju:upgrade

Conversation

@zhzhuang-zju

Copy link
Copy Markdown
Contributor

What type of PR is this?

/kind enhancement

What this PR does / why we need it:
upgrade agent sandbox to v1.0.9

  1. Migrate upstream API versions. Switch Workload Manager’s Sandbox and extensions imports, scheme registrations, object apiVersion values, and dynamic-client resource versions from v1alpha1 to v1beta1. AgentCube’s own runtime/v1alpha1 API remains unchanged.

  2. Update Sandbox and template construction. Place PodTemplate inside the new embedded SandboxBlueprint for both Sandboxes and SandboxTemplates. Remove the obsolete Sandbox replicas field, while retaining the existing lifecycle settings and unmanaged network-policy configuration.

  3. Update Claim references. Replace SandboxClaim.spec.templateRef with spec.warmPoolRef, pointing to the CodeInterpreter’s warm pool. Rename the builder parameter to reflect that it now identifies a pool, not a template.

  4. Adapt warm-pool reconciliation. Handle SandboxWarmPool.spec.replicas as a pointer: set it when creating a pool, repair a nil value on an existing pool, and update it when the desired size changes.

  5. Use the supported readiness signal. Change WaitForSandboxReady() to check for a Ready=True condition instead of the removed status.phase field.

  6. Add regression coverage. Test beta resource versions and object serialization, the Claim’s warmPoolRef, template network-policy behavior, and warm-pool replica creation and updates.

Which issue(s) this PR fixes:

Fixes: #464

Special notes for your reviewer:

AgentCube’s own runtime/v1alpha1 API is unchanged. Go unit tests and E2E compilation passed.
GitHub Copilot assisted with the agent-sandbox API migration and regression tests.

Does this PR introduce a user-facing change?:

Yes. Installations now require the agent-sandbox v1.0.9 controller and APIs.

Upgrade agent-sandbox compatibility to v1.0.9.

@codecov-commenter

codecov-commenter commented Nov 5, 2026 •

Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 86.41975% with 11 lines in your changes missing coverage. Please review.
✅ Project coverage is 63.90%. Comparing base (f521ae9) to head (9af145c).
⚠️ Report is 25 commits behind head on main.

Files with missing lines Patch % Lines
pkg/workloadmanager/k8s_client.go 60.00% 5 Missing and 1 partial ⚠️
pkg/workloadmanager/codeinterpreter_controller.go 88.23% 2 Missing ⚠️
pkg/workloadmanager/server.go 0.00% 2 Missing ⚠️
pkg/workloadmanager/sandbox_controller.go 0.00% 1 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #507      +/-   ##
==========================================
+ Coverage   60.45%   63.90%   +3.45%     
==========================================
  Files          35       35              
  Lines        3616     3657      +41     
==========================================
+ Hits         2186     2337     +151     
+ Misses       1211     1088     -123     
- Partials      219      232      +13     
Flag Coverage Δ
unittests 63.90% <86.41%> (+3.45%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 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.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The controller/CRD migration needs live-cluster validation against v1.0.9 for sandbox creation, warm-pool adoption, and cleanup, which unit tests and E2E compilation do not establish.

No open issues 🎉

What changed in this PR

Upgrades AgentCube’s agent-sandbox integration to v1.0.9, migrating Workload Manager to upstream v1beta1 APIs while leaving AgentCube’s own runtime/v1alpha1 API unchanged.

Changes:

  • Adapts sandbox construction, claim references, warm-pool replicas, and readiness checks to the updated APIs.
  • Adds regression coverage for serialization, resource versions, and warm-pool reconciliation.
  • Updates dependencies, E2E setup, and installation documentation for v1.0.9.
File Description
test/​e2e/​run_e2e.sh Installs v1.0.9 using the combined extensions manifest.
test/​e2e/​e2e_test.go Switches upstream API imports to beta.
pkg/​workloadmanager/​workload_builder.go Uses embedded blueprints and warm-pool claim references.
pkg/​workloadmanager/​workload_builder_test.go Tests beta serialization, resource versions, and claim references.
pkg/​workloadmanager/​sandbox_helper.go Uses beta sandbox types.
pkg/​workloadmanager/​sandbox_helper_test.go Updates helper tests to beta types.
pkg/​workloadmanager/​sandbox_controller.go Reconciles beta sandbox resources.
pkg/​workloadmanager/​k8s_client.go Uses beta APIs and condition-based readiness checks.
pkg/​workloadmanager/​informers.go Targets beta sandbox and claim resource versions.
pkg/​workloadmanager/​handlers.go Uses beta sandbox and extension types.
pkg/​workloadmanager/​handlers_test.go Updates imports and fixtures to beta APIs.
pkg/​workloadmanager/​codeinterpreter_controller.go Adapts templates and pointer-valued warm-pool replicas.
pkg/​workloadmanager/​codeinterpreter_controller_test.go Tests replica reconciliation and adapts template fixtures.
Makefile Defaults E2E runs to v1.0.9 and forwards version overrides.
go.sum Updates dependency checksums.
go.mod Upgrades agent-sandbox and related dependencies.
docs/​getting-started.md Updates installation and removal commands for v1.0.9.
cmd/​workload-manager/​main.go Switches upstream scheme imports to beta APIs.

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 5, 2026 09:35

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The v1.0.9 CRD/controller upgrade needs fresh-cluster E2E validation of installation, warm-pool adoption, and cascading cleanup, as reported checks cover only unit tests and E2E compilation.

No open issues 🎉

Review effort: Balanced

Copilot AI balanced review requested due to automatic review settings November 5, 2026 11:56

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

Deprecated SandboxPodNameAnnotation references in handlers.go and handlers_test.go trigger the enabled SA1019 check and need narrowly scoped compatibility suppressions while preserving legacy support.

1 open issue

Review effort: Balanced

Comment thread pkg/workloadmanager/handlers.go Resolved
Copilot AI balanced review requested due to automatic review settings November 5, 2026 12:34

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The new unstructured readiness path in WaitForSandboxReady lacks regression tests covering success without status.phase and timeouts for false, unknown, or missing Ready conditions.

1 open issue
1 resolved since last review

Review effort: Balanced

Comment thread pkg/workloadmanager/k8s_client.go Resolved
Copilot AI balanced review requested due to automatic review settings November 6, 2026 02:08

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The controller/API migration and Claim-to-pool binding lack live v1.0.9 cluster validation of sandbox creation, warm-pool adoption/replenishment, and cleanup; reported unit tests and E2E compilation do not establish these runtime contracts.

No open issues 🎉

1 resolved since last review

Review effort: Balanced

@zhzhuang-zju zhzhuang-zju changed the title WIP: upgrade agent sandbox to v1.0.9 Upgrade agent sandbox to v1.0.9 Nov 6, 2026
@zhzhuang-zju

Copy link
Copy Markdown
Contributor Author

Local test report:
I followed the getting-started guide to set up AgentCube locally and tested it with a basic SDK invocation. The results as below:

(base) ➜  agentcube git:(upgrade) ✗ kubectl get sandbox                                            
NAME                   READY   REASON              AGE
my-interpreter-7qf7f   True    DependenciesReady   17h
my-interpreter-pxw2r   True    DependenciesReady   17h
(base) ➜  agentcube git:(upgrade) ✗ python quickstart.py
2026-11-06 10:44:47,179 | INFO | agentcube.code_interpreter | Creating new session...
2026-11-06 10:44:48,200 | INFO | agentcube.code_interpreter | Session created: 3d8c4dcf-6219-4b8a-a614-0c75a4b24fb5
Hello from AgentCube!

2026-11-06 10:44:48,314 | INFO | agentcube.code_interpreter | Deleting session 3d8c4dcf-6219-4b8a-a614-0c75a4b24fb5...
(base) ➜  agentcube git:(upgrade) ✗ python quickstart.py
2026-11-06 10:44:50,664 | INFO | agentcube.code_interpreter | Creating new session...
2026-11-06 10:44:51,681 | INFO | agentcube.code_interpreter | Session created: f7508d2c-9372-4d99-b514-020537d01129
Hello from AgentCube!

2026-11-06 10:44:51,712 | INFO | agentcube.code_interpreter | Deleting session f7508d2c-9372-4d99-b514-020537d01129...
(base) ➜  agentcube git:(upgrade) ✗ kubectl get sandbox
NAME                   READY   REASON              AGE
my-interpreter-lmtg2   True    DependenciesReady   13s
my-interpreter-t8lv5   True    DependenciesReady   16s

Now this PR is ready for review, please take a look when you are available
/cc @acsoto

Comment thread pkg/workloadmanager/k8s_client_test.go Resolved
Comment thread docs/getting-started.md Resolved
Signed-off-by: zhzhuang-zju <m17799853869@163.com>
Copilot AI balanced review requested due to automatic review settings November 6, 2026 09:32
@zhzhuang-zju

Copy link
Copy Markdown
Contributor Author

Hi @acsoto, all comments are addressed, please take a look

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🔵 Needs a closer look

The v0.4.6→v1.0.9 controller/API upgrade requires live-cluster E2E validation of CEL admission, warm-pool adoption, and cleanup beyond the reported unit tests and E2E compilation.

No open issues 🎉

Review effort: Balanced

@acsoto

acsoto commented Nov 9, 2026

Copy link
Copy Markdown
Member

/lgtm
/approve

@acsoto

acsoto commented Nov 9, 2026

Copy link
Copy Markdown
Member

/approve

@volcano-sh-bot

Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: acsoto

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

@volcano-sh-bot
volcano-sh-bot merged commit 1892634 into volcano-sh:main Nov 9, 2026
15 checks passed
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.

Upgrade agent-sandbox to v1.0.2

5 participants