Skip to content

Commit 559ac0a

Browse files
committed
centralize version variables into .versions
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.
1 parent a2ea95c commit 559ac0a

9 files changed

Lines changed: 96 additions & 26 deletions

File tree

.github/workflows/ci.yml

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,15 @@ jobs:
1616
- name: Checkout code
1717
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1818

19+
- name: Load GO version
20+
id: versions
21+
run: |
22+
grep '^GO_VERSION=' .versions >> "$GITHUB_OUTPUT"
23+
1924
- name: Set up Go
2025
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
2126
with:
22-
go-version: 1.25.8
27+
go-version: ${{ steps.versions.outputs.GO_VERSION }}
2328
cache: true
2429

2530
- name: Install golangci-lint
@@ -42,10 +47,18 @@ jobs:
4247
- name: Verify vendor/ is not present
4348
run: stat vendor && exit 1 || exit 0
4449

50+
- name: Load GO version
51+
id: versions
52+
run: |
53+
grep '^GO_VERSION=' .versions >> "$GITHUB_OUTPUT"
54+
55+
- name: Validate .versions against Dockerfile ARGs
56+
run: make validate-versions
57+
4558
- name: Set up Go
4659
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
4760
with:
48-
go-version: 1.25.8
61+
go-version: ${{ steps.versions.outputs.GO_VERSION }}
4962
cache: true
5063

5164
- name: Check go mod tidy

.github/workflows/e2e-test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,15 @@ jobs:
2424
with:
2525
submodules: recursive
2626

27+
- name: Load GO version
28+
id: versions
29+
run: |
30+
grep '^GO_VERSION=' .versions >> "$GITHUB_OUTPUT"
31+
2732
- name: Set up Go
2833
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
2934
with:
30-
go-version: 1.25.8
35+
go-version: ${{ steps.versions.outputs.GO_VERSION }}
3136
cache: true
3237

3338
- name: Set up Docker

.github/workflows/integration-test.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,15 @@ jobs:
1515
- name: Checkout code
1616
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
1717

18+
- name: Load GO version
19+
id: versions
20+
run: |
21+
grep '^GO_VERSION=' .versions >> "$GITHUB_OUTPUT"
22+
1823
- name: Set up Go
1924
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
2025
with:
21-
go-version: 1.25.8
26+
go-version: ${{ steps.versions.outputs.GO_VERSION }}
2227
cache: true
2328

2429
- name: Set up Docker Buildx

.github/workflows/release.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -23,17 +23,14 @@ on:
2323
description: "llama-server version"
2424
required: false
2525
type: string
26-
default: "latest"
2726
vllmVersion:
2827
description: "vLLM version"
2928
required: false
3029
type: string
31-
default: "0.17.0"
3230
sglangVersion:
3331
description: "SGLang version"
3432
required: false
3533
type: string
36-
default: "0.4.0"
3734
# This can be removed once we have llama.cpp built for MUSA and CANN.
3835
buildMusaCann:
3936
description: "Build MUSA and CANN images"
@@ -204,10 +201,15 @@ jobs:
204201
- name: Checkout code
205202
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
206203

204+
- name: Load GO version
205+
id: versions
206+
run: |
207+
grep '^GO_VERSION=' .versions >> "$GITHUB_OUTPUT"
208+
207209
- name: Set up Go
208210
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
209211
with:
210-
go-version: 1.25.8
212+
go-version: ${{ steps.versions.outputs.GO_VERSION }}
211213
cache: true
212214

