MCPcopy
hub / github.com/ray-project/ray / validate_node_labels

Function validate_node_labels

python/ray/_private/label_utils.py:111–120  ·  view source on GitHub ↗
(labels: Dict[str, str])

Source from the content-addressed store, hash-verified

109# TODO (ryanaoleary@): This function will be removed after the migration to the label
110# selector API from NodeLabelSchedulingPolicy is complete.
111def validate_node_labels(labels: Dict[str, str]):
112 if labels is None:
113 return
114 for key in labels.keys():
115 if key.startswith(ray_constants.RAY_DEFAULT_LABEL_KEYS_PREFIX):
116 raise ValueError(
117 f"Custom label keys `{key}` cannot start with the prefix "
118 f"`{ray_constants.RAY_DEFAULT_LABEL_KEYS_PREFIX}`. "
119 f"This is reserved for Ray defined labels."
120 )
121
122
123def validate_label_key(key: str) -> Optional[str]:

Callers 2

parse_node_labels_jsonFunction · 0.85

Calls 1

keysMethod · 0.45

Tested by 1

Used in the wild real call sites across dependent graphs

searching dependent graphs…