Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AI plugin #10627

Open
wants to merge 27 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
27 commits
Select commit Hold shift + click to select a range
5bf2a37
initial ai api port to kgateway
npolshakova Jan 23, 2025
d71090f
fix publisher
npolshakova Feb 13, 2025
69e7e90
rename field
npolshakova Feb 13, 2025
fba2215
update json type
npolshakova Feb 13, 2025
930afa2
Regen
npolshakova Feb 13, 2025
c859c75
Merge remote-tracking branch 'origin/main' into port-ai-apis-to-kgateway
npolshakova Feb 19, 2025
37538fd
fix ai api optional fields
npolshakova Feb 19, 2025
6360bda
fix required apis
npolshakova Feb 19, 2025
7448a7b
Merge branch 'main' into port-ai-apis-to-kgateway
npolshakova Feb 19, 2025
e2ed48e
remove mistral
npolshakova Feb 19, 2025
956c0bd
clean up mistral generated files
npolshakova Feb 19, 2025
e80c49c
feedback
npolshakova Feb 24, 2025
69ad5bb
Merge branch 'main' into port-ai-apis-to-kgateway
npolshakova Feb 24, 2025
9665b44
feedback
npolshakova Feb 24, 2025
79fb6ec
clean up host override
npolshakova Feb 24, 2025
d0400d0
remove inline
npolshakova Feb 24, 2025
0cb05fd
add comment on prompt guard order
npolshakova Feb 25, 2025
7a9c1cb
Merge remote-tracking branch 'origin/main' into port-ai-apis-to-kgateway
npolshakova Feb 25, 2025
0881447
regen
npolshakova Feb 25, 2025
2ccdd1b
Merge branch 'main' into port-ai-apis-to-kgateway
npolshakova Feb 25, 2025
c123e78
feedback
npolshakova Feb 25, 2025
4bfe7eb
Regen
npolshakova Feb 25, 2025
a8a688e
initial plugins
npolshakova Feb 13, 2025
b7fee80
fix uds cluster
npolshakova Feb 25, 2025
99dd893
fix linter
npolshakova Feb 25, 2025
3f60635
separate transformation
npolshakova Feb 25, 2025
c3bd833
Merge branch 'main' into add-ai-plugins
npolshakova Feb 26, 2025
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
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ require (
github.com/grpc-ecosystem/go-grpc-middleware v1.4.0
github.com/hashicorp/go-multierror v1.1.1
github.com/kelseyhightower/envconfig v1.4.0
github.com/mitchellh/hashstructure v1.0.0
github.com/onsi/ginkgo/v2 v2.22.1
github.com/onsi/gomega v1.36.2
github.com/pkg/errors v0.9.1
Expand Down Expand Up @@ -157,7 +158,6 @@ require (
github.com/mattn/go-runewidth v0.0.16 // indirect
github.com/mitchellh/copystructure v1.2.0 // indirect
github.com/mitchellh/go-wordwrap v1.0.1 // indirect
github.com/mitchellh/hashstructure v1.0.0 // indirect
github.com/mitchellh/mapstructure v1.5.0 // indirect
github.com/mitchellh/reflectwalk v1.0.2 // indirect
github.com/moby/locker v1.0.1 // indirect
Expand Down
1 change: 1 addition & 0 deletions hack/utils/oss_compliance/osa_provided.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ Name|Version|License
[google/go-cmp](https://github.com/google/go-cmp)|v0.6.0|BSD 3-clause "New" or "Revised" License
[grpc-ecosystem/go-grpc-middleware](https://github.com/grpc-ecosystem/go-grpc-middleware)|v1.4.0|Apache License 2.0
[kelseyhightower/envconfig](https://github.com/kelseyhightower/envconfig)|v1.4.0|MIT License
[mitchellh/hashstructure](https://github.com/mitchellh/hashstructure)|v1.0.0|MIT License
[ginkgo/v2](https://github.com/onsi/ginkgo)|v2.22.1|MIT License
[onsi/gomega](https://github.com/onsi/gomega)|v1.36.2|MIT License
[pkg/errors](https://github.com/pkg/errors)|v0.9.1|BSD 2-clause "Simplified" License
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ func (p *directResponsePluginGwPass) ApplyHCM(ctx context.Context, pCtx *ir.HcmC
return nil
}

func (p *directResponsePluginGwPass) ApplyForBackend(ctx context.Context, pCtx *ir.RouteBackendContext, in ir.HttpBackend, out *envoy_config_route_v3.Route) error {
// no op
return nil
}

func registerTypes(ourCli versioned.Interface) {
skubeclient.Register[*v1alpha1.DirectResponse](
v1alpha1.DirectResponseGVK.GroupVersion().WithResource("directresponses"),
Expand Down Expand Up @@ -158,7 +163,7 @@ func (p *directResponsePluginGwPass) HttpFilters(ctx context.Context, fcc ir.Fil
return nil, nil
}

func (p *directResponsePluginGwPass) UpstreamHttpFilters(ctx context.Context) ([]plugins.StagedUpstreamHttpFilter, error) {
func (p *directResponsePluginGwPass) UpstreamHttpFilters(ctx context.Context, fcc ir.FilterChainCommon) ([]plugins.StagedUpstreamHttpFilter, error) {
return nil, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,11 @@ func (d *httpListenerPolicy) Equals(in any) bool {
type httpListenerPolicyPluginGwPass struct {
}

func (p *httpListenerPolicyPluginGwPass) ApplyForBackend(ctx context.Context, pCtx *ir.RouteBackendContext, in ir.HttpBackend, out *envoy_config_route_v3.Route) error {
// no op
return nil
}

func (p *httpListenerPolicyPluginGwPass) ApplyListenerPlugin(ctx context.Context, pCtx *ir.ListenerContext, out *envoy_config_listener_v3.Listener) {
// no op
}
Expand Down Expand Up @@ -164,7 +169,7 @@ func (p *httpListenerPolicyPluginGwPass) HttpFilters(ctx context.Context, fcc ir
return nil, nil
}

func (p *httpListenerPolicyPluginGwPass) UpstreamHttpFilters(ctx context.Context) ([]plugins.StagedUpstreamHttpFilter, error) {
func (p *httpListenerPolicyPluginGwPass) UpstreamHttpFilters(ctx context.Context, fcc ir.FilterChainCommon) ([]plugins.StagedUpstreamHttpFilter, error) {
return nil, nil
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ func (d *listenerPolicy) Equals(in any) bool {
type listenerPolicyPluginGwPass struct {
}

func (p *listenerPolicyPluginGwPass) ApplyForBackend(ctx context.Context, pCtx *ir.RouteBackendContext, in ir.HttpBackend, out *envoy_config_route_v3.Route) error {
// no op
return nil
}

func NewPlugin(ctx context.Context, commoncol *common.CommonCollections) extensionplug.Plugin {
col := krtutil.SetupCollectionDynamic[v1alpha1.ListenerPolicy](
ctx,
Expand Down Expand Up @@ -136,7 +141,7 @@ func (p *listenerPolicyPluginGwPass) HttpFilters(ctx context.Context, fcc ir.Fil
return nil, nil
}

func (p *listenerPolicyPluginGwPass) UpstreamHttpFilters(ctx context.Context) ([]plugins.StagedUpstreamHttpFilter, error) {
func (p *listenerPolicyPluginGwPass) UpstreamHttpFilters(ctx context.Context, fcc ir.FilterChainCommon) ([]plugins.StagedUpstreamHttpFilter, error) {
return nil, nil
}

Expand Down
Loading
Loading