centralize version variables into .versions #821
Conversation
There was a problem hiding this comment.
Hey - I've left some high level feedback:
- The repeated
Load GO versionsteps across multiple workflows (and even twice inci.yml) could be deduplicated by using a small reusable script or composite action, which would reduce copy‑paste and keep the GO version loading logic in one place. - The
validate-versionstarget assumes.versionslines map directly toARG <KEY>=<value>with no quotes or inline comments; consider either documenting/enforcing this format or normalizing values (e.g., stripping quotes/comments) so the comparison is robust to small formatting differences.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- The repeated `Load GO version` steps across multiple workflows (and even twice in `ci.yml`) could be deduplicated by using a small reusable script or composite action, which would reduce copy‑paste and keep the GO version loading logic in one place.
- The `validate-versions` target assumes `.versions` lines map directly to `ARG <KEY>=<value>` with no quotes or inline comments; consider either documenting/enforcing this format or normalizing values (e.g., stripping quotes/comments) so the comparison is robust to small formatting differences.Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Code Review
Review: Centralized Version Management ### Summary This PR centralizes versioning by introducing a .versions source of truth, integrated via the Makefile and validated against the Dockerfile. ### Critical - Makefile:112: The read loop in validate-versions will skip the last line of .versions because it lacks a trailing newline; add || [ -n "$$key" ] to the loop condition. - scripts/build-vllm-metal-tarball.sh:23: Fetching VLLM_VERSION instead of VLLM_UPSTREAM_VERSION causes an unintended downgrade from 0.17.1 to 0.17.0. ### What looks good - Centralizing version variables into a single .versions file improves maintainability and reduces the risk of version drift across components.
Makefile
Outdated
|
|
||
| validate-versions: | ||
| @errors=0; \ | ||
| while IFS='=' read -r key value; do \ |
There was a problem hiding this comment.
The read command returns a non-zero exit code when it encounters EOF before a newline character. Since the .versions file does not end with a newline (as indicated in the diff), the last line (currently BASE_IMAGE) will be skipped by this loop, leaving it unvalidated. Adding || [ -n "$key" ] ensures the last line is processed even if the newline is missing.
while IFS='=' read -r key value || [ -n "$$key" ]; do \
| TARBALL="$(cd "$(dirname "$TARBALL_ARG")" && pwd)/$(basename "$TARBALL_ARG")" | ||
|
|
||
| VLLM_VERSION="0.17.1" | ||
| VLLM_VERSION=$(grep '^VLLM_VERSION=' "$(cd "$(dirname "$0")/.." && pwd)/.versions" | cut -d= -f2) |
There was a problem hiding this comment.
This script previously used version 0.17.1. By switching to the VLLM_VERSION key from .versions, it has been downgraded to 0.17.0. Based on the .versions file content and the vllm-metal-dev target in the Makefile, this should likely use VLLM_UPSTREAM_VERSION (which is 0.17.1) to maintain consistency and avoid an unintended version downgrade.
| VLLM_VERSION=$(grep '^VLLM_VERSION=' "$(cd "$(dirname "$0")/.." && pwd)/.versions" | cut -d= -f2) | |
| VLLM_VERSION=$(grep '^VLLM_UPSTREAM_VERSION=' "$(cd "$(dirname "$0")/.." && pwd)/.versions" | cut -d= -f2) |
Add a .versions file as the single source of truth for version variables (Go, vLLM, vLLM upstream, SGLang, llama-server, vllm-metal, diffusers, base image), replacing values scattered across the Makefile, Dockerfile, CI workflows, and scripts.
559ac0a to
8f3b3fa
Compare
Fixes #742
Add a
.versionsfile as the single source of truth for version variables (Go, vLLM, vLLM upstream, SGLang, llama-server, vllm-metal, diffusers, base image), replacing values scattered across the Makefile, Dockerfile and CI workflows.Add
make validate-versionstarget to catch drift between.versionsandDockerfileARG defaults, also runs as part ofmake validate-all