213215
- name: Run tests
@@ -223,9 +225,9 @@ jobs:
223225
contents: read
224226
env:
225227
RELEASE_TAG: ${{ needs.prepare.outputs.release_tag }}
226-
LLAMA_SERVER_VERSION: ${{ inputs.llamaServerVersion || 'latest' }}
228+
LLAMA_SERVER_VERSION: ${{ inputs.llamaServerVersion }}
227229
VLLM_VERSION: ${{ inputs.vllmVersion }}
228-
SGLANG_VERSION: ${{ inputs.sglangVersion || '0.4.0' }}
230+
SGLANG_VERSION: ${{ inputs.sglangVersion }}
229231
BUILD_MUSA_CANN: ${{ inputs.buildMusaCann || 'false' }}
230232
steps:
231233
- name: Checkout repo
@@ -263,6 +265,18 @@ jobs:
263265
echo "docker/model-runner:$RELEASE_TAG-cann" >> "$GITHUB_OUTPUT"
264266
echo "docker/model-runner:latest-cann" >> "$GITHUB_OUTPUT"
265267
echo 'EOF' >> "$GITHUB_OUTPUT"
268+
269+
- name: Load versions
270+
shell: bash
271+
run: |
272+
VERSIONS_LLAMA=$(grep '^LLAMA_SERVER_VERSION=' .versions | cut -d= -f2-)
273+
VERSIONS_VLLM=$(grep '^VLLM_VERSION=' .versions | cut -d= -f2-)
274+
VERSIONS_SGLANG=$(grep '^SGLANG_VERSION=' .versions | cut -d= -f2-)
275+
276+
# Use input value if set, otherwise fallback to .versions
277+
echo "LLAMA_SERVER_VERSION=${LLAMA_SERVER_VERSION:-$VERSIONS_LLAMA}" >> "$GITHUB_ENV"
278+
echo "VLLM_VERSION=${VLLM_VERSION:-$VERSIONS_VLLM}" >> "$GITHUB_ENV"
279+
echo "SGLANG_VERSION=${SGLANG_VERSION:-$VERSIONS_SGLANG}" >> "$GITHUB_ENV"
266280
267281
- name: Log in to DockerHub
268282
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
@@ -535,11 +549,16 @@ jobs:
535549
token: ${{ secrets.CLI_RELEASE_PAT }}
536550
fetch-depth: 0
537551

552+
- name: Load GO version
553+
id: versions
554+
run: |
555+
grep '^GO_VERSION=' .versions >> "$GITHUB_OUTPUT"
556+
538557
- name: Set up Go
539558
if: steps.check-docs.outputs.changed == 'true'
540559
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
541560
with:
542-
go-version: 1.25.8
561+
go-version: ${{ steps.versions.outputs.GO_VERSION }}
543562
cache: true
544563

545564
- name: Vendor model-runner CLI docs

.versions

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
GO_VERSION=1.25.8
2+
VLLM_VERSION=0.17.0
3+
VLLM_UPSTREAM_VERSION=0.17.1
4+
VLLM_METAL_RELEASE=v0.1.0-20260320-122309
5+
DIFFUSERS_RELEASE=v0.1.0-20260216-000000
6+
SGLANG_VERSION=0.5.6
7+
LLAMA_SERVER_VERSION=latest
8+
BASE_IMAGE=ubuntu:26.04

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# syntax=docker/dockerfile:1
22

3-
ARG GO_VERSION=1.25
3+
ARG GO_VERSION=1.25.8
44
ARG LLAMA_SERVER_VERSION=latest
55
ARG LLAMA_SERVER_VARIANT=cpu
66
ARG LLAMA_BINARY_PATH=/com.docker.llama-server.native.linux.${LLAMA_SERVER_VARIANT}.${TARGETARCH}

Makefile

Lines changed: 24 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,9 @@
11
# Project variables
2+
include .versions
3+
24
APP_NAME := model-runner
3-
GO_VERSION := 1.25.8
4-
LLAMA_SERVER_VERSION := latest
55
LLAMA_SERVER_VARIANT := cpu
6-
BASE_IMAGE := ubuntu:26.04
76
VLLM_BASE_IMAGE := nvidia/cuda:13.0.2-runtime-ubuntu24.04
8-
VLLM_VERSION ?= 0.17.0
97
DOCKER_IMAGE := docker/model-runner:latest
108
DOCKER_IMAGE_VLLM := docker/model-runner:latest-vllm-cuda
119
DOCKER_IMAGE_SGLANG := docker/model-runner:latest-sglang
@@ -15,16 +13,18 @@ LLAMA_ARGS ?=
1513
DOCKER_BUILD_ARGS := \
1614
--load \
1715
--platform linux/$(shell docker version --format '{{.Server.Arch}}') \
16+
--build-arg GO_VERSION=$(GO_VERSION) \
1817
--build-arg LLAMA_SERVER_VERSION=$(LLAMA_SERVER_VERSION) \
1918
--build-arg LLAMA_SERVER_VARIANT=$(LLAMA_SERVER_VARIANT) \
19+
--build-arg SGLANG_VERSION=$(SGLANG_VERSION) \
2020
--build-arg BASE_IMAGE=$(BASE_IMAGE) \
2121
--build-arg VLLM_VERSION='$(VLLM_VERSION)' \
2222
--target $(DOCKER_TARGET) \
2323
-t $(DOCKER_IMAGE)
2424

