Skip to content

Commit

Permalink
fix(clustering): add removed fileds for new ai plugins
Browse files Browse the repository at this point in the history
max_request_body_size field
  • Loading branch information
fffonion committed Jul 10, 2024
1 parent df88c98 commit 2f7d8d8
Show file tree
Hide file tree
Showing 2 changed files with 57 additions and 11 deletions.
18 changes: 18 additions & 0 deletions kong/clustering/compat/removed_fields.lua
Original file line number Diff line number Diff line change
Expand Up @@ -167,5 +167,23 @@ return {
"traces_endpoint",
"logs_endpoint",
},
ai_proxy = {
"max_request_body_size",
},
ai_prompt_decorator = {
"max_request_body_size",
},
ai_prompt_guard = {
"max_request_body_size",
},
ai_prompt_template = {
"max_request_body_size",
},
ai_request_transformer = {
"max_request_body_size",
},
ai_response_transformer = {
"max_request_body_size",
},
},
}
50 changes: 39 additions & 11 deletions spec/02-integration/09-hybrid_mode/09-config-compat_spec.lua
Original file line number Diff line number Diff line change
Expand Up @@ -547,12 +547,22 @@ describe("CP/DP config compat transformations #" .. strategy, function()
}
-- ]]

local expected_ai_proxy_prior_37 = cycle_aware_deep_copy(ai_proxy)
expected_ai_proxy_prior_37.config.response_streaming = nil
expected_ai_proxy_prior_37.config.model.options.upstream_path = nil
expected_ai_proxy_prior_37.config.route_type = "llm/v1/chat"
local expected = cycle_aware_deep_copy(ai_proxy)

do_assert(uuid(), "3.6.0", expected_ai_proxy_prior_37)
expected.config.max_request_body_size = nil

do_assert(uuid(), "3.7.0", expected)

local expected = cycle_aware_deep_copy(ai_proxy)
expected.config.response_streaming = nil
expected.config.model.options.upstream_path = nil
expected.config.auth.azure_use_managed_identity = nil
expected.config.auth.azure_client_id = nil
expected.config.auth.azure_client_secret = nil
expected.config.auth.azure_tenant_id = nil
expected.config.route_type = "llm/v1/chat"

do_assert(uuid(), "3.6.0", expected)

-- cleanup
admin.plugins:remove({ id = ai_proxy.id })
Expand Down Expand Up @@ -588,11 +598,19 @@ describe("CP/DP config compat transformations #" .. strategy, function()
}
-- ]]

local expected_ai_request_transformer_prior_37 = cycle_aware_deep_copy(ai_request_transformer)
expected_ai_request_transformer_prior_37.config.llm.model.options.upstream_path = nil
local expected = cycle_aware_deep_copy(ai_request_transformer)

expected.config.max_request_body_size = nil

do_assert(uuid(), "3.6.0", expected_ai_request_transformer_prior_37)
do_assert(uuid(), "3.7.0", expected)

expected.config.llm.model.options.upstream_path = nil
expected.config.llm.auth.azure_use_managed_identity = nil
expected.config.llm.auth.azure_client_id = nil
expected.config.llm.auth.azure_client_secret = nil
expected.config.llm.auth.azure_tenant_id = nil

do_assert(uuid(), "3.6.0", expected)
-- cleanup
admin.plugins:remove({ id = ai_request_transformer.id })
end)
Expand Down Expand Up @@ -625,10 +643,20 @@ describe("CP/DP config compat transformations #" .. strategy, function()
}
-- ]]

local expected_ai_response_transformer_prior_37 = cycle_aware_deep_copy(ai_response_transformer)
expected_ai_response_transformer_prior_37.config.llm.model.options.upstream_path = nil
local expected = cycle_aware_deep_copy(ai_response_transformer)

expected.config.max_request_body_size = nil

do_assert(uuid(), "3.7.0", expected)

local expected = cycle_aware_deep_copy(ai_response_transformer)
expected.config.llm.model.options.upstream_path = nil
expected.config.llm.auth.azure_use_managed_identity = nil
expected.config.llm.auth.azure_client_id = nil
expected.config.llm.auth.azure_client_secret = nil
expected.config.llm.auth.azure_tenant_id = nil

do_assert(uuid(), "3.6.0", expected_ai_response_transformer_prior_37)
do_assert(uuid(), "3.6.0", expected)

-- cleanup
admin.plugins:remove({ id = ai_response_transformer.id })
Expand Down

0 comments on commit 2f7d8d8

Please sign in to comment.