centralize version variables into .versions #821
centralize version variables into .versions #821alimx07 wants to merge 3 commits intodocker:mainfrom
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.
scripts/build-vllm-metal-tarball.sh
Outdated
| 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) |
559ac0a to
8f3b3fa
Compare
ilopezluna
left a comment
There was a problem hiding this comment.
Thank you very much for your contribution 🙏 could you please address gemini's comment? Seems to be right about the accidental downgrade
Just to be sure, |
Yeah, it's confusing.
Exactly. Maybe we should unify both and just use only one env var |
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.
8f3b3fa to
8743df1
Compare
| while IFS='=' read -r key value || [ -n "$$key" ]; do \ | ||
| case "$$key" in ''|\#*) continue ;; esac; \ | ||
| value=$$(echo "$$value" | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$$//'); \ | ||
| dockerfile_val=$$(grep -m1 "^ARG $${key}=" Dockerfile | cut -d= -f2- | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$$//'); \ |
There was a problem hiding this comment.
Is it expected for the script to skip keys where no ARG X= exists in Dockerfile?
There was a problem hiding this comment.
Yes, the current behavior check that every key in .versions and also appears as an ARG in the Dockerfile has the same value, while keys that only live in .versions (e.g. VLLM_METAL_RELEASE) are silently skipped.
There was a problem hiding this comment.
Is it worth having the values provided in the Dockerfile as well and not rely on the Makefile to always supply it?
ARG BASE_IMAGE
There was a problem hiding this comment.
yes , I think it is worth and you already mentioned that here in this comment :
One concern: Dockerfile ARG defaults can't be removed entirely. The Dockerfile needs to work standalone (docker build . without Make), for example in the inference-engine repo's CI which builds the image directly. Removing ARG defaults would break that. Instead, keep the ARG defaults in the Dockerfile but always pass --build-arg from Make/CI so the .versions values take precedence. The Dockerfile defaults become the fallback, not the source of truth.
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request centralizes version management by introducing a .versions file as the single source of truth for project dependencies, including Go, vLLM, and SGLang. The changes refactor the Makefile, Dockerfile, and supporting scripts to dynamically load these versions and include a new validate-versions target to ensure consistency across the codebase. I have no feedback to provide.
Dockerfile
Outdated
| # syntax=docker/dockerfile:1 | ||
|
|
||
| ARG GO_VERSION=1.25 | ||
| ARG GO_VERSION=1.25.8 |
There was a problem hiding this comment.
| ARG GO_VERSION=1.25.8 | |
| ARG GO_VERSION=1.25 |
Let's not use patch versions, see docker/compose#13417 (comment).
Closes #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