Skip to content

Commit 44ab210

Browse files
authored
release: RayOrch 0.1.0 (#11)
* feat: promote multigrain runtime and lazy benchmarks * refactor!: focus release on multigrain runtime * refactor!: expose a clear top-level runtime API * refactor: tighten runtime state ownership * refactor: simplify benchmarks and runtime boundaries * ci: test runtime and release artifacts * ci: support current Ray runtime env helpers * test: handle Ray py_modules upload signature * docs: revamp project readme * docs: fix scheduling diagram rendering * release: prepare RayOrch 0.1.0
1 parent 3c0c7be commit 44ab210

166 files changed

Lines changed: 18387 additions & 6099 deletions

File tree

Some content is hidden

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

‎.github/workflows/ci.yml‎

Lines changed: 219 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,219 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
pull_request:
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ci-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
env:
16+
RAY_ENABLE_UV_RUN_RUNTIME_ENV: "0"
17+
RAY_ACCEL_ENV_VAR_OVERRIDE_ON_ZERO: "0"
18+
19+
jobs:
20+
test:
21+
name: Test Python ${{ matrix.python-version }}
22+
runs-on: ubuntu-latest
23+
timeout-minutes: 20
24+
strategy:
25+
fail-fast: false
26+
matrix:
27+
python-version: ["3.11", "3.12"]
28+
29+
steps:
30+
- uses: actions/checkout@v5
31+
32+
- uses: actions/setup-python@v6
33+
with:
34+
python-version: ${{ matrix.python-version }}
35+
cache: pip
36+
cache-dependency-path: |
37+
pyproject.toml
38+
requirements.txt
39+
40+
- name: Install
41+
run: |
42+
python -m pip install --upgrade pip
43+
python -m pip install -e . pytest
44+
45+
- name: Test
46+
run: python -m pytest -q
47+
48+
package:
49+
name: Package and installed-wheel smoke test
50+
runs-on: ubuntu-latest
51+
timeout-minutes: 15
52+
53+
steps:
54+
- uses: actions/checkout@v5
55+
56+
- uses: actions/setup-python@v6
57+
with:
58+
python-version: "3.12"
59+
cache: pip
60+
cache-dependency-path: |
61+
pyproject.toml
62+
requirements.txt
63+
64+
- name: Install build tools and runtime dependencies
65+
run: |
66+
python -m pip install --upgrade pip
67+
python -m pip install -r requirements.txt build twine
68+
69+
- name: Build and check distributions
70+
run: |
71+
python -m build
72+
python -m twine check dist/*
73+
74+
- name: Check distribution contents
75+
run: |
76+
python - <<'PY'
77+
from pathlib import Path
78+
import tarfile
79+
from zipfile import ZipFile
80+
81+
cases = (
82+
"document_topology",
83+
"dual_vllm",
84+
"mineru",
85+
"sglang_vllm",
86+
"video_caption",
87+
"video_multimodal",
88+
"yolo_sam",
89+
)
90+
required = {
91+
"rayorch/benchmark/__init__.py",
92+
"rayorch/benchmark/execution.py",
93+
"rayorch/benchmark/registry.py",
94+
"rayorch/benchmark/report.py",
95+
"rayorch/benchmark/submission.py",
96+
}
97+
for case in cases:
98+
required.update(
99+
{
100+
f"rayorch/benchmarks/{case}/README.md",
101+
f"rayorch/benchmarks/{case}/benchmark.py",
102+
f"rayorch/benchmarks/{case}/env.json",
103+
f"rayorch/benchmarks/{case}/pipeline.py",
104+
f"rayorch/benchmarks/{case}/udfs.py",
105+
}
106+
)
107+
108+
wheel = next(Path("dist").glob("*.whl"))
109+
with ZipFile(wheel) as archive:
110+
wheel_names = set(archive.namelist())
111+
missing = required - wheel_names
112+
assert not missing, f"wheel is missing: {sorted(missing)}"
113+
114+
forbidden = {
115+
"rayorch/benchmark/plugin.py",
116+
"rayorch/benchmark/runtime.py",
117+
}
118+
assert not (forbidden & wheel_names)
119+
assert not any(
120+
name.startswith(("test/", "rayorch/benchmark/mineru/"))
121+
or "__pycache__" in name
122+
or name.endswith((".pyc", ".pyo"))
123+
for name in wheel_names
124+
)
125+
126+
sdist = next(Path("dist").glob("*.tar.gz"))
127+
with tarfile.open(sdist) as archive:
128+
sdist_names = {
129+
name.split("/", 1)[1]
130+
for name in archive.getnames()
131+
if "/" in name
132+
}
133+
missing = required - sdist_names
134+
assert not missing, f"sdist is missing: {sorted(missing)}"
135+
PY
136+
137+
- name: Install wheel outside the source tree
138+
run: |
139+
python -m venv --system-site-packages "$RUNNER_TEMP/rayorch-wheel"
140+
"$RUNNER_TEMP/rayorch-wheel/bin/python" -m pip install \
141+
--no-deps --force-reinstall dist/*.whl
142+
143+
- name: Verify installed API and run a Benchmark
144+
working-directory: ${{ runner.temp }}
145+
run: |
146+
"$RUNNER_TEMP/rayorch-wheel/bin/python" - <<'PY'
147+
import json
148+
import sys
149+
from importlib import resources
150+
from pathlib import Path
151+
152+
import rayorch
153+
import rayorch.benchmark as benchmark
154+
155+
assert Path(rayorch.__file__).is_relative_to(Path(sys.prefix))
156+
assert "ray" not in sys.modules
157+
assert "torch" not in sys.modules
158+
assert "vllm" not in sys.modules
159+
assert "sglang" not in sys.modules
160+
161+
class AddOne:
162+
def run(self, values):
163+
return [value + 1 for value in values]
164+
165+
class SmokePipeline(rayorch.Pipeline):
166+
def __init__(self):
167+
self.add_one = rayorch.RayModule(AddOne).ray_options(num_cpus=0)
168+
169+
def forward(self, values):
170+
return self.add_one(values)
171+
172+
result = SmokePipeline().run([1, 2, 3], input_batch_size=2)
173+
assert result.outputs == [2, 3, 4]
174+
175+
expected = {
176+
"DocumentTopologyBench",
177+
"DualVllmBench",
178+
"MinerUBench",
179+
"SglangVllmBench",
180+
"VideoCaptionTopologyBench",
181+
"VideoMultimodalTopologyBench",
182+
"YoloSamBench",
183+
}
184+
assert expected <= set(dir(benchmark))
185+
for public_name in expected:
186+
assert isinstance(getattr(benchmark, public_name), type)
187+
188+
readme = resources.files("rayorch.benchmarks.mineru").joinpath(
189+
"README.md"
190+
)
191+
assert readme.is_file()
192+
193+
output_dir = Path("rayorch-wheel-smoke")
194+
report = benchmark.VideoCaptionTopologyBench(
195+
output_dir=output_dir,
196+
video_count=2,
197+
frames_per_video=3,
198+
workers=2,
199+
batch_size=2,
200+
input_batch_size=1,
201+
max_active_input_batches=2,
202+
).run(
203+
ray_init_kwargs={
204+
"include_dashboard": False,
205+
"num_cpus": 4,
206+
"num_gpus": 0,
207+
},
208+
profile=False,
209+
run_id="installed-wheel",
210+
)
211+
212+
summary = json.loads(
213+
Path(report.artifacts["summary"]).read_text(encoding="utf-8")
214+
)
215+
assert summary["metrics"]["input_rows"] == 2
216+
assert summary["metrics"]["output_rows"] == 2
217+
assert summary["metrics"]["frames"] == 6
218+
assert len(report.outputs) == 2
219+
PY

‎.github/workflows/python-publish.yml‎

Lines changed: 39 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ jobs:
2020
runs-on: ubuntu-latest
2121

2222
steps:
23-
- uses: actions/checkout@v4
23+
- uses: actions/checkout@v5
2424

25-
- uses: actions/setup-python@v5
25+
- uses: actions/setup-python@v6
2626
with:
2727
python-version: "3.12"
2828

@@ -32,7 +32,42 @@ jobs:
3232
pip install -r requirements.txt
3333
pip install build twine
3434
python -m build --sdist --wheel
35-
35+
36+
- name: Verify release tag matches package version
37+
env:
38+
RELEASE_TAG: ${{ github.event.release.tag_name }}
39+
run: |
40+
python - <<'PY'
41+
from email.parser import Parser
42+
import os
43+
from pathlib import Path
44+
from zipfile import ZipFile
45+
46+
from rayorch.version import __version__
47+
48+
tag = os.environ["RELEASE_TAG"]
49+
expected = f"v{__version__}"
50+
if tag != expected:
51+
raise SystemExit(
52+
f"release tag {tag!r} does not match package version {expected!r}"
53+
)
54+
55+
wheel = next(Path("dist").glob("*.whl"))
56+
with ZipFile(wheel) as archive:
57+
metadata_name = next(
58+
name for name in archive.namelist() if name.endswith(".dist-info/METADATA")
59+
)
60+
metadata = Parser().parsestr(
61+
archive.read(metadata_name).decode("utf-8")
62+
)
63+
if metadata["Version"] != __version__:
64+
raise SystemExit(
65+
f"wheel version {metadata['Version']!r} does not match "
66+
f"source version {__version__!r}"
67+
)
68+
print(f"release tag, source, and wheel version match: {tag}")
69+
PY
70+
3671
- name: Verify distribution
3772
run: |
3873
twine check dist/*
@@ -72,4 +107,4 @@ jobs:
72107
- name: Publish release distributions to PyPI
73108
uses: pypa/gh-action-pypi-publish@release/v1
74109
with:
75-
packages-dir: dist/
110+
packages-dir: dist/

‎.gitignore‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@
33
**/.ipynb_checkpoints/
44
*.egg
55
*.egg-info
6+
/build/
7+
/dist/
68

79
.DS_Store
810
test/example
@@ -15,4 +17,4 @@ cache*
1517
test/**/*.json
1618
test/**/*.jpg
1719

18-
/*.json
20+
/*.json

‎MANIFEST.in‎

Lines changed: 2 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,12 @@
1-
# 明确指定源码文件
21
recursive-include rayorch *.py
32
recursive-include rayorch *.json
4-
recursive-include rayorch *.yaml
5-
recursive-include rayorch *.sh
6-
recursive-include rayorch *.txt
3+
recursive-include rayorch/benchmarks README.md
74

8-
# 包含样例文件夹下所有类型的文件
9-
# 样例文件夹路径为rayorch/exaple
10-
recursive-include rayorch/example */
11-
12-
# 包含顶层文档文件
135
include README.md
146
include requirements.txt
157
include LICENSE
168

17-
# 排除无用缓存文件
189
global-exclude *.py[cod]
1910
global-exclude __pycache__/
2011
global-exclude *.so
21-
global-exclude *.egg-info/
12+
global-exclude *.egg-info/

0 commit comments

Comments
 (0)