Skip to content

Move podevaluator to porch-server - #1119

Open
dgyorgy-nokia wants to merge 16 commits into
kptdev:mainfrom
nokia:podevaluator-to-pserver
Open

Move podevaluator to porch-server#1119
dgyorgy-nokia wants to merge 16 commits into
kptdev:mainfrom
nokia:podevaluator-to-pserver

Conversation

@dgyorgy-nokia

@dgyorgy-nokia dgyorgy-nokia commented Jul 16, 2026

Copy link
Copy Markdown
Contributor

[Move podevaluator to porch-server]


Description

  • What changed: Moved podevaluator to porch-server from function-funner
  • Why it’s needed: In a typical pipeline run where podevaluator is used, this eliminates an unnecessary gRPC exchange between porch-server and function-runner. The requests are sent directly from porch-server to the podexecutor, avoiding an additional gRPC round trip. The registration order of runners (builtin/executable/podevaluator) on porch-server is unchanged.
  • How it works:

Related Issue(s)

  • None #

Type of Change

  • Bug fix
  • New feature
  • Enhancement
  • Refactor
  • Documentation
  • Tests
  • Other: ________

Checklist

  • Code follows project style guidelines
  • Self-reviewed changes
  • Tests added/updated
  • Documentation added/updated
  • All tests and gating checks pass

AI Disclosure

  • I have used AI in the creation of this PR.

If so, please describe how:

  • Cursor's composer 2.5 was used to review the changes.

@netlify

netlify Bot commented Jul 16, 2026

Copy link
Copy Markdown

Deploy Preview for kpt-porch ready!

Name Link
🔨 Latest commit f44ec69
🔍 Latest deploy log https://app.netlify.com/projects/kpt-porch/deploys/6a97de3b670afd0009c1bdb4
😎 Deploy Preview https://deploy-preview-1119--kpt-porch.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

@dosubot dosubot Bot added the size:XL This PR changes 500-999 lines, ignoring generated files. label Jul 16, 2026
@github-actions
github-actions Bot requested a review from Copilot July 16, 2026 09:29

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR relocates the pod-based KRM function evaluator (“podevaluator”) so it’s hosted/registered from porch-server instead of the separate function-runner process, reducing one gRPC hop in typical pipelines and updating the surrounding runtime/config plumbing accordingly.

Changes:

  • Registers a new pod evaluator runtime in porch-server’s engine setup (while keeping builtin/executable/pod ordering) and updates deployments/RBAC for the new ownership.
  • Updates the gRPC runtime/executable-evaluator contract to pass an explicit exec_path over gRPC for executable functions.
  • Introduces a dedicated OCI image parsing/util package and adapts function-config cache matching to use it.

Reviewed changes

