ray.util.scheduling_strategies.NodeAffinitySchedulingStrategy.__init__#
- NodeAffinitySchedulingStrategy.__init__(node_id: str, soft: bool, _spill_on_unavailable: bool = False, _fail_on_unavailable: bool = False)[source]#
Initialize a
NodeAffinitySchedulingStrategy.- Parameters:
node_id – the hex id of the node where the task or actor should run.
soft – whether the scheduler should run the task or actor somewhere else if the target node doesn’t exist (e.g. the node dies) or is infeasible during scheduling. If the node exists and is feasible, the task or actor will only be scheduled there. This means if the node doesn’t have the available resources, the task or actor will wait indefinitely until resources become available. If the node doesn’t exist or is infeasible, the task or actor will fail if
softis False or be scheduled somewhere else ifsoftis True._spill_on_unavailable – (Private) When
softis True, allow spilling to another node if the target node is unavailable._fail_on_unavailable – (Private) When
softis False, fail immediately if the target node is unavailable rather than waiting.