Skip to content

Add opt-in same-Pod Python UDF workers - #621

Open
iamlinjunhong wants to merge 31 commits into
matrixorigin:mainfrom
iamlinjunhong:m-28132-operator
Open

iamlinjunhong wants to merge 31 commits into
matrixorigin:mainfrom
iamlinjunhong:m-28132-operator

Conversation

@iamlinjunhong

@iamlinjunhong iamlinjunhong commented Sep 20, 2026 •

Copy link
Copy Markdown

Summary

Adds opt-in Operator support for the typed Python UDF runtime merged in matrixorigin/matrixone#29152. Fixes #629.

  • Accept a worker policy on MatrixOneCluster, CNSet and CNPool. Render one digest-pinned, loopback-bound worker per enabled CN and validate the effective policy at admission and reconciliation.
  • Report the CN's current Python handshake, including observation expiry, process replacement and rollout state. Use command 48 and protobuf fields 50/51 from the merged CN protocol.
  • Preserve network policy ownership and CNPool drain semantics. Replace a Python-enabled Pod before another claim can acquire it.

Validation

  • On Linux/amd64 with Go 1.23.12, built the Operator, ran the root ./pkg/... and API module tests, and ran vet in both modules. Re-generated the CRDs and deepcopy output, verified Helm packaging, and exercised the installed webhooks.
  • Installed the Helm chart with OpenKruise 1.8.3 in a single-node K3s 1.32.8 cluster with real MinIO. Used the published matrixorigin/matrixone:nightly-3d3f579e CN image and a worker built from the same MatrixOne commit.
  • Ran the full Python BVT directly against two CNs before and after disable/re-enable and membership convergence. Each run executed 15 scripts and passed 353/353 checks per CN, with zero skips. The existing function retained its ID, active revision and result.
  • Restarted the worker in an existing Pod, withheld CNStore observations through expiry, and verified route loss and recovery. Checked real TCP and UDP network policy behavior, CNPool revision changes and claim rebinding to a new Pod UID after drain.

CI repair validation (2026-12-01)

  • Commit 42a525135b5116b2deb174c6af82e3be300fc772 synchronizes the direct protobuf dependency and keeps TN/LogSet dependencies alive until both test CNSets and their Pods finish teardown. This addresses the tidy-induced dirty-tree failure and the CN teardown timeout with missing LogSet errors, exposed by the corrected CloneSet drain lookup.
  • Newly executed on darwin/arm64 with Go 1.23.1: make verify passed, including API/root tests, Kubernetes 1.24.1 envtest webhook integration, generation, docs, module tidy, Chart checks and the final clean-tree check. Also passed go vet ./... in both modules, golangci-lint v2.1.6 (zero issues), make check-license, and E2E compilation via `go test ./test/e2e -run '^
    This stage supports explicitly trusted workloads. A CN and its worker share a Pod. Production sandboxing, multi-node failure and resource-pressure testing remain separate.

During replacement an immediate BVT observed account DDL sending RPCs to a retired CN. A separate control with Python disabled observed a transient lock-table binding error on account DDL immediately after an ordinary CN scale-in. Account DDL recovered. Python route readiness and MatrixOne SQL membership converge separately. For post-rollout SQL validation we checked backend membership and completed an account create/drop on both CNs before the repeat run. The example enables store draining and requires an accessible worker image digest.

See docs/python-udf-design.md, docs/python-udf-networking.md and examples/mo-cluster-udf.yaml.
`.

  • Full Kind E2E was not run locally because the Docker daemon is unavailable. The previously documented merged-runtime SQL BVT and rollout evidence above is retained and was not rerun for this dependency/test-order repair.

Rollout notes

This stage supports explicitly trusted workloads. A CN and its worker share a Pod. Production sandboxing, multi-node failure and resource-pressure testing remain separate.

During replacement an immediate BVT observed account DDL sending RPCs to a retired CN. A separate control with Python disabled observed a transient lock-table binding error on account DDL immediately after an ordinary CN scale-in. Account DDL recovered. Python route readiness and MatrixOne SQL membership converge separately. For post-rollout SQL validation we checked backend membership and completed an account create/drop on both CNs before the repeat run. The example enables store draining and requires an accessible worker image digest.

See docs/python-udf-design.md, docs/python-udf-networking.md and examples/mo-cluster-udf.yaml.

@iamlinjunhong
iamlinjunhong marked this pull request as ready for review November 30, 2026 08:19
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@mergify

mergify Bot commented Nov 30, 2026

Copy link
Copy Markdown
Contributor

Tick the box to add this pull request to the merge queue (same as @mergifyio queue). If it does not match the queue conditions yet, it enters the queue once it does.

  • Queue this pull request once it meets the queue conditions

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature Request]: Integrate the typed Python UDF worker with operator-managed CNs

1 participant