Skip to content

fix(agent): filter InferenceServices by Metal accelerator type#157

Merged
Defilan merged 1 commit intomainfrom
fix/metal-agent-accelerator-filter
Feb 20, 2026
Merged

fix(agent): filter InferenceServices by Metal accelerator type#157
Defilan merged 1 commit intomainfrom
fix/metal-agent-accelerator-filter

Conversation

@Defilan
Copy link
Member

@Defilan Defilan commented Feb 20, 2026

Summary

  • Metal Agent now only watches InferenceServices whose referenced Model has hardware.accelerator: metal
  • Services with cuda, cpu, or missing models are ignored
  • Fixes the Metal Agent incorrectly claiming CUDA/CPU workloads intended for Linux nodes

Problem

The shouldWatch method returned true for all InferenceServices. This caused the Metal Agent on a Mac to intercept and run models that should have been scheduled as containers on NVIDIA GPU nodes (CUDA) or CPU nodes.

Changes

  • pkg/agent/watcher.goshouldWatch now fetches the referenced Model and checks spec.hardware.accelerator == "metal"
  • pkg/agent/watcher_test.go — Updated tests to cover metal/cuda/cpu/missing model filtering; existing tests updated with Model fixtures

Test plan

  • go test ./pkg/agent/... passes (30/30)
  • Deploy Metal Agent with this fix — verify it ignores accelerator: cuda and accelerator: cpu models
  • Verify it still picks up accelerator: metal models correctly

The Metal Agent was claiming all InferenceServices regardless of their
Model's accelerator setting. This caused CUDA and CPU models intended
for Linux nodes to be intercepted and run on the Mac instead.

shouldWatch now looks up the referenced Model resource and only returns
true when hardware.accelerator is "metal". Services referencing CUDA,
CPU, or missing models are ignored.

Signed-off-by: Christopher Maher <chris@defilan.com>
@Defilan Defilan merged commit 5737bb7 into main Feb 20, 2026
15 checks passed
@Defilan Defilan deleted the fix/metal-agent-accelerator-filter branch February 20, 2026 10:30
@github-actions github-actions bot mentioned this pull request Feb 20, 2026
@github-actions github-actions bot mentioned this pull request Mar 4, 2026
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.

1 participant