Skip to content

Workloadmanager Improvements#68

Merged
volcano-sh-bot merged 16 commits intovolcano-sh:mainfrom
acsoto:workload-mgr
Dec 17, 2025
Merged

Workloadmanager Improvements#68
volcano-sh-bot merged 16 commits intovolcano-sh:mainfrom
acsoto:workload-mgr

Conversation

@acsoto
Copy link
Copy Markdown
Member

@acsoto acsoto commented Dec 9, 2025

This pull request primarily renames the project and all related components from agentcube-apiserver to workloadmanager, ensuring consistent naming across the codebase, documentation, Docker, Kubernetes manifests, and build scripts. Additionally, it introduces new configuration options for sandbox image pulling and updates dependencies.

Project-wide renaming and configuration updates:

Major rename of binaries, scripts, and manifests:

  • Renamed all references, binaries, Docker images, Kubernetes manifests, environment variables, and documentation from agentcube-apiserver to workloadmanager for clarity and consistency. This includes updates in the Dockerfile, Makefile, deployment YAMLs, README files, and log messages. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12] [13] [14] [15] [16] [17] [18] [19] [20]

Sandbox image configuration enhancements:

  • Added ImagePullPolicy and ImagePullSecrets fields to CodeInterpreterSandboxTemplate to allow more flexible and secure configuration of how container images are pulled for sandboxes.

Dependency updates:

  • Added github.com/golang-jwt/jwt/v5 and updated k8s.io/utils dependency in go.mod for improved JWT handling and Kubernetes utilities. [1] [2] [3]

API and Redis client interface changes:

  • Added a PublicKey field to CreateSandboxRequest for improved session creation security.
  • Removed unused session lock and bidirectional mapping methods from the Redis client interface to simplify code and reduce technical debt. [1] [2] [3]

Copilot AI review requested due to automatic review settings December 9, 2025 02:14
@gemini-code-assist
Copy link
Copy Markdown
Contributor

Summary of Changes

Hello @acsoto, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly refactors the project by renaming its core component from agentcube-apiserver to workloadmanager, ensuring consistency across all aspects of the system. It introduces critical new features for sandbox management, including advanced image pulling configurations and a secure JWT-based initialization process for sandboxes. Furthermore, the changes include dependency updates, API enhancements for security, and internal Redis client optimizations, all aimed at improving the system's robustness, security, and maintainability.

Highlights

  • Project Renaming: The project and all related components have been comprehensively renamed from agentcube-apiserver to workloadmanager. This includes updates across binaries, scripts, Dockerfiles, Kubernetes manifests, environment variables, and documentation to ensure consistent naming.
  • Sandbox Image Configuration: New configuration options, ImagePullPolicy and ImagePullSecrets, have been added to CodeInterpreterSandboxTemplate to provide more flexible and secure control over how container images are pulled for sandboxes.
  • Dependency Updates: The go.mod file has been updated to include github.com/golang-jwt/jwt/v5 for improved JWT handling and k8s.io/utils for updated Kubernetes utilities.
  • API and Redis Client Enhancements: The CreateSandboxRequest API now includes a PublicKey field for enhanced session creation security. Additionally, unused session lock and bidirectional mapping methods have been removed from the Redis client interface to simplify the codebase.
  • Sandbox Initialization with JWT: A new JWTManager has been introduced to handle RSA key pair generation and JWT token signing. Sandbox creation now includes an initialization step that sends a JWT-signed request with the public key to the sandbox's /init endpoint, and the public key is stored in a Kubernetes secret.
  • Garbage Collection Improvements: The garbage collector has been enhanced to correctly distinguish and delete both Sandbox and SandboxClaim resources, improving cleanup logic.
  • Dynamic Kubernetes Client Usage: The handleCreateSandbox and handleDeleteSandbox functions now conditionally use a user's Kubernetes client based on authentication status, allowing for more granular permission management.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request accomplishes a significant renaming of the project from agentcube-apiserver to workloadmanager and introduces several enhancements, including a new sandbox initialization flow using JWT and more flexible image pulling configurations. My review focuses on ensuring the renaming is applied consistently across the codebase, especially for Kubernetes resource names and labels that were missed. I've also provided suggestions to improve code correctness and maintainability, such as using unbiased random number generation, replacing hardcoded values with constants, and improving logging for better debuggability. Overall, the changes are well-structured and significantly improve the project's clarity and functionality.

Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request performs a comprehensive renaming of the project from agentcube-apiserver to workloadmanager while introducing JWT-based sandbox initialization functionality and new container image configuration options. The changes span build scripts, deployment manifests, Docker configurations, and core application code.

Key Changes:

  • Complete project renaming from agentcube-apiserver to workloadmanager across all binaries, images, manifests, and documentation
  • New JWT-based authentication system for sandbox initialization with RSA key pair generation and storage in Kubernetes secrets
  • Enhanced CodeInterpreter sandbox configuration with ImagePullPolicy and ImagePullSecrets fields for better image management

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated 16 comments.

