Skip to content

Commit 0189c33

Browse files
committed
merge with main
2 parents 66a2b31 + 25fee61 commit 0189c33

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+3041
-216
lines changed

Dockerfile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,9 @@ COPY pkg/epp ./pkg/epp
2222
COPY internal ./internal
2323
COPY apix ./apix
2424
COPY api ./api
25+
COPY version ./version
2526
WORKDIR /src/cmd/epp
26-
RUN go build -ldflags="-X sigs.k8s.io/gateway-api-inference-extension/pkg/epp/metrics.CommitSHA=${COMMIT_SHA} -X sigs.k8s.io/gateway-api-inference-extension/pkg/epp/metrics.BuildRef=${BUILD_REF}" -o /epp
27+
RUN go build -ldflags="-X sigs.k8s.io/gateway-api-inference-extension/version.CommitSHA=${COMMIT_SHA} -X sigs.k8s.io/gateway-api-inference-extension/version.BuildRef=${BUILD_REF}" -o /epp
2728

2829
## Multistage deploy
2930
FROM ${BASE_IMAGE}

Makefile

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -95,12 +95,8 @@ help: ## Display this help.
9595

9696
##@ Development
9797

98-
.PHONY: manifests
99-
manifests: controller-gen ## Generate WebhookConfiguration, ClusterRole and CustomResourceDefinition objects.
100-
$(CONTROLLER_GEN) rbac:roleName=manager-role crd webhook paths="./..." output:crd:artifacts:config=config/crd/bases
101-
10298
.PHONY: generate
103-
generate: controller-gen code-generator manifests ## Generate code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
99+
generate: controller-gen code-generator ## Generate WebhookConfiguration, ClusterRole, CustomResourceDefinition objects, code containing DeepCopy, DeepCopyInto, and DeepCopyObject method implementations.
104100
$(CONTROLLER_GEN) object:headerFile="hack/boilerplate/boilerplate.generatego.txt" paths="./..."
105101
./hack/update-codegen.sh
106102

@@ -132,7 +128,7 @@ vet: ## Run go vet against code.
132128
go vet ./...
133129

134130
.PHONY: test
135-
test: manifests generate fmt vet envtest image-build ## Run tests.
131+
test: generate fmt vet envtest image-build verify-crds ## Run tests.
136132
CGO_ENABLED=1 KUBEBUILDER_ASSETS="$(shell $(ENVTEST) use $(ENVTEST_K8S_VERSION) --bin-dir $(LOCALBIN) -p path)" go test $$(go list ./... | grep -v /e2e | grep -v /conformance) -race -coverprofile cover.out
137133

138134
.PHONY: test-unit
@@ -160,9 +156,13 @@ ci-lint: golangci-lint
160156
$(GOLANGCI_LINT) run --timeout 15m0s
161157

162158
.PHONY: verify
163-
verify: vet fmt-verify manifests generate ci-lint verify-all
159+
verify: vet fmt-verify generate ci-lint verify-all
164160
git --no-pager diff --exit-code config api client-go
165161

162+
.PHONY: verify-crds
163+
verify-crds: kubectl-validate
164+
hack/verify-manifests.sh
165+
166166
# Run static analysis.
167167
.PHONY: verify-all
168168
verify-all:
@@ -307,11 +307,11 @@ ifndef ignore-not-found
307307
endif
308308

309309
.PHONY: install
310-
install: manifests kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
310+
install: generate kustomize ## Install CRDs into the K8s cluster specified in ~/.kube/config.
311311
$(KUSTOMIZE) build config/crd | $(KUBECTL) apply -f -
312312

313313
.PHONY: uninstall
314-
uninstall: manifests kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
314+
uninstall: generate kustomize ## Uninstall CRDs from the K8s cluster specified in ~/.kube/config. Call with ignore-not-found=true to ignore resource not found errors during deletion.
315315
$(KUSTOMIZE) build config/crd | $(KUBECTL) delete --ignore-not-found=$(ignore-not-found) -f -
316316

