Pull requests / #399
#399 fix(setup): drop a refused engine archive instead of reusing it
closed · @alphastorm · 0 コメント · GitHub で見る
Setup & installServer & APIModels & quantsWindows
本文
Fixes #397. When `get_prebuilt` refused a downloaded engine archive (older than `MIN_ENGINE`, or without code for the GPU), it kept `engine/<asset>` and its `.done` mark. `download()` trusts the mark, so every later run unpacked the same refused archive again instead of downloading. On the update path, "run this again in a few minutes to update it" could not work until the archive was deleted by hand. **Change** - `setup.py` (`get_prebuilt`): the archive and its `.done` mark are deleted in a `finally` right after unpacking, so a refused or unreadable archive is not kept. The success path already deleted both; those two lines move into the `finally`. **Behavior changes** - While a release's assets are still uploading, each update run downloads the latest release's archive again (107 MB for `strata-windows-x64.zip` at 0.1.31) before refusing it, instead of reusing the refused copy. - An archive refused for the GPU (setup compiles instead) no longer stays in `engine/`. - An archive that fails to unpack is deleted too, so the next run downloads it again instead of failing on the same file. **Tests** (`python -m unittest tools.test_setup_pins`, no network) - `Engine.test_an_archive_refused_as_too_old_is_not_reused` and `Engine.test_an_archive_refused_for_the_gpu_is_not_reused` run `get_prebuilt` with the real `download()` over a `--prebuilt` folder that first holds a refused archive and then the right one. Both fail on `9259cad` (the second run returns `None`) and pass with the change. - Every Python test module (`serve/test_*.py`, `tools/test_*.py`, 17 modules) gives the same result as on `9259cad` apart from the two new tests: 219 tests, 7 skipped, with `STRATA_GGUF_PY` set for `tools.test_iq_pack`. This was on Python 3.13.15, macOS arm64. ruff and pyright report nothing new in the changed files. **Also checked** - The update path over a local HTTP server standing in for GitHub (`PREBUILT_URL` and `PREBUILT_TAG_URL` patched, real `download()`), with an installed 0.1.30 engine and at first only a 0.1.30 archive under `latest/`. On `9259cad`, after the 0.1.31 archive is published, the next two runs each send one `HEAD`, print "Strata engine already downloaded" and refuse the 0.1.30 archive again. With the change, the next run downloads and installs 0.1.31, and the run after that keeps it without a request. - An archive that is not a zip: both versions raise `BadZipFile`; on `9259cad` the archive and its `.done` stay, with the change both are gone. Not run: Windows, a GPU, or a real release download. This change was part of #324, which 0.1.31 superseded.
関連リンク
インストール・モデル・リリースへの站内リンク。