Copilot reviewed 34 out of 38 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
test/e2e/suiteutils/suite_utils.go Updates e2e helper to discover pod-namespace args from porch-server container.
test/e2e/api/metrics_test.go Adjusts metrics expectations for wrapper-server metrics scraping.
pkg/util/image/types.go Adds parsed image representation and helpers.
pkg/util/image/resolve.go Adds default image-prefix resolver helper.
pkg/util/image/regex.go Adds registry-detection regex (sourced from regclient).
pkg/util/image/image.go Adds image parsing/joining + semver matching utilities.
pkg/util/image/image_test.go Adds unit tests for image parsing and semver helpers.
pkg/engine/podevaluator/testdata/config.yaml Adds podevaluator test data config of function images.
pkg/engine/podevaluator/testdata/config_bad_format.yaml Adds negative test data config (bad YAML format).
pkg/engine/podevaluator/podmanager.go Moves podevaluator podmanager into the podevaluator package.
pkg/engine/podevaluator/podmanager_unit_test.go Updates tests for new podevaluator package name.
pkg/engine/podevaluator/podevaluator.go Adds podEvaluatorRuntime (fn runtime integration) and switches package name.
pkg/engine/podevaluator/podevaluator_unit_test.go Updates tests for new podevaluator package name.
pkg/engine/podevaluator/podevaluator_tag_resolution_test.go Updates tests and adds default image prefix constant.
pkg/engine/podevaluator/podevaluator_porch_parallel_execution_test.go Updates tests for new podevaluator package name.
pkg/engine/podevaluator/podevaluator_podmanager_test.go Updates tests for new podevaluator package name.
pkg/engine/podevaluator/podevaluator_podcachemanager_test.go Updates tests for new podevaluator package name.
pkg/engine/podevaluator/podcachemanager.go Moves pod cache manager into the podevaluator package.
pkg/engine/podevaluator/podcachemanager_unit_test.go Updates tests for new podevaluator package name.
pkg/engine/podevaluator/podcachemanager_eventloop_test.go Updates tests for new podevaluator package name.
pkg/engine/options.go Adds engine option to register the pod evaluator runtime; adjusts gRPC runtime option signature.
pkg/engine/grpcruntime.go Extends grpc runtime to resolve executable binaries via FunctionConfigStore and pass ExecPath.
pkg/engine/grpcruntime_test.go Updates grpc runtime tests for new binary-cache resolution and exec_path.
pkg/cmd/server/start.go Wires podevaluator/executable options into porch-server config/flags and env.
pkg/apiserver/apiserver.go Registers pod evaluator runtime in engine wiring and scopes controller-runtime cache to pod namespace.
go.mod Marks sigs.k8s.io/cli-utils as indirect.
func/server/server.go Removes pod runtime from function-runner; retains only executable evaluator and max gRPC size.
func/internal/executableevaluator.go Changes executable evaluator to require/validate exec_path and execute that binary.
func/internal/executableevaluator_test.go Updates tests to match exec_path behavior and new image util usage.
func/evaluator/evaluator.proto Adds exec_path field to EvaluateFunctionRequest.
func/evaluator/evaluator.pb.go Regenerates protobuf bindings to include ExecPath.
deployments/porch/6-rbac-bind.yaml Grants function-executor role binding to porch-server SA.
deployments/porch/3-porch-server.yaml Sets WRAPPER_SERVER_IMAGE env and adds podevaluator/executable flags to porch-server.
deployments/porch/2-function-runner.yaml Removes pod evaluator flags/env from function-runner deployment.
controllers/functionconfigs/reconciler/functionconfigreconciler.go Refactors image/tag matching and semver constraint handling using new image util.
controllers/functionconfigs/reconciler/functionconfigreconciler_test.go Removes function-runner finalizer cases.
api/porchconfig/v1alpha1/function_config_types.go Removes function-runner observed generation from FunctionConfig status/printcolumns.
api/generated/crds/config.porch.kpt.dev_functionconfigs.yaml Regenerates CRD to remove function-runner observed generation status/printcolumns.
Files not reviewed (1)
  • func/evaluator/evaluator.pb.go: Generated file
Comments suppressed due to low confidence (1)

pkg/engine/podevaluator/podevaluator.go:166

  • podevalRunner.Run ignores the runner's context and calls EvaluateFunction with context.Background(). This drops cancellation/deadline propagation from the engine (e.g. request timeout), which can leak work and make shutdowns slower.

Comment thread test/e2e/api/metrics_test.go
Comment thread pkg/engine/grpcruntime.go
Comment thread func/internal/executableevaluator.go
Comment thread pkg/cmd/server/start.go Outdated
@dgyorgy-nokia
dgyorgy-nokia force-pushed the podevaluator-to-pserver branch from a4bc310 to 00f26e4 Compare July 21, 2026 11:44
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
@dgyorgy-nokia
dgyorgy-nokia force-pushed the podevaluator-to-pserver branch from 00f26e4 to 16dc936 Compare July 21, 2026 13:18
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
@dgyorgy-nokia
dgyorgy-nokia force-pushed the podevaluator-to-pserver branch from a03a5e5 to 8572267 Compare July 22, 2026 14:40
dgyorgy-nokia and others added 7 commits July 23, 2026 13:43
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
Signed-off-by: Mózes László Máté <laszlo.mozes@nokia.com>
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>

@efiacor efiacor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need doc updates around this for sure as it's an arch change.

Comment thread api/generated/crds/config.porch.kpt.dev_functionconfigs.yaml
@efiacor

efiacor commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

@dgyorgy-nokia rebase required

@CsatariGergely

CsatariGergely commented Aug 26, 2026

Copy link
Copy Markdown
Contributor

Would need some documentation.
Could Dosu pick this up?

@dgyorgy-nokia

Copy link
Copy Markdown
Contributor Author

/dosu-refresh

Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
@dgyorgy-nokia
dgyorgy-nokia force-pushed the podevaluator-to-pserver branch from eef75bb to dae2a27 Compare August 31, 2026 11:51
@sonarqubecloud

Copy link
Copy Markdown

Quality Gate Failed Quality Gate failed

Failed conditions
77.8% Coverage on New Code (required ≥ 80%)

See analysis details on SonarQube Cloud

@efiacor efiacor left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for adding the documentation.
Could we add at least one crd e2e test that exercises the pod evaluator in the controller?

Comment thread pkg/cmd/server/start.go
Signed-off-by: Daniel Gyorgy <daniel.gyorgy@nokia.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XL This PR changes 500-999 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants