myxce/.kiro/specs/elastic-shared-resources/brief.md
Rongsong Shen 922188b5d7
docs(specs): discovery for auto resource provisioning
New briefs: provisioning-demand (the scheduler knows a provisionable
catalog, tries host templates as virtual hosts and license headroom after
real resources fail, finalizes demand and idle supply at session end;
simulator support is a hard requirement), resource-provisioner (new
daemon, several instances owning providers via controller leases,
self-describing providers, automatic policy, durable request/instance
state; src/autoscaler is prior art only), elastic-hosts (host templates,
expected hosts, drain and decommission), elastic-shared-resources
(borrowed license tokens change the shared total).

Roadmap: the new specs, plus updates to resource-distribution-mapping
(shared pools) and peer-authentication-hardening (provisioner role).

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-10-10 07:37:25 +00:00

65 lines
2.7 KiB
Markdown

# Brief: elastic-shared-resources
(`/kiro-discovery`, 2026-10-10, "Auto resource provisioning". Example: EDA
license tokens borrowed from a shared license pool.)
## Problem
Cluster-wide countable resources such as EDA licenses are often shared with
other sites or clusters. When jobs wait for licenses, XCE should borrow more
tokens from the shared pool and return unused tokens when load is light, so
the cluster's total follows its need.
## Current State
- Shared pooled resources work in the scheduler (`sharedInst` totals vs
`sharedInUse`, `resource.c:292`), and a total can change at runtime
(RESVALS_FULL events), but only resources flagged SHARED, and today only
limit virtual resources are: `resources.yaml` cannot declare a shared
pool (`xceadmin` maps only `consumable`/`release`), which is the open
`resource-distribution-mapping` decision.
- Only a worker may update a shared value (`do_update_resvals`, `opupd.c:11`,
`HostRole_worker`).
## Desired Outcome
- A shared resource can be marked **elastic**, with its owned base amount
and the provider that can lend more.
- The provisioner's grants and returns change the cluster's total for that
resource (base + borrowed), through a controller-authorized update by the
provisioner role; the change is durable and visible.
- Borrowed amounts unused for a configured time (and past the provider's
minimum hold) are returned; amounts in use are never returned.
- Optionally the observed in-use count from the real license server is
reported, so XCE's view does not drift from reality.
- Users see the total, owned and borrowed amounts and current use.
## Approach
Build on the shared-pool scope of `resource-distribution-mapping`; add an
elastic flag, a borrowed component of the total, and a provisioner update
path through the controller.
## Scope
- **In**: elastic flag and config; borrowed component; provisioner update
path and its authorization; return rules; display; persistence.
- **Out**: the license server protocol itself (provider scripts); demand
computation (`provisioning-demand`); provider policy
(`resource-provisioner`).
## Boundary Candidates
- Elastic shared resource model and config.
- Total update path (controller, scheduler).
- Return rules.
## Out of Boundary
- Talking to license servers.
## Upstream / Downstream
- **Upstream**: `resource-distribution-mapping` (shared pool declaration),
`resource-provisioner`.
- **Downstream**: other countable provisioned resources.
## Existing Spec Touchpoints
- **Extends**: `resource-distribution-mapping` (needs its shared-pool scope).
- **Adjacent**: `resource-value-verification`.
## Constraints
- Totals must be identical for live and simulated scheduling.
- HA/persistence: full 3-phase workflow.