Skip to content

Commit 80c2286

Browse files
Merge branch 'master' of https://github.com/ray-project/ray
2 parents c982579 + f580a27 commit 80c2286

File tree

433 files changed

+67073
-11045
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

433 files changed

+67073
-11045
lines changed

.vale/styles/Google/WordList.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ swap:
1111
"(?:dev|developer|APIs) console": API console
1212
"(?:e-mail|Email|E-mail)": email
1313
"(?:file ?path|path ?name)": path
14-
"(?:kill|terminate|abort)": stop|exit|cancel|end
14+
"(?:terminate|abort)": stop|exit|cancel|end
1515
"(?:OAuth ?2|Oauth)": OAuth 2.0
1616
"(?:ok|Okay)": OK|okay
1717
"(?:WiFi|wifi)": Wi-Fi

.vale/styles/config/vocabularies/Core/accept.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
[Ss]tderr
33
[Ss]tdout
44
job_id
5-
Autoscaler
5+
[Aa]utoscaler
66
ANSI
77
PID
88
tqdm

.vale/styles/config/vocabularies/General/accept.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ NVIDIA
8888
NVLink
8989
OOM
9090
open-source
91-
PACK
91+
[Pp][Aa][Cc][Kk]
9292
pipelining
9393
Podman
9494
preemptible

ci/build/build-manylinux-forge.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,8 +74,8 @@ chmod +x /tmp/bazelisk
7474
sudo mv /tmp/bazelisk /usr/local/bin/bazelisk
7575
sudo ln -sf /usr/local/bin/bazelisk /usr/local/bin/bazel
7676

77-
# Use python3.9 as default python3
78-
sudo ln -sf /usr/local/bin/python3.9 /usr/local/bin/python3
77+
# Use python3.10 as default python3
78+
sudo ln -sf /usr/local/bin/python3.10 /usr/local/bin/python3
7979

8080
{
8181
echo "build --config=ci"

ci/build/build-ray-docker.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,14 @@ CPU_TMP="$(mktemp -d)"
1414

1515
cp -r .whl "${CPU_TMP}/.whl"
1616
cp docker/ray/Dockerfile "${CPU_TMP}/Dockerfile"
17-
cp python/requirements_compiled.txt "${CPU_TMP}/."
17+
cp python/"${CONSTRAINTS_FILE}" "${CPU_TMP}/requirements_compiled.txt"
1818

1919
# Build the image.
2020
cd "${CPU_TMP}"
2121
tar --mtime="UTC 2020-01-01" -c -f - . \
2222
| docker build --progress=plain \
2323
--build-arg FULL_BASE_IMAGE="$SOURCE_IMAGE" \
2424
--build-arg WHEEL_PATH=".whl/${WHEEL_NAME}" \
25-
--build-arg CONSTRAINTS_FILE="$CONSTRAINTS_FILE" \
2625
--label "io.ray.ray-version=$RAY_VERSION" \
2726
--label "io.ray.ray-commit=$RAY_COMMIT" \
2827
-t "$DEST_IMAGE" -f Dockerfile -

ci/docker/base.gpu.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# syntax=docker/dockerfile:1.3-labs
2-
ARG BASE_IMAGE=nvidia/cuda:12.1.1-cudnn8-devel-ubuntu20.04
2+
ARG BASE_IMAGE=nvidia/cuda:12.8.1-cudnn-devel-ubuntu20.04
33
FROM $BASE_IMAGE
44

55
ARG BUILDKITE_BAZEL_CACHE_URL
@@ -8,7 +8,7 @@ ARG PYTHON=3.10
88
ENV DEBIAN_FRONTEND=noninteractive
99
ENV TZ=America/Los_Angeles
1010

11-
ENV RAY_BUILD_ENV=ubuntu20.04_cuda12.1_py$PYTHON
11+
ENV RAY_BUILD_ENV=ubuntu20.04_cuda12.8.1_py$PYTHON
1212
ENV BUILDKITE=true
1313
ENV CI=true
1414
ENV PYTHON=$PYTHON

ci/docker/base.gpu.wanda.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: "oss-ci-base_gpu-py$PYTHON"
2-
froms: ["nvidia/cuda:11.8.0-cudnn8-devel-ubuntu20.04"]
2+
froms: ["nvidia/cuda:12.8.1-cudnn-devel-ubuntu20.04"]
33
dockerfile: ci/docker/base.gpu.Dockerfile
44
srcs:
55
- .bazelrc

ci/env/install-miniforge.sh

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,12 @@ install_miniforge() {
9595
)
9696
fi
9797

98+
(
99+
set +x
100+
echo "Cleaning conda caches..."
101+
"${WORKSPACE_DIR}"/ci/suppress_output conda clean --all -q -y
102+
)
103+
98104
command -V python
99105
test -x "${CONDA_PYTHON_EXE}" # make sure conda is activated
100106
}

