Repository navigation
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #14733 +/- ##
============================================
+ Coverage 20.81% 20.97% +0.16%
- Complexity 20923 21356 +433
============================================
Files 6053 6172 +119
Lines 548451 552076 +3625
Branches 73279 73626 +347
============================================
+ Hits 114138 115781 +1643
- Misses 420948 422750 +1802
- Partials 13365 13545 +180
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
kiwiflyer
force-pushed
the
Cloudstack-AI-Plugin
branch
from
November 19, 2026 14:15
47a6c4e to
8efcb65
Compare
Adds a native API plugin (plugins/api/ai-services) and a ui/ section
that let an operator source open-weight LLMs, deploy them on NVIDIA GPU
capacity, tune them through profiles, and sell them to tenants as
OpenAI-compatible endpoints.
The plugin is the front door only — auth, RBAC, async jobs, events,
usage and limits. It delegates over mTLS to an external reconciler,
which is the component that touches GPU resources, CKS and the serving
layer; that engine is not in this change.
* 58 API commands: 38 v1, registered always, and 20 v2, registered
only when the global setting ai.services.v2.enabled is on (default
false), so a GA install does not advertise an API for features it
is not running.
* A UI section of 19 screens. Each route carries a permission, so
CloudStack drops any screen whose command the caller cannot call,
and the Tier 2 screens appear and disappear with that one setting.
* Ten ai.services.* ConfigKeys, including the engine URLs and its
mTLS material.
* Default role access declared on @APICommand(authorized = ...), so
there is no migration, no commands.properties and no operator step.
An explicit role_permissions rule still wins.
The change is additive. Four existing files are touched: plugins/pom.xml
and client/pom.xml to build and bundle the module, ui/src/config/
router.js to register the section, and ui/public/locales/en.json, into
which 150 keys are appended without reordering or reformatting anything
already there.
Tested against a live 4.23.0.0 management server with the plugin loaded:
481 JUnit tests and checkstyle clean; listApis goes 865 -> 903 with the
plugin and -> 923 with v2 enabled, exactly the declared commands; Marvin
covers all 58 commands across three default roles, allowed and denied;
and the Playwright suite passes 40 with 7 skipped against the plugin and
the UI in the same management server.
Not yet exercised: a full reactor build, any live 24.0.0-SNAPSHOT
server, and real GPU capacity — the simulator's cards are simulated.
kiwiflyer
force-pushed
the
Cloudstack-AI-Plugin
branch
from
November 19, 2026 14:31
8efcb65 to
898608c
Compare
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a work in progress
This PR adds CloudStack AI Services: a native API plugin (
plugins/api/ai-services)and a
ui/section that let an operator source open-weight LLMs, deploy them on NVIDIAGPU capacity, tune them through profiles, and sell them to tenants as OpenAI-compatible
endpoints.
The plugin is the front door only — auth, RBAC, async jobs, events, usage and limits. It
delegates to an external reconciler over mTLS, which is the component that touches GPU
resources, CKS and the serving layer. That engine is not in this PR, which is the main
thing I would like feedback on; see "Open questions" below.
What it contains -
global setting
ai.services.v2.enabledis on (default false), so a GA install doesnot advertise an API for features it is not running.
copy-ready snippets, a playground, generation profiles and effective-parameter
resolution, usage and budgets, plus admin screens for setup preflight, GPU capacity and
the model registry. Routes carry a
permission, so CloudStack drops any screen whosecommand the caller cannot call, and the Tier 2 screens appear and disappear with that one
setting.
ai.services.*ConfigKeys, including the engine URLs and its mTLS material.@APICommand(authorized = …), so there is nomigration, no
commands.propertiesand no operator step. Explicitrole_permissionsrules still win.
The change is additive: 158 files, 19,207 insertions and a single deletion (a comma, to
append to
en.json). Only four existing files are touched —plugins/pom.xml,client/pom.xml,ui/src/config/router.js, andui/public/locales/en.json, into which 150keys are appended without reordering or reformatting anything already there.
Where the rest of it lives
Everything this plugin talks to is Apache-2.0 and public, so the serving layer can be built
and the design read is available here:
https://github.com/kiwiflyer/CloudStack_AI_Plugin
SPEC.mddocs/installation.mdaisvc/observe() → diff() → plan() → execute(), one leader per zone.gateway-hooks/install.pyFor the serving layer specifically, the two decisions that shape it are
ADR-0001
(plain Kubernetes
Deployments rendered by the engine, with blue/green weighting at thegateway rather than in the serving layer) and
ADR-0002
(LiteLLM Proxy, MIT side only). Where a CKS cluster comes from is
ADR-0007,
and all eight ADRs
record what was decided and what is still open.
Also worth reading:
why this exists and what it lets an operator sell,
the limits-and-defaults sheet
(every threshold and TTL read from the code, with gaps marked ·not built rather than
omitted), a walkthrough of the UI section
screen by screen, and the
third-party licence position
— the dependency tree follows ASF Category A/B/X, GPL/LGPL/AGPL are excluded including for
Python imports, and CI fails on anything it cannot classify.
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
Against a live 4.23.0.0 management server (the simulator image), with the plugin built,
installed and loaded, and the UI section compiled into that server's own
ui/tree.mvn -pl plugins/api/ai-services testis green andcheckstyle is clean against
cloud-style.xml.listApisgoes from 865 to 903 with theplugin loaded — exactly the 38 v1 commands — and to 923 with
ai.services.v2.enabledon,exactly the 20 v2 ones. The gate holds on a real server in both directions.
test/integration/plugins/ai-services/) cover all 58commands across three default roles, allowed and denied. They call each command with no
arguments, because access is checked before parameters are: a role that may call one
fails on its arguments (431) and one that may not fails on the name (432), so nothing is
executed either way.
management server: the section visible per role, every admin screen absent for a domain
admin and a tenant, and a tenant typing an admin screen's URL getting a 404 rather than a
refusal. The 7 skips are the
ai.services.v2.enabled-off group, which cannot run whilethe setting is on.
listAiModelsreturns two models toroot admin, two to an account in
/Customers/Acme, and none to one in/ROOT.section is reachable only by clicking.
How did you try to break this feature and the system with this change?
The failure mode I worried about most is CloudStack dropping something in silence, so
most of the hardening is aimed there:
One missing bean in the Spring context took the whole
/clientcontext down — no API atall, for anything — while 451 unit tests stayed green, because they construct the manager
directly. There is now a test that walks every
@Injectfield and fails on any typewithout a bean.
collect a value that goes nowhere — a key "restricted" to two models and a CIDR was being
created unrestricted. Tests now compare every parameter each caller sends against the
command that receives it, in both directions, including required parameters never offered.
the same way. Ten were, including a guardrail profile's checks. A test walks each
engine payload against its response class; a field may be omitted only with a recorded
reason.
explicit grant, verified on a live server rather than in a unit test.
a replica that answered is never retried, so a POST cannot be applied twice.
sentence rather than a bare status code, and an async command must not report success for
work no job ever did.
What has not been tested, and I would not want a reviewer to assume otherwise:
main/24.0.0-SNAPSHOT server. It compiles and itstests pass against this tree, and none of the ~45 CloudStack APIs it imports has moved,
but compiling is not loading — and the one defect only a real server could show took the
management server down.
physical GPU capacity has been allocated by this code.
mvn -pl plugins/api/ai-services test. A full reactor build has not been run, and thisPR edits
plugins/pom.xmlandclient/pom.xml, so CI is the first thing that willcompile the whole tree with the module in it. I would not be surprised by a packaging
problem there.
npm run buildin this tree. A build reportingCompiled successfullysays nothing about whether labels resolve anyway — that has to bechecked on a rendered screen.