Skip to content

Place cached replicas only on clusters with cache storage - #466

Merged
negz merged 1 commit into
modelplaneai:mainfrom
negz:cache-me-if-you-can
Sep 29, 2026
Merged

negz merged 1 commit into
modelplaneai:mainfrom
negz:cache-me-if-you-can

Conversation

@negz

@negz negz commented Sep 26, 2026 •

Copy link
Copy Markdown
Collaborator

Description of your changes

#176 had compose-model-cache stage only onto clusters with an RWX StorageClass, and #189 then bounded placement by the cache's clusterSelector alone, missing that. #370 added a source, Vultr, that never has a class.

A ModelDeployment that references a ModelCache placed its replicas on any cluster the cache's selector matched. compose-model-cache stages only onto the matching clusters that report cache storage in status.cache. Vultr reports none, nor does an Existing cluster with no cache.storageClassName. So a replica could land where its PVC never appears and hang on the mount, the failure #186 describes.

Only clusters with cache storage are now candidates for a deployment that references a cache. A replica already on one without is re-placed, as a replica is when the cache's selector stops matching its cluster, which also fixes any replica the bug already stranded. With no candidate left, ReplicasScheduled reports NoCacheStorage rather than InsufficientCapacity.

The ModelCache docs said narrowing the selector leaves running replicas where they are. The code re-places them, which is right, since compose-model-cache deletes the cache's PVC on a cluster it no longer stages to, so this corrects the docs.

A cluster that names a missing or non-RWX StorageClass still counts as having cache storage, and its PVC never binds. I haven't reproduced any of this on a real cluster, since that needs a second cluster that can't host the cache.

I have:

  • Read and followed Modelplane's contribution process.
  • Run nix flake check (or ./nix.sh flake check) and made sure it passes.
  • Added or updated tests covering any composition function changes.
  • Signed off every commit with git commit -s.

Copilot AI balanced review requested due to automatic review settings September 26, 2026 01:07

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@github-actions

Copy link
Copy Markdown

Docs preview: https://modelplane-docs-pr-466.vercel.app (ready once the site's Content workflow finishes)

@negz
negz force-pushed the cache-me-if-you-can branch from 7755f60 to cc5fb63 Compare September 26, 2026 02:03
Copilot AI review requested due to automatic review settings September 26, 2026 02:03

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

A ModelDeployment that references a ModelCache placed its replicas on any
cluster the cache's clusterSelector matched, but compose-model-cache only
stages the cache onto matching clusters that report cache storage, an RWX
StorageClass in status.cache. Vultr clusters, and Existing clusters that
name no RWX StorageClass, report none, so a replica could land where its PVC
never appears and hang on the volume mount (modelplaneai#186).

This makes only clusters with cache storage candidates for a deployment that
references a cache. A replica already on one without is re-placed, as a
replica is when the cache's selector stops matching its cluster, and a
deployment left with no candidate says so in ReplicasScheduled rather than
blaming capacity.

It also corrects the ModelCache docs, which said narrowing the selector
leaves running replicas where they are. They're re-placed, which is right,
since compose-model-cache deletes the cache's PVC on a cluster it no longer
stages to.

Signed-off-by: Nic Cope <nicc@rk0n.org>
@negz
negz force-pushed the cache-me-if-you-can branch from cc5fb63 to 02062ba Compare September 26, 2026 02:25
Copilot AI review requested due to automatic review settings September 26, 2026 02:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has reached their quota limit.

@negz negz changed the title Place cached replicas only where their ModelCache stages Place cached replicas only on clusters with cache storage Sep 26, 2026

@haarchri haarchri left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@negz
negz merged commit e07879f into modelplaneai:main Sep 29, 2026
7 checks passed
@negz
negz deleted the cache-me-if-you-can branch September 29, 2026 23:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants