Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@ resolver = "2"

[workspace.dependencies]
# Internal workspace crates
openai-protocol = { version = "1.1.0", path = "protocols" }
openai-protocol = { version = "1.2.0", path = "protocols" }
reasoning-parser = { version = "1.2.0", path = "reasoning_parser" }
tool-parser = { version = "1.1.0", path = "tool_parser" }
wfaas = { version = "1.0.1", path = "workflow" }
llm-tokenizer = { version = "1.1.0", path = "tokenizer" }
smg-auth = { version = "1.1.0", path = "auth" }
smg-mcp = { version = "2.0.0", path = "mcp" }
kv-index = { version = "1.0.0", path = "kv_index" }
tool-parser = { version = "1.1.1", path = "tool_parser" }
wfaas = { version = "1.0.2", path = "workflow" }
llm-tokenizer = { version = "1.2.0", path = "tokenizer" }
smg-auth = { version = "1.1.1", path = "auth" }
smg-mcp = { version = "2.1.0", path = "mcp" }
kv-index = { version = "1.0.1", path = "kv_index" }
smg-data-connector = { version = "2.0.0", path = "data_connector", package = "data-connector" }
llm-multimodal = { version = "1.1.0", path = "multimodal" }
smg-wasm = { version = "1.0.0", path = "wasm", package = "smg-wasm" }
smg-mesh = { version = "1.1.0", path = "mesh", package = "smg-mesh" }
smg-grpc-client = { version = "1.1.0", path = "grpc_client" }
llm-multimodal = { version = "1.2.0", path = "multimodal" }
smg-wasm = { version = "1.0.1", path = "wasm", package = "smg-wasm" }
smg-mesh = { version = "1.1.1", path = "mesh", package = "smg-mesh" }
smg-grpc-client = { version = "1.2.0", path = "grpc_client" }

# Shared dependencies
anyhow = "1.0"
Expand Down
12 changes: 1 addition & 11 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,7 @@ VERSION_FILES := model_gateway/Cargo.toml \
bindings/golang/Cargo.toml \
bindings/python/Cargo.toml \
bindings/python/pyproject.toml \
bindings/python/src/smg/version.py \
grpc_client/python/pyproject.toml \
grpc_client/python/smg_grpc_proto/__init__.py
bindings/python/src/smg/version.py

show-version: ## Show current version across all files
@echo "Current versions:"
Expand All @@ -150,8 +148,6 @@ show-version: ## Show current version across all files
@echo " bindings/python/Cargo.toml: $$(grep -m1 '^version = ' bindings/python/Cargo.toml | sed 's/version = "\(.*\)"/\1/')"
@echo " bindings/python/pyproject.toml: $$(grep -m1 '^version = ' bindings/python/pyproject.toml | sed 's/version = "\(.*\)"/\1/')"
@echo " bindings/python/.../version.py: $$(grep '__version__' bindings/python/src/smg/version.py | sed 's/__version__ = "\(.*\)"/\1/')"
@echo " grpc_client/python/pyproject.toml: $$(grep -m1 '^version = ' grpc_client/python/pyproject.toml | sed 's/version = "\(.*\)"/\1/')"
@echo " grpc_client/python/.../__init__.py: $$(grep '__version__' grpc_client/python/smg_grpc_proto/__init__.py | sed 's/__version__ = "\(.*\)"/\1/')"

bump-version: ## Bump version across all files (usage: make bump-version VERSION=0.3.3)
@if [ -z "$(VERSION)" ]; then \
Expand All @@ -173,18 +169,12 @@ bump-version: ## Bump version across all files (usage: make bump-version VERSION
@sed -i.bak 's/^version = ".*"/version = "$(VERSION)"/' bindings/python/pyproject.toml && rm -f bindings/python/pyproject.toml.bak
@# Update version.py
@sed -i.bak 's/__version__ = ".*"/__version__ = "$(VERSION)"/' bindings/python/src/smg/version.py && rm -f bindings/python/src/smg/version.py.bak
@# Update grpc_client/python/pyproject.toml
@sed -i.bak 's/^version = ".*"/version = "$(VERSION)"/' grpc_client/python/pyproject.toml && rm -f grpc_client/python/pyproject.toml.bak
@# Update grpc_client/python/smg_grpc_proto/__init__.py
@sed -i.bak 's/__version__ = ".*"/__version__ = "$(VERSION)"/' grpc_client/python/smg_grpc_proto/__init__.py && rm -f grpc_client/python/smg_grpc_proto/__init__.py.bak
@echo "Version updated to $(VERSION) in all files:"
@echo " - model_gateway/Cargo.toml"
@echo " - bindings/golang/Cargo.toml"
@echo " - bindings/python/Cargo.toml"
@echo " - bindings/python/pyproject.toml"
@echo " - bindings/python/src/smg/version.py"
@echo " - grpc_client/python/pyproject.toml"
@echo " - grpc_client/python/smg_grpc_proto/__init__.py"
@echo ""
@echo "Verify with: make show-version"