2525
# Phony targets grouped by category
2626
.PHONY: build build-cli build-dmr build-llamacpp install-cli run clean test integration-tests e2e
27-
.PHONY: validate validate-all lint help
27+
.PHONY: validate validate-versions validate-all lint help
2828
.PHONY: docker-build docker-build-multiplatform docker-run docker-run-impl
2929
.PHONY: docker-build-vllm docker-run-vllm docker-build-sglang docker-run-sglang
3030
.PHONY: test-docker-ce-installation
@@ -107,6 +107,21 @@ validate:
107107
find . -type f -name "*.sh" | grep -v "pkg/go-containerregistry\|llamacpp/native/vendor" | xargs shellcheck
108108
@echo "✓ Shellcheck validation passed!"
109109

110+
validate-versions:
111+
@errors=0; \
112+
while IFS='=' read -r key value; do \
113+
dockerfile_val=$$(grep -m1 "^ARG $${key}=" Dockerfile | cut -d= -f2-); \
114+
[ -z "$$dockerfile_val" ] && continue; \
115+
if [ "$$value" != "$$dockerfile_val" ]; then \
116+
echo "MISMATCH: $$key — .versions=$$value Dockerfile=$$dockerfile_val"; \
117+
errors=$$((errors + 1)); \
118+
else \
119+
echo "OK: $$key=$$value"; \
120+
fi; \
121+
done < .versions; \
122+
[ $$errors -eq 0 ] || exit 1
123+
@echo "✓ .versions is in sync with Dockerfile ARGs"
124+
110125
lint:
111126
@echo "Running golangci-lint..."
112127
golangci-lint run ./...
@@ -129,6 +144,9 @@ validate-all:
129144
@echo "==> Running shellcheck validation..."
130145
@$(MAKE) validate
131146
@echo ""
147+
@echo "==> Validating .versions against Dockerfile ARGs..."
148+
@$(MAKE) validate-versions
149+
@echo ""
132150
@echo "==> All validations passed! ✅"
133151

134152
# Build Docker image
@@ -184,7 +202,6 @@ docker-run-impl:
184202

185203
# vllm-metal (macOS ARM64 only)
186204
# The tarball is self-contained: includes a standalone Python 3.12 + all packages.
187-
VLLM_METAL_RELEASE ?= v0.1.0-20260320-122309
188205
VLLM_METAL_INSTALL_DIR := $(HOME)/.docker/model-runner/vllm-metal
189206
VLLM_METAL_TARBALL := vllm-metal-macos-arm64-$(VLLM_METAL_RELEASE).tar.gz
190207

@@ -237,7 +254,7 @@ vllm-metal-dev:
237254
rm -rf "$(VLLM_METAL_INSTALL_DIR)"; \
238255
$$PYTHON_BIN -m venv "$(VLLM_METAL_INSTALL_DIR)"; \
239256
. "$(VLLM_METAL_INSTALL_DIR)/bin/activate" && \
240-
VLLM_UPSTREAM_VERSION="0.17.1" && \
257+
VLLM_UPSTREAM_VERSION=$(VLLM_UPSTREAM_VERSION) && \
241258
WORK_DIR=$$(mktemp -d) && \
242259
curl -fsSL -o "$$WORK_DIR/vllm.tar.gz" "https://github.com/vllm-project/vllm/releases/download/v$$VLLM_UPSTREAM_VERSION/vllm-$$VLLM_UPSTREAM_VERSION.tar.gz" && \
243260
tar -xzf "$$WORK_DIR/vllm.tar.gz" -C "$$WORK_DIR" && \
@@ -257,7 +274,6 @@ vllm-metal-clean:
257274

258275
# diffusers (macOS ARM64 and Linux)
259276
# The tarball is self-contained: includes a standalone Python 3.12 + all packages.
260-
DIFFUSERS_RELEASE ?= v0.1.0-20260216-000000
261277
DIFFUSERS_INSTALL_DIR := $(HOME)/.docker/model-runner/diffusers
262278
DIFFUSERS_OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
263279
DIFFUSERS_ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/')

