Support for resource pools v2#4977
Open
stefannica wants to merge 41 commits into
Open
Conversation
Contributor
|
|
stefannica
force-pushed
the
feature/resource-pools-v2
branch
from
July 20, 2026 09:22
0599bd8 to
acbd8d6
Compare
|
Review the following changes in direct dependencies. Learn more about Socket for GitHub.
|
stefannica
force-pushed
the
feature/resource-pools-v2
branch
from
July 24, 2026 15:31
a8348e0 to
1bfc43f
Compare
stefannica
marked this pull request as ready for review
July 24, 2026 15:33
Contributor
Documentation Link Check Results✅ Absolute links check passed |
stefannica
force-pushed
the
feature/resource-pools-v2
branch
from
July 24, 2026 19:33
3eed989 to
e584a95
Compare
Contributor
ZenML CLI Performance Comparison (Threshold: 1.0s, Timeout: 60s, Slow: 5s)Performance Comparison
Summary
Environment Info
|
stefannica
force-pushed
the
feature/resource-pools-v2
branch
from
July 24, 2026 19:47
ee2cfb1 to
673633f
Compare
stefannica
force-pushed
the
feature/resource-pools-v2
branch
from
July 24, 2026 20:00
673633f to
cd2bed4
Compare
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.
Overview
This PR updates resource pool support to use the new ZenML Pro Resource Manager as the source of truth for scheduling, allocation, lease management, and eviction decisions. The ZenML workspace now keeps only the runtime-facing resource request surface needed by pipeline execution, while the old resource pool control-plane entities are removed from the OSS API, client, CLI, RBAC, DB schemas, and local store implementation.
It also connects allocated resources all the way into dynamic step execution. Resource settings can now describe richer resource demands, ZenML creates Resource Manager-backed requests for eligible dynamic steps, waits for allocation before submitting remote work, and passes the resulting allocation into orchestrators or step operators that explicitly support it. Kubernetes is the first implementation to opt in: it applies Resource Manager-selected component settings and translates allocated CPU, memory, and GPU capacity into Kubernetes pod requests and limits.
flowchart TD A[Dynamic step run is created] --> B[ZenML builds Resource Manager demands<br/>from ResourceSettings] B --> C[Workspace creates resource request<br/>through Resource Manager] C --> D{Allocated?} D -- queued/pending --> E[StepLauncher polls and renews<br/>pending request lease] E --> D D -- allocated --> F[StepLauncher receives allocated<br/>ResourceRequestResponse] F --> G{Execution target} G -- step operator --> H[submit_with_allocation] G -- dynamic orchestrator --> I[submit_isolated_step_with_allocation] H --> J[Kubernetes applies target settings<br/>and pod resource overrides] I --> J J --> K[Remote step starts] K --> L[Heartbeat renews lease while running] L --> M[Resources released on completion<br/>or cancellation]Finally, resource request leases are integrated with the existing step heartbeat mechanism. Heartbeats now keep allocated requests alive, report runtime state back to Resource Manager, and turn reclaim or eviction states into graceful step cancellation.
sequenceDiagram participant Step as Running step participant HB as Heartbeat worker participant Store as ZenML SQL store participant RM as Resource Manager Step->>HB: start heartbeat worker loop every heartbeat interval HB->>Store: update_step_heartbeat(timeout) Store->>RM: renew resource request lease RM-->>Store: current request status alt request still valid Store-->>HB: step remains running else request preempting / cancelled / expired / released Store-->>HB: return cancelling status HB->>Step: interrupt main thread end end Step->>Store: step shutdown / final status Store->>RM: release resource requestBreaking Changes
This change erases all data from the previous resource pools v1 implementation (pools, policies, resource requests. There is no migration path provided.
Implementation Details
Extends
ResourceSettingswith a richer resource demand model:PoolResourceDemandand flexibleresourcesinput support for resource names, name-to-quantity maps, single demand objects, and lists of demandsgpu_class,allocation_wait_timeout_seconds,initialization_lease_seconds, andreclaim_tolerancepool_resourcesandpreemptibleResourceRequestDemandobjects for Resource Manager requestsUpdates dynamic runtime selection:
cpu,memory, orgpu) now resolve toStepRuntime.ISOLATEDwhen the orchestrator supports isolated stepsAdds allocation-aware launch hooks:
supports_resource_pool_allocationon base orchestrators and step operators, defaulting toFalsesubmit_isolated_step_with_allocation(...)onBaseOrchestratorsubmit_with_allocation(...)andlaunch_with_allocation(...)onBaseStepOperatorWires allocations through the dynamic step launcher:
ResourceSettingsResourceRequestResponseinto the selected step operator or dynamic orchestrator submission pathAdds Kubernetes allocation support:
Minimizes the workspace resource pool API:
renewandreleaseresource request operationsDelegates runtime request storage to Resource Manager:
resource_request_idon step runs instead of local resource request rowsReuses heartbeats for lease renewal and eviction:
heartbeat_liveness_timeout_secondsReflects ZenML Pro account privileges:
is_superuserproperty to ZenML’s internalis_adminuser property during auth/user synchronizationPre-requisites
Please ensure you have done the following:
developand the open PR is targetingdevelop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.Types of changes