Skip to content

Commit 8743df1

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 8743df1

10 files changed

Lines changed: 106 additions & 26 deletions

File tree

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Load Go version
2+
description: Read GO_VERSION from .versions and expose it as an output
3+
4+
outputs:
5+
go-version:
6+
value: ${{ steps.load.outputs.GO_VERSION }}
7+
8+
runs:
9+
using: composite
10+
steps:
11+
- name: Load GO version
12+
id: load
13+
shell: bash
14+
run: grep '^GO_VERSION=' .versions | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$//' >> "$GITHUB_OUTPUT"

.github/workflows/ci.yml

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

19+
- name: Load GO version
20+
id: versions
21+
uses: ./.github/actions/load-go-version
22+
1923
- name: Set up Go
2024
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
2125
with:
22-
go-version: 1.25.8
26+
go-version: ${{ steps.versions.outputs.go-version }}
2327
cache: true
2428

2529
- name: Install golangci-lint
@@ -42,10 +46,17 @@ jobs:
4246
- name: Verify vendor/ is not present
4347
run: stat vendor && exit 1 || exit 0
4448

49+
- name: Load GO version
50+
id: versions
51+
uses: ./.github/actions/load-go-version
52+
53+
- name: Validate .versions against Dockerfile ARGs
54+
run: make validate-versions
55+
4556
- name: Set up Go
4657
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
4758
with:
48-
go-version: 1.25.8
59+
go-version: ${{ steps.versions.outputs.go-version }}
4960
cache: true
5061

5162
- name: Check go mod tidy

.github/workflows/e2e-test.yml

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

27+
- name: Load GO version
28+
id: versions
29+
uses: ./.github/actions/load-go-version
30+
2731
- name: Set up Go
2832
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
2933
with:
30-
go-version: 1.25.8
34+
go-version: ${{ steps.versions.outputs.go-version }}
3135
cache: true
3236

3337
- name: Set up Docker

.github/workflows/integration-test.yml

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

18+
- name: Load GO version
19+
id: versions
20+
uses: ./.github/actions/load-go-version
21+
1822
- name: Set up Go
1923
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
2024
with:
21-
go-version: 1.25.8
25+
go-version: ${{ steps.versions.outputs.go-version }}
2226
cache: true
2327

2428
- name: Set up Docker Buildx

.github/workflows/release.yml

Lines changed: 24 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,14 @@ jobs:
204201
- name: Checkout code
205202
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd
206203

204+
- name: Load GO version
205+
id: versions
206+
uses: ./.github/actions/load-go-version
207+
207208
- name: Set up Go
208209
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
209210
with:
210-
go-version: 1.25.8
211+
go-version: ${{ steps.versions.outputs.go-version }}
211212
cache: true
212213