317317
##@ Helm
@@ -354,13 +354,15 @@ ENVTEST ?= $(LOCALBIN)/setup-envtest
354354
GOLANGCI_LINT = $(LOCALBIN)/golangci-lint
355355
HELM = $(PROJECT_DIR)/bin/helm
356356
YQ = $(PROJECT_DIR)/bin/yq
357+
KUBECTL_VALIDATE = $(PROJECT_DIR)/bin/kubectl-validate
357358

358359
## Tool Versions
359360
KUSTOMIZE_VERSION ?= v5.4.3
360361
CONTROLLER_TOOLS_VERSION ?= v0.16.1
361362
ENVTEST_VERSION ?= release-0.19
362363
GOLANGCI_LINT_VERSION ?= v1.62.2
363364
HELM_VERSION ?= v3.17.1
365+
KUBECTL_VALIDATE_VERSION ?= v0.0.4
364366

365367
.PHONY: kustomize
366368
kustomize: $(KUSTOMIZE) ## Download kustomize locally if necessary.
@@ -390,6 +392,11 @@ yq: ## Download yq locally if necessary.
390392
helm: ## Download helm locally if necessary.
391393
GOBIN=$(PROJECT_DIR)/bin GO111MODULE=on go install helm.sh/helm/v3/cmd/helm@$(HELM_VERSION)
392394

395+
.PHONY: kubectl-validate
396+
kubectl-validate: $(KUBECTL_VALIDATE) ## Download kubectl-validate locally if necessary.
397+
$(KUBECTL_VALIDATE): $(LOCALBIN)
398+
$(call go-install-tool,$(KUBECTL_VALIDATE),sigs.k8s.io/kubectl-validate,$(KUBECTL_VALIDATE_VERSION))
399+
393400
# go-install-tool will 'go install' any package with custom target and name of binary, if it doesn't exist
394401
# $1 - target path with name of binary
395402
# $2 - package url which can be installed

