Unlock AgentCube on Huawei Cloud CCE to Build High‑Performance AI Agents
This guide explains how AgentCube, a Volcano sub‑project, enables rapid startup, high‑throughput scheduling, native session management, and strong isolation for AI Agent workloads on Huawei Cloud CCE, with step‑by‑step installation, configuration, and code examples demonstrating both CodeInterpreter and AgentRuntime.
As large‑model technology advances, AI Agents move from concept to production, exhibiting intermittent activity, ultra‑low latency sensitivity, and multi‑turn session state persistence, which traditional Kubernetes schedulers are not optimized for.
AgentCube, a sub‑project of the Volcano community, addresses these challenges with four core capabilities: rapid startup via a Warm Pool that pre‑creates sandbox pods for millisecond‑level “Claim‑and‑Go” allocation; high‑throughput scheduling using Volcano’s optimistic concurrent control and a lightweight scheduler that co‑exists with the batch scheduler; native session management that routes requests by Session ID and wakes sleeping sandboxes to preserve conversational context; and strong isolation by assigning each session an independent sandbox, optionally running in a secure container with kernel‑level isolation.
The article focuses on deploying AgentCube on Huawei Cloud CCE (Cloud Container Engine). Prerequisites: a CCE cluster version 1.29+, local Python ≥ 3.11, and the Python SDK installed via pip install agentcube_sdk. The AgentCube plugin is installed from the CCE plugin marketplace via the console.
AgentCube components
workloadmanager – manages the lifecycle of AgentRuntime and CodeInterpreter.
agentcube-router – API gateway that forwards client requests to sandbox instances.
volcano-agent-scheduler – provides low‑latency, high‑throughput scheduling.
agent-sandbox-controller (AgentSandbox) – manages sandbox resources.
Installation parameters
redis.addrand redis.password – required Redis connection. agentSandbox.install – whether to auto‑install the sandbox. agentSandbox.extensions – enable the sandbox extension controller. volcano.scheduler.enabled – install the Volcano agent scheduler.
For stability, the article recommends using Huawei Cloud Distributed Cache Service (DCS) for Redis and, if external access is needed, binding the workloadmanager and agentcube-router services to an ELB Ingress.
Step 1: Environment variables
export WORKLOAD_MANAGER_URL="http://workloadmanager-addr:workloadmanager-port"
export ROUTER_URL="http://agentcube-router-addr:agentcube-router-port"Step 2: CodeInterpreter
Create code-interpreter.yaml (example shown) and apply it with kubectl apply -f code-interpreter.yaml. Verify with kubectl get codeinterpreter. A quick‑start script quickstart.py demonstrates creating a session, running print('Hello from AgentCube!'), and cleaning up. The output shows session creation, execution, and deletion.
A more advanced script longtask.py shows session reuse: it writes counter.txt and results.json, updates them across multiple runs, lists files, and finally deletes the session. Logs confirm that the same session_id is reused and that file system state persists between calls.
Step 3: AgentRuntime
AgentRuntime supports full PodSpec customization for typical Agent scenarios. Build an agent container image with a Dockerfile (Python 3.11‑slim base, install agentcube_sdk, copy agent.py, expose port 8080). Deploy with agent-runtime.yaml (example shown) and verify with kubectl get agentruntime.
A conversation script chatToAgent.py creates three sequential invocations to the same AgentRuntime instance, reusing the session ID. Logs show identical session_id across calls, confirming that AgentCube routes all requests to the same sandbox.
Conclusion
AgentCube delivers rapid startup, efficient scheduling, native session management, and strong isolation, filling the gap for running AI Agent workloads on Kubernetes. Huawei Cloud CCE will continue integrating AgentCube to provide a low‑latency, high‑throughput, securely isolated platform for AI Agents.
Signed-in readers can open the original source through BestHub's protected redirect.
This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactand we will review it promptly.
Huawei Cloud Developer Alliance
The Huawei Cloud Developer Alliance creates a tech sharing platform for developers and partners, gathering Huawei Cloud product knowledge, event updates, expert talks, and more. Together we continuously innovate to build the cloud foundation of an intelligent world.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
