Official Inference Code of EAGLE-4
fix(release): index only the engine channels the release carries
Seyfal Sultanov377ad2e2f669
diff --git a/.github/workflows/publish-engines.yml b/.github/workflows/publish-engines.ymlindex f2b2bb5..edfa8fa 100644--- a/.github/workflows/publish-engines.yml+++ b/.github/workflows/publish-engines.yml@@ -33,7 +33,7 @@ jobs:with:python-version: "3.12"- uses: actions/configure-pages@983d7736d9b0ae728b81ab479565c72886d7745b # v5- - name: Download release wheels and verify both channel manifests+ - name: Download release wheels and verify every released channel manifestenv:GH_TOKEN: ${{ github.token }}RELEASE_TAG: ${{ inputs.release_tag }}diff --git a/tests/test_engine_release.py b/tests/test_engine_release.pyindex ff19ee2..3633b18 100644--- a/tests/test_engine_release.py+++ b/tests/test_engine_release.py@@ -7,8 +7,10 @@ import hashlibimport jsonimport osfrom pathlib import Path+import reimport subprocessimport sys+from urllib.parse import unquoteimport zipfileimport pytest@@ -132,6 +134,37 @@ def test_upload_verify_rerun_and_pages_without_wheel_payloads(tmp_path, release)assert ("eagle.4.rocm" in page) == (channel == "rocm")+def test_pages_publishes_only_released_channels(tmp_path, release):+ remote, _ = release+ artifacts = wheels(tmp_path, "cu130")+ assert command("upload", TAG, "cu130", *artifacts).returncode == 0+ # Neither a harness manifest nor an unknown platform's manifest is an index channel.+ (remote / "harness-SHA256SUMS").write_text(f"{'0' * 64} eagle_harness-0.1.0-py3-none-any.whl\n")+ (remote / "engine-cu999-SHA256SUMS").write_text(f"{'0' * 64} invented-0.1.0-py3-none-any.whl\n")+ site = tmp_path / "site"+ result = command("pages", TAG, site)+ assert result.returncode == 0, result.stderr+ assert sorted(p.name for p in (site / "whl").iterdir()) == ["cu130"]+ released = {p.name for p in remote.iterdir()}+ for page in site.rglob("*.html"):+ for href in re.findall(r'href="([^"]+)"', page.read_text()):+ url = href.split("#", 1)[0]+ if url.startswith("https://"):+ assert unquote(url.rsplit("/", 1)[1]) in released, (page, href)+ else:+ assert (page.parent / url).exists(), (page, href)+++def test_pages_requires_a_released_channel(tmp_path, release):+ remote, log = release+ (remote / "harness-SHA256SUMS").write_text(f"{'0' * 64} eagle_harness-0.1.0-py3-none-any.whl\n")+ result = command("pages", TAG, tmp_path / "site")+ assert result.returncode != 0+ assert "no engine channel manifest" in result.stderr+ assert not (tmp_path / "site").exists()+ assert not any(args[1] == "download" for args in calls(log))++def test_upload_conflict_preflight_has_no_write_side_effects(tmp_path, release):remote, log = releaseartifacts = wheels(tmp_path, "cu130")diff --git a/tools/engine_release.py b/tools/engine_release.pyindex 7141a9b..d6df6a4 100644--- a/tools/engine_release.py+++ b/tools/engine_release.py@@ -7,6 +7,7 @@Uploads require a complete channel's wheels. The checksum manifest is uploadedlast, so an interrupted upload cannot advertise an incomplete channel. Rerunsverify existing bytes instead of replacing assets. Nothing creates a release.+Pages indexes exactly the channels whose manifest the release carries."""import argparse@@ -21,6 +22,7 @@ import mk_indexREPOSITORY = "eagle-hq/EAGLE-4"CHANNELS = ("cu130", "rocm")+CHANNEL_LABELS = {"cu130": "CUDA 13.0", "rocm": "ROCm"}UPLOAD_CHANNELS = (*CHANNELS, "harness")REQUIRED = {"harness": {"eagle-harness"},@@ -134,13 +136,18 @@ def pages(tag: str, output: Path) -> None:validate_tag(tag)if output.exists():raise ValueError(f"output already exists: {output}; use a fresh staging directory")- release = json.loads(gh("release", "view", tag, "--json", "tagName,isDraft"))+ release = json.loads(gh("release", "view", tag, "--json", "tagName,isDraft,assets"))if release["tagName"] != tag or release["isDraft"]:raise ValueError("Pages requires an existing, published release with the exact tag")+ # A manifest is uploaded only after its whole channel verified, so its presence marks a released channel.+ published = {asset["name"] for asset in release["assets"]}+ channels = [channel for channel in CHANNELS if manifest_name(channel) in published]+ if not channels:+ raise ValueError(f"{tag} has no engine channel manifest; upload a complete channel first")with tempfile.TemporaryDirectory(prefix="engine-index-") as temporary:work = Path(temporary)site = work / "site"- for channel in CHANNELS:+ for channel in channels:assets = work / channelassets.mkdir()manifest = manifest_name(channel)@@ -158,10 +165,8 @@ def pages(tag: str, output: Path) -> None:destination = site / "whl" / channelshutil.copytree(index / "simple", destination)shutil.copyfile(assets / manifest, destination / "SHA256SUMS")- (site / "index.html").write_text(- '<!DOCTYPE html>\n<html><body><a href="whl/cu130/">CUDA 13.0</a>\n'- '<a href="whl/rocm/">ROCm</a></body></html>\n'- )+ links = "".join(f'<a href="whl/{channel}/">{CHANNEL_LABELS[channel]}</a>\n' for channel in channels)+ (site / "index.html").write_text(f"<!DOCTYPE html>\n<html><body>{links}</body></html>\n")(site / ".nojekyll").touch()shutil.copytree(site, output)