Skip to content

centralize version variables into .versions #821

Open
alimx07 wants to merge 1 commit intodocker:mainfrom
alimx07:add-versions-file
Open

centralize version variables into .versions #821
alimx07 wants to merge 1 commit intodocker:mainfrom
alimx07:add-versions-file

Conversation

@alimx07
Copy link
Copy Markdown

@alimx07 alimx07 commented Apr 1, 2026

Fixes #742

  • 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 and CI workflows.

  • Add make validate-versions target to catch drift between .versions and Dockerfile ARG defaults, also runs as part of make validate-all

Copy link
Copy Markdown
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey - I've left some high level feedback:

  • 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.
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.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 \
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

critical

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.

Suggested change
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.
@alimx07 alimx07 force-pushed the add-versions-file branch from 559ac0a to 8f3b3fa Compare April 1, 2026 20:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Centralize default deps versions in a single source-of-truth file

1 participant