ci/lint/pydoclint-baseline.txt

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -192,8 +192,6 @@ python/ray/_private/services.py
192192
DOC101: Function `start_raylet`: Docstring contains fewer arguments than in function signature.
193193
DOC107: Function `start_raylet`: The option `--arg-type-hints-in-signature` is `True` but not all args in the signature have type hints
194194
DOC103: Function `start_raylet`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [cluster_id: str, socket_to_use: Optional[int]].
195-
DOC101: Function `determine_plasma_store_config`: Docstring contains fewer arguments than in function signature.
196-
DOC103: Function `determine_plasma_store_config`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [temp_dir: str].
197195
DOC101: Function `start_monitor`: Docstring contains fewer arguments than in function signature.
198196
DOC103: Function `start_monitor`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [autoscaler_v2: bool, fate_share: Optional[bool]].
199197
DOC101: Function `start_ray_client_server`: Docstring contains fewer arguments than in function signature.
@@ -867,8 +865,6 @@ python/ray/dashboard/modules/event/event_utils.py
867865
DOC201: Function `monitor_events` does not have a return section in docstring
868866
--------------------
869867
python/ray/dashboard/modules/job/cli.py
870-
DOC101: Function `submit`: Docstring contains fewer arguments than in function signature.
871-
DOC103: Function `submit`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [address: Optional[str], entrypoint: Tuple[str], entrypoint_memory: Optional[int], entrypoint_num_cpus: Optional[Union[int, float]], entrypoint_num_gpus: Optional[Union[int, float]], entrypoint_resources: Optional[str], headers: Optional[str], job_id: Optional[str], metadata_json: Optional[str], no_wait: bool, runtime_env: Optional[str], runtime_env_json: Optional[str], submission_id: Optional[str], verify: Union[bool, str], working_dir: Optional[str]].
872868
DOC101: Function `status`: Docstring contains fewer arguments than in function signature.
873869
DOC103: Function `status`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [address: Optional[str], headers: Optional[str], job_id: str, verify: Union[bool, str]].
874870
DOC101: Function `stop`: Docstring contains fewer arguments than in function signature.
@@ -896,8 +892,6 @@ python/ray/dashboard/modules/job/job_supervisor.py
896892
DOC103: Method `JobSupervisor._exec_entrypoint`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [env: dict].
897893
--------------------
898894
python/ray/dashboard/modules/job/sdk.py
899-
DOC104: Method `JobSubmissionClient.submit_job`: Arguments are the same in the docstring and the function signature, but are in a different order.
900-
DOC105: Method `JobSubmissionClient.submit_job`: Argument names match, but type hints in these args do not match: entrypoint, job_id, runtime_env, metadata, submission_id, entrypoint_num_cpus, entrypoint_num_gpus, entrypoint_memory, entrypoint_resources
901895
DOC402: Method `JobSubmissionClient.tail_job_logs` has "yield" statements, but the docstring does not have a "Yields" section
902896
DOC404: Method `JobSubmissionClient.tail_job_logs` yield type(s) in docstring not consistent with the return annotation. Return annotation exists, but docstring "yields" section does not exist or has 0 type(s).
903897
--------------------
@@ -1150,10 +1144,6 @@ python/ray/data/_internal/logical/operators/join_operator.py
11501144
DOC103: Method `Join.__init__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [aggregator_ray_remote_args: Optional[Dict[str, Any]], join_type: str, left_columns_suffix: Optional[str], left_input_op: LogicalOperator, left_key_columns: Tuple[str], num_partitions: int, partition_size_hint: Optional[int], right_columns_suffix: Optional[str], right_input_op: LogicalOperator, right_key_columns: Tuple[str]].
11511145
--------------------
11521146
python/ray/data/_internal/logical/operators/map_operator.py
1153-
DOC001: Method `__init__` Potential formatting errors in docstring. Error message: No specification for "Args": ""
1154-
DOC001: Function/method `__init__`: Potential formatting errors in docstring. Error message: No specification for "Args": "" (Note: DOC001 could trigger other unrelated violations under this function/method too. Please fix the docstring formatting first.)
1155-
DOC101: Method `AbstractUDFMap.__init__`: Docstring contains fewer arguments than in function signature.
1156-
DOC103: Method `AbstractUDFMap.__init__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [compute: Optional[ComputeStrategy], fn: UserDefinedFunction, fn_args: Optional[Iterable[Any]], fn_constructor_args: Optional[Iterable[Any]], fn_constructor_kwargs: Optional[Dict[str, Any]], fn_kwargs: Optional[Dict[str, Any]], input_op: LogicalOperator, min_rows_per_bundled_input: Optional[int], name: str, ray_remote_args: Optional[Dict[str, Any]], ray_remote_args_fn: Optional[Callable[[], Dict[str, Any]]]].
11571147
DOC101: Method `StreamingRepartition.__init__`: Docstring contains fewer arguments than in function signature.
11581148
DOC103: Method `StreamingRepartition.__init__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [input_op: LogicalOperator].
11591149
--------------------
@@ -1163,12 +1153,6 @@ python/ray/data/_internal/logical/operators/n_ary_operator.py
11631153
DOC101: Method `NAry.__init__`: Docstring contains fewer arguments than in function signature.
11641154
DOC103: Method `NAry.__init__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [*input_ops: LogicalOperator, num_outputs: Optional[int]].
11651155
--------------------
1166-
python/ray/data/_internal/logical/operators/one_to_one_operator.py
1167-
DOC001: Method `__init__` Potential formatting errors in docstring. Error message: No specification for "Args": ""
1168-
DOC001: Function/method `__init__`: Potential formatting errors in docstring. Error message: No specification for "Args": "" (Note: DOC001 could trigger other unrelated violations under this function/method too. Please fix the docstring formatting first.)
1169-
DOC101: Method `AbstractOneToOne.__init__`: Docstring contains fewer arguments than in function signature.
1170-
DOC103: Method `AbstractOneToOne.__init__`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [input_op: Optional[LogicalOperator], name: str, num_outputs: Optional[int]].
1171-
--------------------
11721156
python/ray/data/_internal/metadata_exporter.py
11731157
DOC101: Method `Topology.create_topology_metadata`: Docstring contains fewer arguments than in function signature.
11741158
DOC103: Method `Topology.create_topology_metadata`: Docstring arguments are different from function arguments. (Or could be other formatting issues: https://jsh9.github.io/pydoclint/violation_codes.html#notes-on-doc103 ). Arguments in the function signature but not in the docstring: [op_to_id: Dict['PhysicalOperator', str]].

ci/raydepsets/cli.py

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,15 @@ def __init__(
9696
check: Optional[bool] = False,
9797
build_all_configs: Optional[bool] = False,
9898
):
99+
"""Initialize the dependency set manager.
100+
101+
Args:
102+
config_path: Path to the depsets config file.
103+
workspace_dir: Path to the workspace directory.
104+
uv_cache_dir: Directory to cache uv dependencies.
105+
check: Whether to check if lock files are up to date.
106+
build_all_configs: Whether to build all configs or just the specified one.
107+
"""
99108
self.workspace = Workspace(workspace_dir)
100109
self.config = self.workspace.load_configs(config_path)
101110
self.config_name = os.path.basename(config_path)
@@ -109,6 +118,7 @@ def __init__(
109118
self.copy_to_temp_dir()
110119

111120
def get_output_paths(self) -> List[Path]:
121+
"""Get all output paths for depset nodes in topological order."""
112122
output_paths = []
113123
for node in topological_sort(self.build_graph):
114124
if self.build_graph.nodes[node]["node_type"] == "depset":
@@ -126,6 +136,7 @@ def copy_to_temp_dir(self):
126136
)
127137

128138
def get_diffs(self) -> List[str]:
139+
"""Compare current lock files with previously saved copies and return unified diffs."""
129140
diffs = []
130141
for output_path in self.output_paths:
131142
new_lock_file_fp, old_lock_file_fp = self.get_source_and_dest(output_path)
@@ -142,6 +153,7 @@ def get_diffs(self) -> List[str]:
142153
return diffs
143154

144155
def diff_lock_files(self):
156+
"""Check if lock files are up to date and raise an error if not."""
145157
diffs = self.get_diffs()
146158
if len(diffs) > 0:
147159
raise RuntimeError(
@@ -151,9 +163,11 @@ def diff_lock_files(self):
151163
click.echo("Lock files are up to date.")
152164

153165
def get_source_and_dest(self, output_path: str) -> tuple[Path, Path]:
166+
"""Get the source workspace path and temporary destination path for a lock file."""
154167
return (self.get_path(output_path), (Path(self.temp_dir) / output_path))
155168

156169
def _build(self, build_all_configs: Optional[bool] = False):
170+
"""Build the dependency graph from config depsets."""
157171
for depset in self.config.depsets:
158172
if depset.operation == "compile":
159173
self.build_graph.add_node(
@@ -201,11 +215,13 @@ def _build(self, build_all_configs: Optional[bool] = False):
201215
self.subgraph_config_nodes()
202216

203217
def subgraph_dependency_nodes(self, depset_name: str):
218+
"""Reduce the build graph to only include the specified depset and its ancestors."""
204219
dependency_nodes = networkx_ancestors(self.build_graph, depset_name)
205220
nodes = dependency_nodes | {depset_name}
206221
self.build_graph = self.build_graph.subgraph(nodes).copy()
207222

208223
def subgraph_config_nodes(self):
224+
"""Reduce the build graph to nodes matching the current config and their ancestors."""
209225
# Get all nodes that have the target config name
210226
config_nodes = [
211227
node
@@ -224,6 +240,7 @@ def subgraph_config_nodes(self):
224240
self.build_graph = self.build_graph.subgraph(nodes).copy()
225241

226242
def execute(self, single_depset_name: Optional[str] = None):
243+
"""Execute all depsets in topological order, optionally limited to a single depset."""
227244
if single_depset_name:
228245
# check if the depset exists
229246
_get_depset(self.config.depsets, single_depset_name)
@@ -240,6 +257,7 @@ def execute(self, single_depset_name: Optional[str] = None):
240257
def exec_uv_cmd(
241258
self, cmd: str, args: List[str], stdin: Optional[bytes] = None
242259
) -> str:
260+
"""Execute a uv pip command with the given arguments."""
243261
cmd = [self._uv_binary, "pip", cmd, *args]
244262
click.echo(f"Executing command: {' '.join(cmd)}")
245263
status = subprocess.run(
@@ -252,6 +270,7 @@ def exec_uv_cmd(
252270
return status.stdout.decode("utf-8")
253271

254272
def execute_pre_hook(self, pre_hook: str):
273+
"""Execute a pre-hook shell command."""
255274
status = subprocess.run(
256275
shlex.split(pre_hook),
257276
cwd=self.workspace.dir,
@@ -265,6 +284,7 @@ def execute_pre_hook(self, pre_hook: str):
265284
click.echo(f"Executed pre_hook {pre_hook} successfully")
266285

267286
def execute_depset(self, depset: Depset):
287+
"""Execute a single depset based on its operation type (compile, subset, or expand)."""
268288
if depset.operation == "compile":
269289
self.compile(
270290
constraints=depset.constraints,
@@ -389,15 +409,18 @@ def expand(
389409
)
390410

391411
def read_lock_file(self, file_path: Path) -> List[str]:
412+
"""Read and return the contents of a lock file as a list of lines."""
392413
if not file_path.exists():
393414
raise RuntimeError(f"Lock file {file_path} does not exist")
394415
with open(file_path, "r") as f:
395416
return f.readlines()
396417

397418
def get_path(self, path: str) -> Path:
419+
"""Convert a relative path to an absolute path within the workspace."""
398420
return Path(self.workspace.dir) / path
399421

400422
def check_subset_exists(self, source_depset: Depset, requirements: List[str]):
423+
"""Verify that all requirements exist in the source depset."""
401424
for req in requirements:
402425
if req not in self.get_expanded_depset_requirements(source_depset.name, []):
403426
raise RuntimeError(
@@ -424,15 +447,18 @@ def get_expanded_depset_requirements(
424447
return list(set(requirements_list))
425448

426449
def cleanup(self):
450+
"""Remove the temporary directory used for lock file comparisons."""
427451
if self.temp_dir:
428452
shutil.rmtree(self.temp_dir)
429453

430454

431455
def _get_bytes(packages: List[str]) -> bytes:
456+
"""Convert a list of package names to newline-separated UTF-8 bytes."""
432457
return ("\n".join(packages) + "\n").encode("utf-8")
433458

434459

435460
def _get_depset(depsets: List[Depset], name: str) -> Depset:
461+
"""Find and return a depset by name from a list of depsets."""
436462
for depset in depsets:
437463
if depset.name == name:
438464
return depset
@@ -452,6 +478,7 @@ def _flatten_flags(flags: List[str]) -> List[str]:
452478

453479

454480
def _override_uv_flags(flags: List[str], args: List[str]) -> List[str]:
481+
"""Override existing uv flags in args with new values from flags."""
455482
flag_names = {f.split()[0] for f in flags if f.startswith("--")}
456483
new_args = []
457484
skip_next = False
@@ -468,6 +495,7 @@ def _override_uv_flags(flags: List[str], args: List[str]) -> List[str]:
468495

469496

470497
def _uv_binary():
498+
"""Get the path to the uv binary for the current platform."""
471499
r = runfiles.Create()
472500
system = platform.system()
473501
processor = platform.processor()

0 commit comments

Comments
 (0)