213214
- name: Run tests
@@ -223,9 +224,9 @@ jobs:
223224
contents: read
224225
env:
225226
RELEASE_TAG: ${{ needs.prepare.outputs.release_tag }}
226-
LLAMA_SERVER_VERSION: ${{ inputs.llamaServerVersion || 'latest' }}
227+
LLAMA_SERVER_VERSION: ${{ inputs.llamaServerVersion }}
227228
VLLM_VERSION: ${{ inputs.vllmVersion }}
228-
SGLANG_VERSION: ${{ inputs.sglangVersion || '0.4.0' }}
229+
SGLANG_VERSION: ${{ inputs.sglangVersion }}
229230
BUILD_MUSA_CANN: ${{ inputs.buildMusaCann || 'false' }}
230231
steps:
231232
- name: Checkout repo
@@ -263,6 +264,18 @@ jobs:
263264
echo "docker/model-runner:$RELEASE_TAG-cann" >> "$GITHUB_OUTPUT"
264265
echo "docker/model-runner:latest-cann" >> "$GITHUB_OUTPUT"
265266
echo 'EOF' >> "$GITHUB_OUTPUT"
267+
268+
- name: Load versions
269+
shell: bash
270+
run: |
271+
VERSIONS_LLAMA=$(grep '^LLAMA_SERVER_VERSION=' .versions | cut -d= -f2- | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$//')
272+
VERSIONS_VLLM=$(grep '^VLLM_VERSION=' .versions | cut -d= -f2- | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$//')
273+
VERSIONS_SGLANG=$(grep '^SGLANG_VERSION=' .versions | cut -d= -f2- | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$//')
274+
275+
# Use input value if set, otherwise fallback to .versions
276+
echo "LLAMA_SERVER_VERSION=${LLAMA_SERVER_VERSION:-$VERSIONS_LLAMA}" >> "$GITHUB_ENV"
277+
echo "VLLM_VERSION=${VLLM_VERSION:-$VERSIONS_VLLM}" >> "$GITHUB_ENV"
278+
echo "SGLANG_VERSION=${SGLANG_VERSION:-$VERSIONS_SGLANG}" >> "$GITHUB_ENV"
266279
267280
- name: Log in to DockerHub
268281
uses: docker/login-action@b45d80f862d83dbcd57f89517bcf500b2ab88fb2
@@ -535,11 +548,15 @@ jobs:
535548
token: ${{ secrets.CLI_RELEASE_PAT }}
536549
fetch-depth: 0
537550

551+
- name: Load GO version
552+
id: versions
553+
uses: ./.github/actions/load-go-version
554+
538555
- name: Set up Go
539556
if: steps.check-docs.outputs.changed == 'true'
540557
uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c
541558
with:
542-
go-version: 1.25.8
559+
go-version: ${{ steps.versions.outputs.go-version }}
543560
cache: true
544561

545562
- 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: 26 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,23 @@ 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 || [ -n "$$key" ]; do \
113+
case "$$key" in ''|\#*) continue ;; esac; \
114+
value=$$(echo "$$value" | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$$//'); \
115+
dockerfile_val=$$(grep -m1 "^ARG $${key}=" Dockerfile | cut -d= -f2- | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$$//'); \
116+
[ -z "$$dockerfile_val" ] && continue; \
117+
if [ "$$value" != "$$dockerfile_val" ]; then \
118+
echo "MISMATCH: $$key — .versions=$$value Dockerfile=$$dockerfile_val"; \
119+
errors=$$((errors + 1)); \
120+
else \
121+
echo "OK: $$key=$$value"; \
122+
fi; \
123+
done < .versions; \
124+
[ $$errors -eq 0 ] || exit 1
125+
@echo "✓ .versions is in sync with Dockerfile ARGs"
126+
110127
lint:
111128
@echo "Running golangci-lint..."
112129
golangci-lint run ./...
@@ -129,6 +146,9 @@ validate-all:
129146
@echo "==> Running shellcheck validation..."
130147
@$(MAKE) validate
131148
@echo ""
149+
@echo "==> Validating .versions against Dockerfile ARGs..."
150+
@$(MAKE) validate-versions
151+
@echo ""
132152
@echo "==> All validations passed! ✅"
133153

134154
# Build Docker image
@@ -184,7 +204,6 @@ docker-run-impl:
184204

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

@@ -237,7 +256,7 @@ vllm-metal-dev:
237256
rm -rf "$(VLLM_METAL_INSTALL_DIR)"; \
238257
$$PYTHON_BIN -m venv "$(VLLM_METAL_INSTALL_DIR)"; \
239258
. "$(VLLM_METAL_INSTALL_DIR)/bin/activate" && \
240-
VLLM_UPSTREAM_VERSION="0.17.1" && \
259+
VLLM_UPSTREAM_VERSION=$(VLLM_UPSTREAM_VERSION) && \
241260
WORK_DIR=$$(mktemp -d) && \
242261
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" && \
243262
tar -xzf "$$WORK_DIR/vllm.tar.gz" -C "$$WORK_DIR" && \
@@ -257,7 +276,6 @@ vllm-metal-clean:
257276

258277
# diffusers (macOS ARM64 and Linux)
259278
# The tarball is self-contained: includes a standalone Python 3.12 + all packages.
260-
DIFFUSERS_RELEASE ?= v0.1.0-20260216-000000
261279
DIFFUSERS_INSTALL_DIR := $(HOME)/.docker/model-runner/diffusers
262280
DIFFUSERS_OS := $(shell uname -s | tr '[:upper:]' '[:lower:]')
263281
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_UPSTREAM_VERSION=' "$(cd "$(dirname "$0")/.." && pwd)/.versions" | cut -d= -f2 | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$//')
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)