Show a summary per file
File Description
Dockerfile Updated binary name from agentcube-apiserver to workloadmanager
Makefile Renamed build targets and image names to use workloadmanager
k8s/workloadmanager.yaml Renamed all Kubernetes resources (ServiceAccount, ClusterRole, Deployment, Service) to use workloadmanager
cmd/workload-manager/main.go Updated startup log message to reference workloadmanager
test/e2e/run_e2e.sh Updated test script to use new workloadmanager naming
example/README.md Updated documentation to reference workloadmanager instead of agentcube-apiserver
example/pcap-analyzer/deployment.yaml Updated service URL to use workloadmanager service name
images/sandbox/README.md Updated documentation references to workloadmanager
pkg/workloadmanager/utils.go Added RandString utility for generating random strings (used in sandbox naming)
pkg/workloadmanager/utils_test.go Added basic tests for RandString function
pkg/workloadmanager/jwt.go New JWT manager for generating tokens and managing RSA key pairs
pkg/workloadmanager/sandbox_init.go New sandbox initialization logic with JWT-authenticated HTTP requests
pkg/workloadmanager/server.go Integrated JWT manager and added enableAuth field for optional authentication
pkg/workloadmanager/auth.go Added conditional authentication check based on enableAuth flag
pkg/workloadmanager/handlers.go Enhanced sandbox creation with initialization flow and conditional auth logic
pkg/workloadmanager/workload_builder.go Fixed SandboxClaim TypeMeta, added sessionID labels, updated sandbox naming, injected JWT public key volume
pkg/workloadmanager/k8s_client.go Enhanced pod IP lookup with pod name parameter, added JWT secret storage
pkg/workloadmanager/garbage_collection.go Added SandboxClaim cleanup support and improved logging
pkg/workloadmanager/codeinterpreter_controller.go Added ImagePullPolicy and ImagePullSecrets support with JWT volume mounting
pkg/redis/client.go Removed unused bidirectional mapping methods, added loadSandboxesByIDs helper
pkg/redis/client_test.go Removed tests for deleted session lock functionality
pkg/common/types/sandbox.go Added optional PublicKey field to CreateSandboxRequest
pkg/apis/runtime/v1alpha1/codeinterpreter_types.go Added ImagePullPolicy and ImagePullSecrets fields to template spec
go.mod Added github.com/golang-jwt/jwt/v5 dependency and promoted k8s.io/utils to direct dependency
go.sum Updated checksums for new JWT dependency

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Copy Markdown
Contributor

@tjucoder tjucoder left a comment

Choose a reason for hiding this comment

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

view

Copilot AI review requested due to automatic review settings December 11, 2025 06:32
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 25 out of 27 changed files in this pull request and generated 9 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings December 13, 2025 11:39
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@hzxuzhonghu
Copy link
Copy Markdown
Member

please update

Copilot AI review requested due to automatic review settings December 15, 2025 04:20
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@tjucoder
Copy link
Copy Markdown
Contributor

please update

rebase and solve conflicts

Copilot AI review requested due to automatic review settings December 15, 2025 07:03
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

acsoto and others added 7 commits December 16, 2025 16:29
Signed-off-by: Zhou Zihang <z@mcac.cc>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: Zhou Zihang <z@mcac.cc>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: Zhou Zihang <z@mcac.cc>
Copilot AI review requested due to automatic review settings December 16, 2025 08:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Copilot AI review requested due to automatic review settings December 16, 2025 15:31
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Copy link
Copy Markdown
Member

@hzxuzhonghu hzxuzhonghu left a comment

Choose a reason for hiding this comment

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

StoreJWTPublicKeyInSecret is still not handled correctly, when you create secret, but it returns already exist error

Comment on lines +217 to +232
if externalInfo.NeedInitialization == true {
// Code Interpreter sandbox created, init code interpreter
// Find the /init endpoint from entryPoints
var initEndpoint string
for _, access := range storeCacheInfo.EntryPoints {
if access.Path == "/init" {
initEndpoint = fmt.Sprintf("%s://%s", access.Protocol, access.Endpoint)
break
}
}

// If no /init path found, use the first entryPoint endpoint fallback
if initEndpoint == "" {
initEndpoint = fmt.Sprintf("%s://%s", storeCacheInfo.EntryPoints[0].Protocol,
storeCacheInfo.EntryPoints[0].Endpoint)
}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Feel this is too hacky, it requires that user must specify /init entry point. I think we can make /init as default.

// NeedInitialization specifies if CodeInterpreter need initialization
// default true if NeedInitialization is nil
// +optional
NeedInitialization *bool `json:"needInitialization,omitempty"`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This field is limited to work only with picod, maybe at first we can remove this, and do initialization as we do now.

We can extend the init configuration later if needed, it will need not only a bool.
Whatever picod should be a must now.

)

type SandboxRedis struct {
type SandboxStore struct {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

SandboxStore looks like a class, while here we want to express a object
Maybe call SandboxInfo

Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Signed-off-by: tjucoder <chinesecoder@foxmail.com>
Copilot AI review requested due to automatic review settings December 17, 2025 08:27
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

Signed-off-by: tjucoder <chinesecoder@foxmail.com>
@volcano-sh-bot
Copy link
Copy Markdown
Contributor

Keywords which can automatically close issues and at(@) or hashtag(#) mentions are not allowed in commit messages.

The list of commits with invalid commit messages:

  • 824e05f Apply suggestion from @Copilot
Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@hzxuzhonghu
Copy link
Copy Markdown
Member

/lgtm
/approve

@volcano-sh-bot
Copy link
Copy Markdown
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

Approval requirements bypassed by manually added approval.

This pull-request has been approved by: hzxuzhonghu

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 30a5628 into volcano-sh:main Dec 17, 2025
5 checks passed
@acsoto acsoto deleted the workload-mgr branch December 23, 2025 03:04
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.

7 participants