RELEASE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,4 +7,4 @@ The Kubernetes Template Project is released on an as-needed basis. The process i
77
1. All [OWNERS](OWNERS) must LGTM this release
88
1. An OWNER runs `git tag -s $VERSION` and inserts the changelog and pushes the tag with `git push $VERSION`
99
1. The release issue is closed
10-
1. An announcement email is sent to `[email protected]` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released`
10+
1. An announcement email is sent to `[email protected]` with the subject `[ANNOUNCE] kubernetes-template-project $VERSION is released`

cmd/epp/runner/runner.go

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import (
4848
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/scheduling"
4949
runserver "sigs.k8s.io/gateway-api-inference-extension/pkg/epp/server"
5050
"sigs.k8s.io/gateway-api-inference-extension/pkg/epp/util/logging"
51+
"sigs.k8s.io/gateway-api-inference-extension/version"
5152
)
5253

5354
var (
@@ -197,6 +198,8 @@ func (r *Runner) Run(ctx context.Context) error {
197198
flag.Parse()
198199
initLogging(&opts)
199200

201+
setupLog.Info("GIE build", "commit-sha", version.CommitSHA, "build-ref", version.BuildRef)
202+
200203
// Validate flags
201204
if err := validateFlags(); err != nil {
202205
setupLog.Error(err, "Failed to validate flags")
@@ -242,7 +245,7 @@ func (r *Runner) Run(ctx context.Context) error {
242245
// --- Setup Metrics Server ---
243246
customCollectors := []prometheus.Collector{collectors.NewInferencePoolMetricsCollector(datastore)}
244247
metrics.Register(customCollectors...)
245-
metrics.RecordInferenceExtensionInfo()
248+
metrics.RecordInferenceExtensionInfo(version.CommitSHA, version.BuildRef)
246249
// Register metrics handler.
247250
// Metrics endpoint is enabled in 'config/default/kustomization.yaml'. The Metrics options configure the server.
248251
// More info:

config/crd/bases/inference.networking.k8s.io_inferencepools.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
---
21
apiVersion: apiextensions.k8s.io/v1
32
kind: CustomResourceDefinition
43
metadata:
54
annotations:
65
api-approved.kubernetes.io: unapproved, experimental-only
7-
controller-gen.kubebuilder.io/version: v0.16.1
6+
inference.networking.k8s.io/bundle-version: v1.0.0-dev
7+
creationTimestamp: null
88
name: inferencepools.inference.networking.k8s.io
99
spec:
1010
group: inference.networking.k8s.io
@@ -284,3 +284,9 @@ spec:
284284
storage: true
285285
subresources:
286286
status: {}
287+
status:
288+
acceptedNames:
289+
kind: ""
290+
plural: ""
291+
conditions: null
292+
storedVersions: null

config/crd/bases/inference.networking.x-k8s.io_inferencemodels.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
---
21
apiVersion: apiextensions.k8s.io/v1
32
kind: CustomResourceDefinition
43
metadata:
54
annotations:
6-
controller-gen.kubebuilder.io/version: v0.16.1
5+
inference.networking.k8s.io/bundle-version: v1.0.0-dev
6+
creationTimestamp: null
77
name: inferencemodels.inference.networking.x-k8s.io
88
spec:
99
group: inference.networking.x-k8s.io
@@ -254,3 +254,9 @@ spec:
254254
storage: true
255255
subresources:
256256
status: {}
257+
status:
258+
acceptedNames:
259+
kind: ""
260+
plural: ""
261+
conditions: null
262+
storedVersions: null

config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
---
21
apiVersion: apiextensions.k8s.io/v1
32
kind: CustomResourceDefinition
43
metadata:
54
annotations:
65
api-approved.kubernetes.io: unapproved, experimental-only
7-
controller-gen.kubebuilder.io/version: v0.16.1
6+
inference.networking.k8s.io/bundle-version: v1.0.0-dev
7+
creationTimestamp: null
88
name: inferencepools.inference.networking.x-k8s.io
99
spec:
1010
group: inference.networking.x-k8s.io
@@ -284,3 +284,9 @@ spec:
284284
storage: true
285285
subresources:
286286
status: {}
287+
status:
288+
acceptedNames:
289+
kind: ""
290+
plural: ""
291+
conditions: null
292+
storedVersions: null

config/manifests/vllm/cpu-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ spec:
1414
spec:
1515
containers:
1616
- name: lora
17-
image: "public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:v0.9.1" # formal images can be found in https://gallery.ecr.aws/q9t5s3a7/vllm-cpu-release-repo
17+
image: "public.ecr.aws/q9t5s3a7/vllm-cpu-release-repo:latest" # formal images can be found in https://gallery.ecr.aws/q9t5s3a7/vllm-cpu-release-repo
1818
imagePullPolicy: Always
1919
command: ["python3", "-m", "vllm.entrypoints.openai.api_server"]
2020
args:

hack/release-quickstart.sh

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,21 @@ echo "Using vLLM GPU image version: ${VLLM_GPU}"
4242
echo "Using vLLM CPU image version: ${VLLM_CPU}"
4343
echo "Using vLLM Simulator image version: ${VLLM_SIM}"
4444

45+
# -----------------------------------------------------------------------------
46+
# Update version/version.go and generating CRDs with new version annotations
47+
# -----------------------------------------------------------------------------
48+
VERSION_FILE="version/version.go"
49+
echo "Updating ${VERSION_FILE} ..."
50+
51+
# Replace bundleVersion in version.go
52+
# This regex finds the line with "BundleVersion" and replaces the string within the quotes.
53+
sed -i.bak -E "s|( *BundleVersion = \")[^\"]+(\")|\1${RELEASE_TAG}\2|g" "$VERSION_FILE"
54+
55+
UPDATED_CRD="config/crd/"
56+
echo "Generating CRDs with new annotations in $UPDATED_CRD"
57+
go run ./pkg/generator
58+
echo "Generated CRDs with new annotations in $UPDATED_CRD"
59+
4560
# -----------------------------------------------------------------------------
4661
# Update pkg/README.md
4762
# -----------------------------------------------------------------------------
@@ -63,20 +78,24 @@ EPP="config/manifests/inferencepool-resources.yaml"
6378
#TODO: Put all helm values files into an array to loop over
6479
EPP_HELM="config/charts/inferencepool/values.yaml"
6580
BBR_HELM="config/charts/body-based-routing/values.yaml"
66-
echo "Updating ${EPP} & ${EPP_HELM} ..."
81+
CONFORMANCE_MANIFESTS="conformance/resources/manifests/manifests.yaml"
82+
echo "Updating ${EPP}, ${EPP_HELM}, ${BBR_HELM}, and ${CONFORMANCE_MANIFESTS} ..."
6783

6884
# Update the container tag.
6985
sed -i.bak -E "s|(us-central1-docker\.pkg\.dev/k8s-staging-images/gateway-api-inference-extension/epp:)[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$EPP"
7086
sed -i.bak -E "s|(tag: )[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$EPP_HELM"
7187
sed -i.bak -E "s|(tag: )[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$BBR_HELM"
88+
sed -i.bak -E "s|(us-central1-docker\.pkg\.dev/k8s-staging-images/gateway-api-inference-extension/epp:)[^\"[:space:]]+|\1${RELEASE_TAG}|g" "$CONFORMANCE_MANIFESTS"
7289

7390
# Update the container image pull policy.
7491
sed -i.bak '/us-central1-docker.pkg.dev\/k8s-staging-images\/gateway-api-inference-extension\/epp/{n;s/Always/IfNotPresent/;}' "$EPP"
92+
sed -i.bak '/us-central1-docker.pkg.dev\/k8s-staging-images\/gateway-api-inference-extension\/epp/{n;s/Always/IfNotPresent/;}' "$CONFORMANCE_MANIFESTS"
7593

7694
# Update the container registry.
7795
sed -i.bak -E "s|us-central1-docker\.pkg\.dev/k8s-staging-images|registry.k8s.io|g" "$EPP"
7896
sed -i.bak -E "s|us-central1-docker\.pkg\.dev/k8s-staging-images|registry.k8s.io|g" "$EPP_HELM"
7997
sed -i.bak -E "s|us-central1-docker\.pkg\.dev/k8s-staging-images|registry.k8s.io|g" "$BBR_HELM"
98+
sed -i.bak -E "s|us-central1-docker\.pkg\.dev/k8s-staging-images|registry.k8s.io|g" "$CONFORMANCE_MANIFESTS"
8099

81100
# -----------------------------------------------------------------------------
82101
# Update vLLM deployment manifests
@@ -111,8 +130,8 @@ sed -i.bak '/llm-d\/llm-d-inference-sim/{n;s/Always/IfNotPresent/;}' "$VLLM_SIM_
111130
# -----------------------------------------------------------------------------
112131
# Stage the changes
113132
# -----------------------------------------------------------------------------
114-
echo "Staging $README $EPP $EPP_HELM $BBR_HELM $VLLM_GPU_DEPLOY $VLLM_CPU_DEPLOY $VLLM_SIM_DEPLOY files..."
115-
git add $README $EPP $EPP_HELM $BBR_HELM $VLLM_GPU_DEPLOY $VLLM_CPU_DEPLOY $VLLM_SIM_DEPLOY
133+
echo "Staging $VERSION_FILE $UPDATED_CRD $README $EPP $EPP_HELM $BBR_HELM $CONFORMANCE_MANIFESTS $VLLM_GPU_DEPLOY $VLLM_CPU_DEPLOY $VLLM_SIM_DEPLOY files..."
134+
git add $VERSION_FILE $UPDATED_CRD $README $EPP $EPP_HELM $BBR_HELM $CONFORMANCE_MANIFESTS $VLLM_GPU_DEPLOY $VLLM_CPU_DEPLOY $VLLM_SIM_DEPLOY
116135

117136
# -----------------------------------------------------------------------------
118137
# Cleanup backup files and finish

hack/update-codegen.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ set -o errexit
1818
set -o nounset
1919
set -o pipefail
2020

21+
echo "Generating CRDs"
22+
go run ./pkg/generator
23+
2124
SCRIPT_ROOT=$(dirname "${BASH_SOURCE[0]}")/..
2225
echo "$SCRIPT_ROOT script"
2326
CODEGEN_PKG=${2:-bin}

0 commit comments

Comments
 (0)