forked from kubernetes-sigs/gateway-api-inference-extension
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrelease-quickstart.sh
executable file
·74 lines (59 loc) · 3.42 KB
/
release-quickstart.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
set -euo pipefail
# -----------------------------------------------------------------------------
# Environment variables (defaults)
# -----------------------------------------------------------------------------
# MAJOR and MINOR are required (defaults provided here if not already set)
MAJOR="${MAJOR:-0}"
MINOR="${MINOR:-1}"
# If RC is defined (non-empty) then include the rc suffix; otherwise omit it.
if [[ -z "${RC-}" ]]; then
RELEASE_TAG="v${MAJOR}.${MINOR}.0"
else
RELEASE_TAG="v${MAJOR}.${MINOR}.0-rc.${RC}"
fi
# vLLM image version (default to 0.7.1 if not defined)
VLLM="${VLLM:-0.7.1}"
echo "Using release tag: ${RELEASE_TAG}"
echo "Using vLLM image version: ${VLLM}"
# -----------------------------------------------------------------------------
# Update pkg/README.md
# -----------------------------------------------------------------------------
README="pkg/README.md"
echo "Updating ${README} ..."
# Replace URLs that refer to a tag (whether via refs/tags or releases/download)
# This regex matches any version in the form v<MAJOR>.<MINOR>.0-rc[.]?<number>
sed -i.bak -E "s|(refs/tags/)v[0-9]+\.[0-9]+\.0-rc\.?[0-9]+|\1${RELEASE_TAG}|g" "$README"
sed -i.bak -E "s|(releases/download/)v[0-9]+\.[0-9]+\.0-rc\.?[0-9]+|\1${RELEASE_TAG}|g" "$README"
# Replace the CRD installation line: change "kubectl apply -k" to "kubectl apply -f" with the proper URL
sed -i.bak "s|kubectl apply -k https://github.com/kubernetes-sigs/gateway-api-inference-extension/config/crd|kubectl apply -f https://github.com/kubernetes-sigs/gateway-api-inference-extension/releases/download/${RELEASE_TAG}/manifests.yaml|g" "$README"
# -----------------------------------------------------------------------------
# Update pkg/manifests/ext_proc.yaml
# -----------------------------------------------------------------------------
EXT_PROC="pkg/manifests/ext_proc.yaml"
echo "Updating ${EXT_PROC} ..."
# Update any image reference for the EPP container.
# For images from registry.k8s.io:
sed -i.bak -E "s|(registry\.k8s\.io/gateway-api-inference-extension/epp:)[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$EXT_PROC"
# In case there is still any reference from us-central1-docker.pkg.dev:
sed -i.bak -E "s|(us-central1-docker\.pkg\.dev/k8s-staging-images/gateway-api-inference-extension/epp:)[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$EXT_PROC"
# -----------------------------------------------------------------------------
# Update pkg/manifests/vllm/deployment.yaml
# -----------------------------------------------------------------------------
VLLM_DEPLOY="pkg/manifests/vllm/deployment.yaml"
echo "Updating ${VLLM_DEPLOY} ..."
# Update the vLLM image version
sed -i.bak -E "s|(vllm/vllm-openai:)[^\"[:space:]]+|\1${VLLM}|g" "$VLLM_DEPLOY"
# Also change the imagePullPolicy from Always to IfNotPresent on lines containing the vLLM image.
sed -i.bak "/vllm\/vllm-openai/ s/Always/IfNotPresent/g" "$VLLM_DEPLOY"
# -----------------------------------------------------------------------------
# Stage the changes
# -----------------------------------------------------------------------------
echo "Staging $README $EXT_PROC $VLLM_DEPLOY files..."
git add $README $EXT_PROC $VLLM_DEPLOY
# -----------------------------------------------------------------------------
# Cleanup backup files and finish
# -----------------------------------------------------------------------------
echo "Cleaning up temporary backup files..."
find . -name "*.bak" -delete
echo "Release quickstart update complete."