Expand Down
2 changes: 1 addition & 1 deletion auth/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smg-auth"
version = "1.1.0"
version = "1.1.1"
edition = "2021"
description = "Authentication and authorization for control plane APIs"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion bindings/golang/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smg-golang"
version = "0.4.0"
version = "1.1.0"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smg-python"
version = "1.0.1"
version = "1.1.0"
edition = "2021"

[lib]
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ build-backend = "maturin"

[project]
name = "smg"
version = "1.0.1"
version = "1.1.0"
description = "High-performance Rust-based inference gateway for large-scale LLM deployments"
authors = [
{name = "Simo Lin", email = "linsimo.mark@gmail.com"},
Expand Down
2 changes: 1 addition & 1 deletion bindings/python/src/smg/version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.4.0"
__version__ = "1.1.0"
2 changes: 1 addition & 1 deletion grpc_client/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smg-grpc-client"
version = "1.1.0"
version = "1.2.0"
edition = "2021"
description = "gRPC clients for SGLang and vLLM backends"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion grpc_client/python/smg_grpc_proto/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""SMG gRPC Proto - Protocol definitions for SGLang, vLLM, and TRT-LLM."""

__version__ = "0.3.3"
__version__ = "0.4.0"

# Re-export generated modules for convenient access
# These imports will work after the package is built (stubs generated at build time)
Expand Down
2 changes: 1 addition & 1 deletion kv_index/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "kv-index"
version = "1.0.0"
version = "1.0.1"
edition = "2021"
description = "Radix tree implementations for prefix matching and cache-aware routing"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion mcp/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smg-mcp"
version = "2.0.0"
version = "2.1.0"
edition = "2021"
description = "Model Context Protocol (MCP) client implementation"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion mesh/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smg-mesh"
version = "1.1.0"
version = "1.1.1"
edition = "2021"
description = "Mesh gossip protocol and distributed state synchronization for Shepherd Model Gateway"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion model_gateway/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "smg"
version = "1.0.1"
version = "1.1.0"
edition = "2021"
description = "High-performance model-routing gateway for large-scale LLM deployments"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion multimodal/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "llm-multimodal"
version = "1.1.0"
version = "1.2.0"
edition = "2021"
description = "Multimodal processing for vision and other modalities"
license = "Apache-2.0"
Expand Down
2 changes: 1 addition & 1 deletion protocols/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "openai-protocol"
version = "1.1.0"
version = "1.2.0"
edition = "2021"
description = "OpenAI-compatible API protocol definitions and types"
license = "Apache-2.0"
Expand Down
147 changes: 84 additions & 63 deletions scripts/check_release_versions.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#!/bin/bash
# Pre-release version check for SMG workspace crates and PyPI proto package.
# Pre-release version check for SMG workspace crates and Python packages.
#
# For each workspace crate, verifies:
# 1. Whether there are code changes since the latest git tag
# 2. Whether the crate version was bumped in its own Cargo.toml
# 3. Whether the workspace root Cargo.toml reflects the new version
#
# For the smg-grpc-proto PyPI package, verifies:
# 4. Whether proto files changed since the latest git tag
# 5. Whether the PyPI version was bumped in __init__.py
# For each Python package, verifies:
# 1. Whether there are code changes since the latest git tag
# 2. Whether the package __version__ was bumped
#
# Detects bump level from conventional commits:
# - feat!: or BREAKING CHANGE → major
# - feat: → minor
# - fix:, refactor:, perf:, etc. → patch
#
# After the check, offers to auto-bump any unbumped crates.
# After the check, offers to auto-bump any unbumped crates/packages.
#
# Usage: ./check_release_versions.sh [tag]
# If no tag is given, the latest tag is used.
Expand Down Expand Up @@ -74,6 +74,15 @@ CRATES=(
"smg|model_gateway|-"
)

# ---------------------------------------------------------------------------
# Python package registry (versioned independently from Rust crates)
# Format: "package_name|directory|version_file"
# version_file is relative to REPO_ROOT.
# ---------------------------------------------------------------------------
PYTHON_PACKAGES=(
"smg-grpc-proto|grpc_client/python|grpc_client/python/smg_grpc_proto/__init__.py"
Comment thread
slin1237 marked this conversation as resolved.
)

# ---------------------------------------------------------------------------
# Resolve tag
# ---------------------------------------------------------------------------
Expand Down Expand Up @@ -217,6 +226,32 @@ set_crate_version() {
fi
}

# Extract __version__ from a Python file
get_python_version() {
local file="$1"
grep '__version__' "$file" | sed 's/.*"\(.*\)".*/\1/'
}

# Extract __version__ from a Python file at a specific git ref
get_python_version_at_ref() {
local file="$1"
local ref="$2"
local content
content=$(git show "$ref:$file" 2>/dev/null) || return 0
echo "$content" | grep '__version__' | sed 's/.*"\(.*\)".*/\1/'
}
Comment thread
slin1237 marked this conversation as resolved.

# Update __version__ in a Python file
set_python_version() {
local file="$1"
local new_version="$2"
sed_inplace "s/__version__ = \".*\"/__version__ = \"${new_version}\"/" "$file"
if ! grep -q "__version__ = \"${new_version}\"" "$file"; then
echo -e " ${RED}FAILED to update $file${NC}" >&2
return 1
fi
}

# Update workspace dep version in root Cargo.toml
set_workspace_dep_version() {
local dep_key="$1"
Expand All @@ -243,6 +278,8 @@ clean=0
NEEDS_BUMP=()
# Collect crates with workspace Cargo.toml mismatch: "name|dep_key|crate_version|ws_version|path"
NEEDS_WS_SYNC=()
# Collect Python packages that need bumping: "name|path|version_file|current_version|bump_level"
NEEDS_PY_BUMP=()

for entry in "${CRATES[@]}"; do
IFS='|' read -r name path dep_key <<< "$entry"
Expand Down Expand Up @@ -295,65 +332,48 @@ for entry in "${CRATES[@]}"; do
done

# ---------------------------------------------------------------------------
# Phase 1b: Check gRPC proto / PyPI package version
# Phase 1b: Check all Python packages
# ---------------------------------------------------------------------------
PROTO_DIR="grpc_client/proto"
PYPI_VERSION_FILE="grpc_client/python/smg_grpc_proto/__init__.py"
PYPI_NEEDS_BUMP=""

# Extract __version__ from __init__.py
get_pypi_version() {
local file="$1"
grep -m1 '__version__' "$file" | sed 's/.*"\(.*\)".*/\1/'
}
py_changed=0
py_clean=0

# Extract __version__ at a specific git ref
get_pypi_version_at_ref() {
local file="$1"
local ref="$2"
local content
content=$(git show "$ref:$file" 2>/dev/null) || return 0
echo "$content" | grep -m1 '__version__' | sed 's/.*"\(.*\)".*/\1/'
}
for entry in "${PYTHON_PACKAGES[@]}"; do
IFS='|' read -r name path version_file <<< "$entry"

# Update __version__ in __init__.py
set_pypi_version() {
local file="$1"
local new_version="$2"
sed_inplace "s/__version__ = \".*\"/__version__ = \"${new_version}\"/" "$file"
if ! grep -q "__version__ = \"${new_version}\"" "$file"; then
echo -e " ${RED}FAILED to update $file${NC}" >&2
return 1
# 1. Check for code changes since tag (exclude the version file itself)
diff_count=$(git diff --name-only "$TAG"..HEAD -- "$path/" | grep -cv "$(basename "$version_file")$" || true)
Comment thread
slin1237 marked this conversation as resolved.
if [[ "$diff_count" -eq 0 ]]; then
py_clean=$((py_clean + 1))
continue
fi
Comment thread
slin1237 marked this conversation as resolved.
}

echo ""
echo -e "${BOLD}Checking PyPI proto package:${NC}"
py_changed=$((py_changed + 1))
current_version=$(get_python_version "$version_file")
tag_version=$(get_python_version_at_ref "$version_file" "$TAG")

proto_diff_count=$(git diff --name-only "$TAG"..HEAD -- "$PROTO_DIR/" | wc -l | tr -d ' ')
if [[ "$proto_diff_count" -eq 0 ]]; then
echo -e " ${GREEN}✓${NC} ${BOLD}smg-grpc-proto${NC} ($PROTO_DIR/) — no proto changes"
else
pypi_current=$(get_pypi_version "$PYPI_VERSION_FILE")
pypi_tag=$(get_pypi_version_at_ref "$PYPI_VERSION_FILE" "$TAG")

if [[ -z "$pypi_tag" ]]; then
echo -e " ${GREEN}✓${NC} ${BOLD}smg-grpc-proto${NC} ($PROTO_DIR/) — new package (v$pypi_current), $proto_diff_count proto file(s) changed"
elif [[ "$pypi_current" == "$pypi_tag" ]]; then
level=$(detect_bump_level "$PROTO_DIR")
echo -e " ${YELLOW}!${NC} ${BOLD}smg-grpc-proto${NC} ($PROTO_DIR/) — $proto_diff_count proto file(s) changed but PyPI version not bumped (v$pypi_current) [$(bump_label "$level")]"
PYPI_NEEDS_BUMP="$pypi_current|$level"
# Handle package not existing at the tag (new package)
if [[ -z "$tag_version" ]]; then
echo -e " ${GREEN}✓${NC} ${BOLD}$name${NC} ($path/) — new package (v$current_version), $diff_count file(s) changed"
continue
fi

# 2. Check if version was bumped
if [[ "$current_version" == "$tag_version" ]]; then
level=$(detect_bump_level "$path")
echo -e " ${YELLOW}!${NC} ${BOLD}$name${NC} ($path/) — $diff_count file(s) changed but version not bumped (v$current_version) [$(bump_label "$level")]"
NEEDS_PY_BUMP+=("$name|$path|$version_file|$current_version|$level")
issues=$((issues + 1))
else
echo -e " ${GREEN}✓${NC} ${BOLD}smg-grpc-proto${NC} ($PROTO_DIR/) — v$pypi_tag → v$pypi_current ($proto_diff_count proto file(s) changed)"
continue
fi
fi

echo -e " ${GREEN}✓${NC} ${BOLD}$name${NC} ($path/) — v$tag_version → v$current_version ($diff_count file(s) changed)"
done

# ---------------------------------------------------------------------------
# Summary
# ---------------------------------------------------------------------------
echo ""
echo -e "${BOLD}Summary:${NC} $changed crate(s) with changes, $clean unchanged"
echo -e "${BOLD}Summary:${NC} $changed crate(s) with changes, $clean unchanged; $py_changed Python package(s) with changes, $py_clean unchanged"

if [[ "$issues" -eq 0 ]]; then
echo -e "${GREEN}${BOLD}All versions consistent.${NC}"
Expand All @@ -365,7 +385,7 @@ echo -e "${RED}${BOLD}$issues issue(s) found.${NC}"
# ---------------------------------------------------------------------------
# Phase 2: Offer to fix
# ---------------------------------------------------------------------------
total_fixes=$(( ${#NEEDS_BUMP[@]} + ${#NEEDS_WS_SYNC[@]} + (${#PYPI_NEEDS_BUMP} > 0 ? 1 : 0) ))
total_fixes=$(( ${#NEEDS_BUMP[@]} + ${#NEEDS_WS_SYNC[@]} + ${#NEEDS_PY_BUMP[@]} ))
if [[ "$total_fixes" -eq 0 ]]; then
exit 1
fi
Expand All @@ -389,11 +409,11 @@ if [[ ${#NEEDS_WS_SYNC[@]} -gt 0 ]]; then
done
fi

if [[ -n "$PYPI_NEEDS_BUMP" ]]; then
IFS='|' read -r pypi_ver pypi_level <<< "$PYPI_NEEDS_BUMP"
pypi_new=$(bump_version "$pypi_ver" "$pypi_level")
echo -e " $(bump_label "$pypi_level") smg-grpc-proto v$pypi_ver → v$pypi_new ($PYPI_VERSION_FILE)"
fi
for entry in "${NEEDS_PY_BUMP[@]}"; do
IFS='|' read -r name path version_file current_version level <<< "$entry"
new_version=$(bump_version "$current_version" "$level")
echo -e " $(bump_label "$level") $name v$current_version → v$new_version ($version_file)"
done

echo ""
read -rp "Apply fixes? [y/N] " answer
Expand Down Expand Up @@ -441,15 +461,16 @@ if [[ ${#NEEDS_WS_SYNC[@]} -gt 0 ]]; then
done
fi

if [[ -n "$PYPI_NEEDS_BUMP" ]]; then
IFS='|' read -r pypi_ver pypi_level <<< "$PYPI_NEEDS_BUMP"
pypi_new=$(bump_version "$pypi_ver" "$pypi_level")
if set_pypi_version "$PYPI_VERSION_FILE" "$pypi_new"; then
echo -e " ${GREEN}✓${NC} $PYPI_VERSION_FILE → v$pypi_new"
for entry in "${NEEDS_PY_BUMP[@]}"; do
IFS='|' read -r name path version_file current_version level <<< "$entry"
new_version=$(bump_version "$current_version" "$level")

if set_python_version "$version_file" "$new_version"; then
echo -e " ${GREEN}✓${NC} $version_file → v$new_version"
else
fix_failed=$((fix_failed + 1))
fi
fi
done

echo ""
if [[ "$fix_failed" -gt 0 ]]; then
Expand Down
Loading
Loading