Skip to content

[Serve] Support hard node label constraints in deployment scheduling #59055

@ktyxx

Description

@ktyxx

Description

Currently, Ray Serve's deployment scheduler only supports soft node label constraints when scheduling replicas.

In deployment_scheduler.py:596-600, NodeLabelSchedulingStrategy is always created with hard={}:

elif target_labels is not None:
    scheduling_strategy = NodeLabelSchedulingStrategy(
        hard={}, soft=target_labels
    )

While Ray Core's NodeLabelSchedulingStrategy fully supports both hard and soft constraints, Ray Serve only exposes the soft option.

Some workloads require strict node placement (e.g., compliance, hardware isolation, cost control) and should fail rather than fall back to unintended nodes.

Was it an intentional design decision to only support soft constraints in Serve (while Core supports both)? If so, I'd like to understand the reasoning.

Metadata

Metadata

Assignees

Labels

community-backlogenhancementRequest for new feature and/or capabilityquestionJust a question :)serveRay Serve Related Issuetech-debtThe issue that's due to tech debttriageNeeds triage (eg: priority, bug/not-bug, and owning component)usability

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions