Skip to content
Open
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
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build e2e

package inferenceextension
package inference

import (
"context"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: v1
kind: Service
metadata:
name: vllm-llama3-8b-instruct-epp
namespace: inf-ext-e2e
namespace: agent-gateway-test
spec:
selector:
app: vllm-llama3-8b-instruct-epp
Expand All @@ -17,13 +17,13 @@ apiVersion: v1
kind: ServiceAccount
metadata:
name: vllm-llama3-8b-instruct-epp
namespace: inf-ext-e2e
namespace: agent-gateway-test
---
apiVersion: apps/v1
kind: Deployment
metadata:
name: vllm-llama3-8b-instruct-epp
namespace: inf-ext-e2e
namespace: agent-gateway-test
labels:
app: vllm-llama3-8b-instruct-epp
spec:
Expand All @@ -47,7 +47,7 @@ spec:
- -pool-name
- vllm-llama3-8b-instruct
- -pool-namespace
- inf-ext-e2e
- agent-gateway-test
- -v
- "4"
- -zap-encoder
Expand Down Expand Up @@ -87,7 +87,7 @@ apiVersion: v1
kind: ConfigMap
metadata:
name: plugins-config
namespace: inf-ext-e2e
namespace: agent-gateway-test
data:
default-plugins.yaml: |
apiVersion: inference.networking.x-k8s.io/v1alpha1
Expand All @@ -107,7 +107,7 @@ kind: Role
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: pod-read
namespace: inf-ext-e2e
namespace: agent-gateway-test
rules:
- apiGroups: [ "inference.networking.x-k8s.io" ]
resources: [ "inferenceobjectives" ]
Expand All @@ -123,11 +123,11 @@ kind: RoleBinding
apiVersion: rbac.authorization.k8s.io/v1
metadata:
name: pod-read-binding
namespace: inf-ext-e2e
namespace: agent-gateway-test
subjects:
- kind: ServiceAccount
name: vllm-llama3-8b-instruct-epp
namespace: inf-ext-e2e
namespace: agent-gateway-test
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: Role
Expand Down Expand Up @@ -158,7 +158,7 @@ metadata:
subjects:
- kind: ServiceAccount
name: vllm-llama3-8b-instruct-epp
namespace: inf-ext-e2e
namespace: agent-gateway-test
roleRef:
apiGroup: rbac.authorization.k8s.io
kind: ClusterRole
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: gateway.networking.k8s.io/v1
kind: Gateway
metadata:
name: inference-gateway
namespace: inf-ext-e2e
namespace: agent-gateway-test
spec:
gatewayClassName: agentgateway
listeners:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: inference.networking.k8s.io/v1
kind: InferencePool
metadata:
name: vllm-llama3-8b-instruct
namespace: inf-ext-e2e
namespace: agent-gateway-test
spec:
targetPorts:
- number: 8000
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: gateway.networking.k8s.io/v1
kind: HTTPRoute
metadata:
name: llm-route
namespace: inf-ext-e2e
namespace: agent-gateway-test
spec:
parentRefs:
- group: gateway.networking.k8s.io
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ apiVersion: apps/v1
kind: Deployment
metadata:
name: vllm-llama3-8b-instruct
namespace: inf-ext-e2e
namespace: agent-gateway-test
spec:
replicas: 3
selector:
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
//go:build e2e

package inferenceextension
package inference

import (
"net/http"
Expand All @@ -18,7 +18,7 @@ import (

var (
// testNS is the namespace used for e2e tests. Test data manifests are hardcoded for this namespace.
testNS = "inf-ext-e2e"
testNS = "agent-gateway-test"
// vllmDeployName is the name of the vLLM deployment name
vllmDeployName = "vllm-llama3-8b-instruct"
// targetModelName is the model name value defined in an LLM request body.
Expand Down
43 changes: 37 additions & 6 deletions test/e2e/tests/agent_gateway_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,25 +5,46 @@ package tests_test
import (
"context"
"os"
"path/filepath"
"testing"

"github.com/kgateway-dev/kgateway/v2/pkg/kgateway/crds"
"github.com/kgateway-dev/kgateway/v2/pkg/schemes"
"github.com/kgateway-dev/kgateway/v2/pkg/utils/envutils"
"github.com/kgateway-dev/kgateway/v2/test/e2e"
. "github.com/kgateway-dev/kgateway/v2/test/e2e/tests"
"github.com/kgateway-dev/kgateway/v2/test/e2e/testutils/cluster"
"github.com/kgateway-dev/kgateway/v2/test/e2e/testutils/install"
testruntime "github.com/kgateway-dev/kgateway/v2/test/e2e/testutils/runtime"
"github.com/kgateway-dev/kgateway/v2/test/testutils"
)

var (
// poolCrdManifest defines the manifest file containing Inference Extension CRDs.
// Created using command:
// kubectl kustomize "https://github.com/kubernetes-sigs/gateway-api-inference-extension/config/crd/?ref=$COMMIT_SHA" \
// > pkg/kgateway/crds/inference-crds.yaml
poolCrdManifest = filepath.Join(crds.AbsPathToCrd("inference-crds.yaml"))
)

func TestAgentgatewayIntegration(t *testing.T) {
ctx := context.Background()
installNs, nsEnvPredefined := envutils.LookupOrDefault(testutils.InstallNamespace, "agent-gateway-test")
testInstallation := e2e.CreateTestInstallation(

runtimeContext := testruntime.NewContext()
clusterContext := cluster.MustKindContextWithScheme(runtimeContext.ClusterName, schemes.InferExtScheme())

installContext := &install.Context{
InstallNamespace: installNs,
ProfileValuesManifestFile: e2e.CommonRecommendationManifest,
ValuesManifestFile: e2e.ManifestPath("agent-gateway-integration.yaml"),
}

testInstallation := e2e.CreateTestInstallationForCluster(
t,
&install.Context{
InstallNamespace: installNs,
ProfileValuesManifestFile: e2e.CommonRecommendationManifest,
ValuesManifestFile: e2e.ManifestPath("agent-gateway-integration.yaml"),
},
runtimeContext,
clusterContext,
installContext,
)

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

testInstallation.UninstallKgateway(ctx)

// Uninstall InferencePool v1 CRD
err := testInstallation.Actions.Kubectl().DeleteFile(ctx, poolCrdManifest)
testInstallation.Assertions.Require.NoError(err, "can delete manifest %s", poolCrdManifest)
})

// Install InferencePool v1 CRD
err := testInstallation.Actions.Kubectl().ApplyFile(ctx, poolCrdManifest)
testInstallation.Assertions.Require.NoError(err, "can apply manifest %s", poolCrdManifest)

// Install kgateway
testInstallation.InstallKgatewayFromLocalChart(ctx)
testInstallation.Assertions.EventuallyNamespaceExists(ctx, installNs)

AgentgatewaySuiteRunner().Run(ctx, t, testInstallation)

}
2 changes: 2 additions & 0 deletions test/e2e/tests/agent_gateway_tests.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/kgateway-dev/kgateway/v2/test/e2e/features/agentgateway/configmap"
"github.com/kgateway-dev/kgateway/v2/test/e2e/features/agentgateway/csrf"
"github.com/kgateway-dev/kgateway/v2/test/e2e/features/agentgateway/extauth"
"github.com/kgateway-dev/kgateway/v2/test/e2e/features/agentgateway/inference"
"github.com/kgateway-dev/kgateway/v2/test/e2e/features/agentgateway/jwtauth"
"github.com/kgateway-dev/kgateway/v2/test/e2e/features/agentgateway/mcp"
global_rate_limit "github.com/kgateway-dev/kgateway/v2/test/e2e/features/agentgateway/rate_limit/global"
Expand Down Expand Up @@ -40,6 +41,7 @@ func AgentgatewaySuiteRunner() e2e.SuiteRunner {
agentgatewaySuiteRunner.Register("ApiKeyAuth", apikeyauth.NewTestingSuite)
agentgatewaySuiteRunner.Register("JwtAuth", jwtauth.NewTestingSuite)
agentgatewaySuiteRunner.Register("RemoteJwtAuth", remotejwtauth.NewTestingSuite)
agentgatewaySuiteRunner.Register("Inference", inference.NewTestingSuite)

return agentgatewaySuiteRunner
}
74 changes: 0 additions & 74 deletions test/e2e/tests/inference_extension_test.go

This file was deleted.

15 changes: 0 additions & 15 deletions test/e2e/tests/inference_extension_tests.go

This file was deleted.

10 changes: 0 additions & 10 deletions test/e2e/tests/manifests/inference-extension-helm.yaml

This file was deleted.