Skip to content

Commit 13e35d5

Browse files
migrated e2e inferenceextension to agentgatway
Signed-off-by: Chris Kaiser <[email protected]>
1 parent d458767 commit 13e35d5

File tree

14 files changed

+56
-124
lines changed

14 files changed

+56
-124
lines changed

.custom-gcl.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
version: v2.6.2
1+
version: v2.7.1
22
name: golangci-lint-custom
33
destination: _output
44
plugins:

test/e2e/features/inferenceextension/suite.go renamed to test/e2e/features/agentgateway/inference/suite.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build e2e
22

3-
package inferenceextension
3+
package inference
44

55
import (
66
"context"

test/e2e/features/inferenceextension/testdata/curl_pod.yaml renamed to test/e2e/features/agentgateway/inference/testdata/curl_pod.yaml

File renamed without changes.

test/e2e/features/inferenceextension/testdata/epp.yaml renamed to test/e2e/features/agentgateway/inference/testdata/epp.yaml

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: v1
22
kind: Service
33
metadata:
44
name: vllm-llama3-8b-instruct-epp
5-
namespace: inf-ext-e2e
5+
namespace: agent-gateway-test
66
spec:
77
selector:
88
app: vllm-llama3-8b-instruct-epp
@@ -17,13 +17,13 @@ apiVersion: v1
1717
kind: ServiceAccount
1818
metadata:
1919
name: vllm-llama3-8b-instruct-epp
20-
namespace: inf-ext-e2e
20+
namespace: agent-gateway-test
2121
---
2222
apiVersion: apps/v1
2323
kind: Deployment
2424
metadata:
2525
name: vllm-llama3-8b-instruct-epp
26-
namespace: inf-ext-e2e
26+
namespace: agent-gateway-test
2727
labels:
2828
app: vllm-llama3-8b-instruct-epp
2929
spec:
@@ -47,7 +47,7 @@ spec:
4747
- -pool-name
4848
- vllm-llama3-8b-instruct
4949
- -pool-namespace
50-
- inf-ext-e2e
50+
- agent-gateway-test
5151
- -v
5252
- "4"
5353
- -zap-encoder
@@ -87,7 +87,7 @@ apiVersion: v1
8787
kind: ConfigMap
8888
metadata:
8989
name: plugins-config
90-
namespace: inf-ext-e2e
90+
namespace: agent-gateway-test
9191
data:
9292
default-plugins.yaml: |
9393
apiVersion: inference.networking.x-k8s.io/v1alpha1
@@ -107,7 +107,7 @@ kind: Role
107107
apiVersion: rbac.authorization.k8s.io/v1
108108
metadata:
109109
name: pod-read
110-
namespace: inf-ext-e2e
110+
namespace: agent-gateway-test
111111
rules:
112112
- apiGroups: [ "inference.networking.x-k8s.io" ]
113113
resources: [ "inferenceobjectives" ]
@@ -123,11 +123,11 @@ kind: RoleBinding
123123
apiVersion: rbac.authorization.k8s.io/v1
124124
metadata:
125125
name: pod-read-binding
126-
namespace: inf-ext-e2e
126+
namespace: agent-gateway-test
127127
subjects:
128128
- kind: ServiceAccount
129129
name: vllm-llama3-8b-instruct-epp
130-
namespace: inf-ext-e2e
130+
namespace: agent-gateway-test
131131
roleRef:
132132
apiGroup: rbac.authorization.k8s.io
133133
kind: Role
@@ -158,7 +158,7 @@ metadata:
158158
subjects:
159159
- kind: ServiceAccount
160160
name: vllm-llama3-8b-instruct-epp
161-
namespace: inf-ext-e2e
161+
namespace: agent-gateway-test
162162
roleRef:
163163
apiGroup: rbac.authorization.k8s.io
164164
kind: ClusterRole

test/e2e/features/inferenceextension/testdata/gateway.yaml renamed to test/e2e/features/agentgateway/inference/testdata/gateway.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: gateway.networking.k8s.io/v1
22
kind: Gateway
33
metadata:
44
name: inference-gateway
5-
namespace: inf-ext-e2e
5+
namespace: agent-gateway-test
66
spec:
77
gatewayClassName: agentgateway
88
listeners:

test/e2e/features/inferenceextension/testdata/pool.yaml renamed to test/e2e/features/agentgateway/inference/testdata/pool.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: inference.networking.k8s.io/v1
22
kind: InferencePool
33
metadata:
44
name: vllm-llama3-8b-instruct
5-
namespace: inf-ext-e2e
5+
namespace: agent-gateway-test
66
spec:
77
targetPorts:
88
- number: 8000

test/e2e/features/inferenceextension/testdata/route.yaml renamed to test/e2e/features/agentgateway/inference/testdata/route.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: gateway.networking.k8s.io/v1
22
kind: HTTPRoute
33
metadata:
44
name: llm-route
5-
namespace: inf-ext-e2e
5+
namespace: agent-gateway-test
66
spec:
77
parentRefs:
88
- group: gateway.networking.k8s.io

test/e2e/features/inferenceextension/testdata/vllm.yaml renamed to test/e2e/features/agentgateway/inference/testdata/vllm.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ apiVersion: apps/v1
22
kind: Deployment
33
metadata:
44
name: vllm-llama3-8b-instruct
5-
namespace: inf-ext-e2e
5+
namespace: agent-gateway-test
66
spec:
77
replicas: 3
88
selector:

test/e2e/features/inferenceextension/types.go renamed to test/e2e/features/agentgateway/inference/types.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
//go:build e2e
22

3-
package inferenceextension
3+
package inference
44

55
import (
66
"net/http"
@@ -18,7 +18,7 @@ import (
1818

1919
var (
2020
// testNS is the namespace used for e2e tests. Test data manifests are hardcoded for this namespace.
21-
testNS = "inf-ext-e2e"
21+
testNS = "agent-gateway-test"
2222
// vllmDeployName is the name of the vLLM deployment name
2323
vllmDeployName = "vllm-llama3-8b-instruct"
2424
// targetModelName is the model name value defined in an LLM request body.

test/e2e/tests/agent_gateway_test.go

Lines changed: 37 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,25 +5,46 @@ package tests_test
55
import (
66
"context"
77
"os"
8+
"path/filepath"
89
"testing"
910

11+
"github.com/kgateway-dev/kgateway/v2/pkg/kgateway/crds"
12+
"github.com/kgateway-dev/kgateway/v2/pkg/schemes"
1013
"github.com/kgateway-dev/kgateway/v2/pkg/utils/envutils"
1114
"github.com/kgateway-dev/kgateway/v2/test/e2e"
1215
. "github.com/kgateway-dev/kgateway/v2/test/e2e/tests"
16+
"github.com/kgateway-dev/kgateway/v2/test/e2e/testutils/cluster"
1317
"github.com/kgateway-dev/kgateway/v2/test/e2e/testutils/install"
18+
testruntime "github.com/kgateway-dev/kgateway/v2/test/e2e/testutils/runtime"
1419
"github.com/kgateway-dev/kgateway/v2/test/testutils"
1520
)
1621

22+
var (
23+
// poolCrdManifest defines the manifest file containing Inference Extension CRDs.
24+
// Created using command:
25+
// kubectl kustomize "https://github.com/kubernetes-sigs/gateway-api-inference-extension/config/crd/?ref=$COMMIT_SHA" \
26+
// > pkg/kgateway/crds/inference-crds.yaml
27+
poolCrdManifest = filepath.Join(crds.AbsPathToCrd("inference-crds.yaml"))
28+
)
29+
1730
func TestAgentgatewayIntegration(t *testing.T) {
1831
ctx := context.Background()
1932
installNs, nsEnvPredefined := envutils.LookupOrDefault(testutils.InstallNamespace, "agent-gateway-test")
20-
testInstallation := e2e.CreateTestInstallation(
33+
34+
runtimeContext := testruntime.NewContext()
35+
clusterContext := cluster.MustKindContextWithScheme(runtimeContext.ClusterName, schemes.InferExtScheme())
36+
37+
installContext := &install.Context{
38+
InstallNamespace: installNs,
39+
ProfileValuesManifestFile: e2e.CommonRecommendationManifest,
40+
ValuesManifestFile: e2e.ManifestPath("agent-gateway-integration.yaml"),
41+
}
42+
43+
testInstallation := e2e.CreateTestInstallationForCluster(
2144
t,
22-
&install.Context{
23-
InstallNamespace: installNs,
24-
ProfileValuesManifestFile: e2e.CommonRecommendationManifest,
25-
ValuesManifestFile: e2e.ManifestPath("agent-gateway-integration.yaml"),
26-
},
45+
runtimeContext,
46+
clusterContext,
47+
installContext,
2748
)
2849

2950
// Set the env to the install namespace if it is not already set
@@ -42,10 +63,20 @@ func TestAgentgatewayIntegration(t *testing.T) {
4263
}
4364

4465
testInstallation.UninstallKgateway(ctx)
66+
67+
// Uninstall InferencePool v1 CRD
68+
err := testInstallation.Actions.Kubectl().DeleteFile(ctx, poolCrdManifest)
69+
testInstallation.Assertions.Require.NoError(err, "can delete manifest %s", poolCrdManifest)
4570
})
4671

72+
// Install InferencePool v1 CRD
73+
err := testInstallation.Actions.Kubectl().ApplyFile(ctx, poolCrdManifest)
74+
testInstallation.Assertions.Require.NoError(err, "can apply manifest %s", poolCrdManifest)
75+
4776
// Install kgateway
4877
testInstallation.InstallKgatewayFromLocalChart(ctx)
78+
testInstallation.Assertions.EventuallyNamespaceExists(ctx, installNs)
4979

5080
AgentgatewaySuiteRunner().Run(ctx, t, testInstallation)
81+
5182
}

0 commit comments

Comments
 (0)