refactor: extract shared logic from nightly build scripts - #4
Open
maobaolong wants to merge 1 commit into
Open
maobaolong wants to merge 1 commit into
maobaolong wants to merge 1 commit into
Conversation
Both build_and_publish_vllm_cpu_nightly.sh (Linux/docker) and build_and_publish_vllm_cpu_nightly_macos.sh had ~270 lines of duplicated logic: log/die helpers, nightly-version computation, vLLM source patching (pyproject.toml rename, requirements/cpu.txt +cpu stripping, fla.cpp constexpr fix), torch requirement resolution, and wheel torch-version verification. Extract this into scripts/common/: - helpers.sh: log(), die(), compute_nightly_version(), check_wheel_size() - patch_vllm_source.sh: the three source patches - resolve_torch_requirement.py: pick the applicable torch== pin - verify_wheel_torch.py: verify built wheel declares the torch it was built against The Linux script mounts common/ read-only into the build container so the same code runs on both sides of the docker boundary; the macOS script sources/invokes it directly since it runs natively on the host. No behavior change intended; version-bump math, patch regexes, and wheel verification logic are unchanged, just de-duplicated.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Both
build_and_publish_vllm_cpu_nightly.sh(Linux/docker) andbuild_and_publish_vllm_cpu_nightly_macos.sh(macOS) shared ~270 lines of near-identical logic. This PR extracts it intoscripts/common/:helpers.sh:log()/die(),compute_nightly_version(),check_wheel_size()patch_vllm_source.sh: patchespyproject.tomlname, strips+cpufromrequirements/cpu.txt, fixes thefla.cppconstexpr issueresolve_torch_requirement.py: picks the platform-applicabletorch==pin fromrequirements/cpu.txtverify_wheel_torch.py: verifies a built wheel declares the torch version it was actually compiled againstHow
scripts/common/read-only into the build container (-v .../common:/opt/vllm-cpu-nightly-common:ro) and sources/invokes the shared files insidedocker exec.Testing
bash -non all shell scripts,python -m py_compileon the python scripts.No behavior change intended.