升级与回滚(Upgrade and Rollback)
本手册覆盖了在生产环境中,如何对 vLLM Semantic Router 的各个发布面(release surface)进行升级、版本固定(pin)与回滚。
发布渠道(Release Channels)
| 渠道 | Tag 模式 | 更新频率 | 适用场景 |
|---|---|---|---|
| 版本化 | v0.3.0 / 0.3.0 | 仅打 tag 的正式发布 | 生产环境 — 不可变,推荐 |
| 夜间构建 | nightly-20260115 | 每日 02:00 UTC | 预发布测试 |
| Latest | latest | 每次 push 到 main + 正式发布 | 仅用于开发 |
建议
生产环境务必使用 版本化 tag。它是不可变的:同一个版本 tag 的 digest 永远不会变化。你可以在 GitHub Releases 查看最新发布版本。
前置条件
helm≥ 3.14(用于 Helm OCI 操作)- 已为目标集群配置
kubectl pip≥ 22(用于 Python CLI)docker或podman(用于直接镜像操作)
1. 查看当前版本
Helm release
helm list -n vllm-semantic-router-system
helm history semantic-router -n vllm-semantic-router-system
CHART 列显示 chart 版本(例如 semantic-router-0.2.0),APP VERSION 显示该 chart 部署的镜像 tag。
运行中的容器镜像
# Get the image tag currently used by the extproc deployment
kubectl get deployment -n vllm-semantic-router-system \
-o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.template.spec.containers[0].image}{"\n"}{end}'
Python CLI
vllm-sr --version
pip show vllm-sr
2. 升级
2a. Helm chart 升级
生产环境升级务必指定具体版本,切勿依赖 latest。
# Pull the chart metadata first (optional but useful to verify it exists)
helm show chart oci://ghcr.io/vllm-project/charts/semantic-router --version 0.3.0
# Upgrade to a specific version
# --reset-then-reuse-values (Helm ≥ 3.14) resets to the new chart's defaults
# first, then re-applies your previous overrides on top. This is safer than
# --reuse-values alone, which breaks if the new chart adds new required values.
helm upgrade semantic-router \
oci://ghcr.io/vllm-project/charts/semantic-router \
--version 0.3.0 \
--namespace vllm-semantic-router-system \
--reset-then-reuse-values \
--wait \
--timeout 10m
跨版本升级请使用
--reset-then-reuse-values,而不是 --reuse-values--reuse-values 只会合并旧版本存储的 values,并跳过新 chart 的默认值;当新 chart 引入新的必填字段时,这会导致模板渲染错误。--reset-then-reuse-values(Helm ≥ 3.14)会先重置为新版本默认值,再把你的覆盖项叠加上去——总是安全。
如果你使用 Helm < 3.14,请改用 -f your-values.yaml 显式提供配置。
升级后验证:
helm status semantic-router -n vllm-semantic-router-system
kubectl rollout status deployment/semantic-router -n vllm-semantic-router-system
2b. Docker 镜像升级(非 Helm 部署)
在 GitHub Releases 找到最新版本后:
# Pull by version tag (substitute podman for docker if using podman)
docker pull ghcr.io/vllm-project/semantic-router/extproc:v0.3.0
docker pull ghcr.io/vllm-project/semantic-router/vllm-sr:v0.3.0
docker pull ghcr.io/vllm-project/semantic-router/anthropic-shim:v0.3.0
# Get the immutable digest for maximum pinning stability
DIGEST=$(docker inspect --format='{{index .RepoDigests 0}}' \
ghcr.io/vllm-project/semantic-router/extproc:v0.3.0)
echo "Use digest: ${DIGEST}"
对于 Kubernetes manifests,建议固定到 digest,而不是 tag:
image: ghcr.io/vllm-project/semantic-router/extproc@sha256:<digest>
一次完整版本发布通常会包含这些镜像:
| 镜像 | 典型责任方 |
|---|---|
ghcr.io/vllm-project/semantic-router/extproc:v0.3.0 | Router ExtProc 运行时 |
ghcr.io/vllm-project/semantic-router/extproc-rocm:v0.3.0 | ROCm Router ExtProc 运行时 |
ghcr.io/vllm-project/semantic-router/vllm-sr:v0.3.0 | 本地/运行时 CLI 镜像 |
ghcr.io/vllm-project/semantic-router/vllm-sr-rocm:v0.3.0 | ROCm 本地/运行时 CLI 镜像 |
ghcr.io/vllm-project/semantic-router/anthropic-shim:v0.3.0 | Anthropic 兼容 API shim 镜像 |
ghcr.io/vllm-project/semantic-router/dashboard:v0.3.0 | Dashboard 后端/前端镜像 |
ghcr.io/vllm-project/semantic-router/llm-katan:v0.3.0 | Fleet simulation 服务镜像 |
ghcr.io/vllm-project/semantic-router/operator:v0.3.0 | Kubernetes operator 镜像 |
ghcr.io/vllm-project/semantic-router/operator-bundle:v0.3.0 | Operator bundle 镜像 |
2c. Python CLI 升级
pip install --upgrade vllm-sr==0.3.0
vllm-sr --version # verify
升级到最新稳定版:
pip install --upgrade vllm-sr