-
Notifications
You must be signed in to change notification settings - Fork 125
centralize version variables into .versions #821
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| name: Load Go version | ||
| description: Read GO_VERSION from .versions and expose it as an output | ||
|
|
||
| outputs: | ||
| go-version: | ||
| value: ${{ steps.load.outputs.GO_VERSION }} | ||
|
|
||
| runs: | ||
| using: composite | ||
| steps: | ||
| - name: Load GO version | ||
| id: load | ||
| shell: bash | ||
| run: grep '^GO_VERSION=' .versions | sed 's/[[:space:]]*#.*//;s/[[:space:]]*$//' >> "$GITHUB_OUTPUT" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,8 @@ | ||
| GO_VERSION=1.25.8 | ||
| VLLM_VERSION=0.17.0 | ||
| VLLM_UPSTREAM_VERSION=0.17.1 | ||
| VLLM_METAL_RELEASE=v0.1.0-20260320-122309 | ||
| DIFFUSERS_RELEASE=v0.1.0-20260216-000000 | ||
| SGLANG_VERSION=0.5.6 | ||
| LLAMA_SERVER_VERSION=latest | ||
| BASE_IMAGE=ubuntu:26.04 | ||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,6 +1,6 @@ | ||||||
| # syntax=docker/dockerfile:1 | ||||||
|
|
||||||
| ARG GO_VERSION=1.25 | ||||||
| ARG GO_VERSION=1.25.8 | ||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Let's not use patch versions, see docker/compose#13417 (comment). |
||||||
| ARG LLAMA_SERVER_VERSION=latest | ||||||
| ARG LLAMA_SERVER_VARIANT=cpu | ||||||
| ARG LLAMA_BINARY_PATH=/com.docker.llama-server.native.linux.${LLAMA_SERVER_VARIANT}.${TARGETARCH} | ||||||
|
|
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,11 +1,9 @@ | ||
| # Project variables | ||
| include .versions | ||
|
|
||
| APP_NAME := model-runner | ||
| GO_VERSION := 1.25.8 | ||
| LLAMA_SERVER_VERSION := latest | ||
| LLAMA_SERVER_VARIANT := cpu | ||
| BASE_IMAGE := ubuntu:26.04 | ||
| VLLM_BASE_IMAGE := nvidia/cuda:13.0.2-runtime-ubuntu24.04 | ||
| VLLM_VERSION ?= 0.17.0 | ||
| DOCKER_IMAGE := docker/model-runner:latest | ||
| DOCKER_IMAGE_VLLM := docker/model-runner:latest-vllm-cuda | ||
| DOCKER_IMAGE_SGLANG := docker/model-runner:latest-sglang | ||
|
|
@@ -15,16 +13,18 @@ LLAMA_ARGS ?= | |
| DOCKER_BUILD_ARGS := \ | ||
| --load \ | ||
| --platform linux/$(shell docker version --format '{{.Server.Arch}}') \ | ||
| --build-arg GO_VERSION=$(GO_VERSION) \ | ||
| --build-arg LLAMA_SERVER_VERSION=$(LLAMA_SERVER_VERSION) \ | ||
| --build-arg LLAMA_SERVER_VARIANT=$(LLAMA_SERVER_VARIANT) \ | ||
| --build-arg SGLANG_VERSION=$(SGLANG_VERSION) \ | ||
| --build-arg BASE_IMAGE=$(BASE_IMAGE) \ | ||
| --build-arg VLLM_VERSION='$(VLLM_VERSION)' \ | ||
| --target $(DOCKER_TARGET) \ | ||
| -t $(DOCKER_IMAGE) | ||
|
|
||
| # Phony targets grouped by category | ||
| .PHONY: build build-cli build-dmr build-llamacpp install-cli run clean test integration-tests e2e | ||
| .PHONY: validate validate-all lint help | ||
| .PHONY: validate validate-versions validate-all lint help | ||
| .PHONY: docker-build docker-build-multiplatform docker-run docker-run-impl | ||
| .PHONY: docker-build-vllm docker-run-vllm docker-build-sglang docker-run-sglang | ||
| .PHONY: test-docker-ce-installation | ||
|
|
@@ -107,6 +107,23 @@ validate: | |
| find . -type f -name "*.sh" | grep -v "pkg/go-containerregistry\|llamacpp/native/vendor" | xargs shellcheck | ||
| @echo "✓ Shellcheck validation passed!" | ||
|
|
||
| validate-versions: | ||
| @errors=0; \ | ||
| 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:]]*$$//'); \ | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it expected for the script to skip keys where no ARG X= exists in Dockerfile?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, the current behavior check that every key in
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is it worth having the values provided in the Dockerfile as well and not rely on the Makefile to always supply it?
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. yes , I think it is worth and you already mentioned that here in this comment :
|
||
| [ -z "$$dockerfile_val" ] && continue; \ | ||
| if [ "$$value" != "$$dockerfile_val" ]; then \ | ||
| echo "MISMATCH: $$key — .versions=$$value Dockerfile=$$dockerfile_val"; \ | ||
| errors=$$((errors + 1)); \ | ||
| else \ | ||
| echo "OK: $$key=$$value"; \ | ||
| fi; \ | ||
| done < .versions; \ | ||
| [ $$errors -eq 0 ] || exit 1 | ||
| @echo "✓ .versions is in sync with Dockerfile ARGs" | ||
|
|
||
| lint: | ||
| @echo "Running golangci-lint..." | ||
| golangci-lint run ./... | ||
|
|
@@ -129,6 +146,9 @@ validate-all: | |
| @echo "==> Running shellcheck validation..." | ||
| @$(MAKE) validate | ||
| @echo "" | ||
| @echo "==> Validating .versions against Dockerfile ARGs..." | ||
| @$(MAKE) validate-versions | ||
| @echo "" | ||
| @echo "==> All validations passed! ✅" | ||
|
|
||
| # Build Docker image | ||
|
|
@@ -184,7 +204,6 @@ docker-run-impl: | |
|
|
||
| # vllm-metal (macOS ARM64 only) | ||
| # The tarball is self-contained: includes a standalone Python 3.12 + all packages. | ||
| VLLM_METAL_RELEASE ?= v0.1.0-20260320-122309 | ||
| VLLM_METAL_INSTALL_DIR := $(HOME)/.docker/model-runner/vllm-metal | ||
| VLLM_METAL_TARBALL := vllm-metal-macos-arm64-$(VLLM_METAL_RELEASE).tar.gz | ||
|
|
||
|
|
@@ -237,7 +256,7 @@ vllm-metal-dev: | |
| rm -rf "$(VLLM_METAL_INSTALL_DIR)"; \ | ||
| $$PYTHON_BIN -m venv "$(VLLM_METAL_INSTALL_DIR)"; \ | ||
| . "$(VLLM_METAL_INSTALL_DIR)/bin/activate" && \ | ||
| VLLM_UPSTREAM_VERSION="0.17.1" && \ | ||
| VLLM_UPSTREAM_VERSION=$(VLLM_UPSTREAM_VERSION) && \ | ||
| WORK_DIR=$$(mktemp -d) && \ | ||
| 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" && \ | ||
| tar -xzf "$$WORK_DIR/vllm.tar.gz" -C "$$WORK_DIR" && \ | ||
|
|
@@ -257,7 +276,6 @@ vllm-metal-clean: | |
|
|
||
| # diffusers (macOS ARM64 and Linux) | ||
| # The tarball is self-contained: includes a standalone Python 3.12 + all packages. | ||
| DIFFUSERS_RELEASE ?= v0.1.0-20260216-000000 | ||
| DIFFUSERS_INSTALL_DIR := $(HOME)/.docker/model-runner/diffusers | ||
| DIFFUSERS_OS := $(shell uname -s | tr '[:upper:]' '[:lower:]') | ||
| DIFFUSERS_ARCH := $(shell uname -m | sed 's/x86_64/amd64/' | sed 's/aarch64/arm64/') | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.