README.md

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -157,6 +157,7 @@ MODEL_RUNNER_HOST=http://localhost:13434 ./model-cli list
157157
## Using the Makefile
158158

159159
This project includes a Makefile to simplify common development tasks. Docker targets require Docker Desktop >= 4.41.0.
160+
160161
Run `make help` for a full list, but the key targets are:
161162

162163
- `build` - Build the Go application
@@ -194,6 +195,8 @@ This will:
194195
- Start the service on port 8080 (or the specified port)
195196
- All models downloaded will be stored in the host's `models` directory and will persist between container runs
196197
198+
> NOTE: The [`.versions`](.versions) file is the single source of truth for all version variables (Go, vLLM, SGLang, llama-server, etc.).
199+
197200
### llama.cpp integration
198201
199202
The Docker image includes the llama.cpp server binary from the `docker/docker-model-backend-llamacpp` image. You can specify the version of the image to use by setting the `LLAMA_SERVER_VERSION` variable. Additionally, you can configure the target OS, architecture, and acceleration type:
@@ -228,7 +231,7 @@ The Docker image also supports vLLM as an alternative inference backend.
228231
To build a Docker image with vLLM support:
229232
230233
```sh
231-
# Build with default settings (vLLM 0.12.0)
234+
# Build with default settings (vLLM 0.17.0)
232235
make docker-build DOCKER_TARGET=final-vllm BASE_IMAGE=nvidia/cuda:13.0.2-runtime-ubuntu24.04 LLAMA_SERVER_VARIANT=cuda
233236
234237
# Build for specific architecture
@@ -237,15 +240,15 @@ docker buildx build \
237240
--target final-vllm \
238241
--build-arg BASE_IMAGE=nvidia/cuda:13.0.2-runtime-ubuntu24.04 \
239242
--build-arg LLAMA_SERVER_VARIANT=cuda \
240-
--build-arg VLLM_VERSION=0.12.0 \
243+
--build-arg VLLM_VERSION=0.17.0 \
241244
-t docker/model-runner:vllm .
242245
```
243246
244247
#### Build Arguments
245248
246249
The vLLM variant supports the following build arguments:
247250
248-
- **VLLM_VERSION**: The vLLM version to install (default: `0.12.0`)
251+
- **VLLM_VERSION**: The vLLM version to install (default: `0.17.0`)
249252
- **VLLM_CUDA_VERSION**: The CUDA version suffix for the wheel (default: `cu130`)
250253
- **VLLM_PYTHON_TAG**: The Python compatibility tag (default: `cp38-abi3`, compatible with Python 3.8+)
251254
@@ -274,8 +277,8 @@ To update to a new vLLM version:
274277
```sh
275278
docker buildx build \
276279
--target final-vllm \
277-
--build-arg VLLM_VERSION=0.11.1 \
278-
-t docker/model-runner:vllm-0.11.1 .
280+
--build-arg VLLM_VERSION=0.17.0 \
281+
-t docker/model-runner:vllm-0.17.0 .
279282
```
280283
281284
The vLLM wheels are sourced from the official vLLM GitHub Releases at `https://github.com/vllm-project/vllm/releases`, which provides prebuilt wheels for each release version.

scripts/build-vllm-metal-tarball.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ WORK_DIR=$(mktemp -d)
2020
# Convert tarball path to absolute before we cd elsewhere
2121
TARBALL="$(cd "$(dirname "$TARBALL_ARG")" && pwd)/$(basename "$TARBALL_ARG")"
2222

23-
VLLM_VERSION="0.17.1"
23+
VLLM_VERSION=$(grep '^VLLM_VERSION=' "$(cd "$(dirname "$0")/.." && pwd)/.versions" | cut -d= -f2)
24+
2425
# Extract wheel version from release tag (e.g., v0.1.0-20260126-121650 -> 0.1.0)
2526
VLLM_METAL_WHEEL_VERSION=$(echo "$VLLM_METAL_RELEASE" | sed 's/^v//' | cut -d'-' -f1)
2627
VLLM_METAL_WHEEL_URL="https://github.com/vllm-project/vllm-metal/releases/download/${VLLM_METAL_RELEASE}/vllm_metal-${VLLM_METAL_WHEEL_VERSION}-cp312-cp312-macosx_11_0_arm64.whl"

0 commit comments

Comments
 (0)