Skip to content

feat: Add Python Virtual Environment Support: Execute Python UDFs Inside PVEs#5069

Merged
kunwp1 merged 34 commits into
apache:mainfrom
SarahAsad23:add-pve-udf
May 19, 2026
Merged

feat: Add Python Virtual Environment Support: Execute Python UDFs Inside PVEs#5069
kunwp1 merged 34 commits into
apache:mainfrom
SarahAsad23:add-pve-udf

Conversation

@SarahAsad23
Copy link
Copy Markdown
Contributor

@SarahAsad23 SarahAsad23 commented May 15, 2026

What changes were proposed in this PR?

This PR is an extension of PR #4484, #4902, and #5035. This PR adds support for running Python UDFs inside user configured Python Virtual Environments. Previously, UDFs executed using the default system environment, which limited dependency isolation and reproducibility across workflows. With this change, users can associate a PVE with a UDF execution environment, allowing workflows to run with custom package installations and environment specific dependencies.

Any related issues, documentation, discussions?

This change is part of ongoing efforts to support environment isolation and reproducibility within Texera. Related issue includes #4296. This PR closes sub-issue #5068

How was this PR tested?

Tested Manually and PveResourceSpec test file updated.

To test:

Was this PR authored or co-authored using generative AI tooling?

Co-authored using: ChatGPT (OpenAI)

@SarahAsad23 SarahAsad23 marked this pull request as draft May 15, 2026 00:37
@github-actions github-actions Bot added engine frontend Changes related to the frontend GUI common labels May 15, 2026
# Conflicts:
#	amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala
#	amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveResource.scala
…nto add-pve-udf

# Conflicts:
#	amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveManager.scala
#	amber/src/main/scala/org/apache/texera/web/resource/pythonvirtualenvironment/PveResource.scala
@codecov-commenter
Copy link
Copy Markdown

codecov-commenter commented May 15, 2026

Codecov Report

❌ Patch coverage is 26.59574% with 69 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.12%. Comparing base (a54518c) to head (6226f60).

Files with missing lines Patch % Lines
...it-frame/operator-property-edit-frame.component.ts 25.00% 22 Missing and 2 partials ⚠️
...chitecture/pythonworker/PythonWorkflowWorker.scala 0.00% 9 Missing ⚠️
...r/udf/python/DualInputPortsPythonUDFOpDescV2.scala 0.00% 9 Missing ⚠️
.../amber/operator/udf/python/PythonUDFOpDescV2.scala 0.00% 9 Missing ⚠️
...or/udf/python/source/PythonUDFSourceOpDescV2.scala 0.00% 9 Missing ⚠️
...esource/pythonvirtualenvironment/PveResource.scala 0.00% 5 Missing ⚠️
...resource/pythonvirtualenvironment/PveManager.scala 66.66% 0 Missing and 2 partials ⚠️
...rg/apache/texera/web/service/WorkflowService.scala 0.00% 1 Missing ⚠️
...apache/texera/amber/core/workflow/PhysicalOp.scala 66.66% 1 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main    #5069      +/-   ##
============================================
- Coverage     43.18%   43.12%   -0.07%     
- Complexity     2210     2215       +5     
============================================
  Files          1045     1045              
  Lines         40269    40327      +58     
  Branches       4251     4267      +16     
============================================
- Hits          17392    17390       -2     
- Misses        21805    21862      +57     
- Partials       1072     1075       +3     
Flag Coverage Δ *Carryforward flag
access-control-service 39.53% <ø> (ø)
agent-service 33.72% <ø> (ø) Carriedforward from cf0a2e3
amber 43.81% <27.41%> (-0.04%) ⬇️
computing-unit-managing-service 0.00% <ø> (ø)
config-service 0.00% <ø> (ø)
file-service 32.18% <ø> (ø)
frontend 34.07% <25.00%> (-0.03%) ⬇️
python 90.42% <ø> (-0.07%) ⬇️ Carriedforward from cf0a2e3
workflow-compiling-service 56.81% <ø> (ø)

*This pull request uses carry forward flags. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@SarahAsad23 SarahAsad23 marked this pull request as ready for review May 15, 2026 19:17
@kunwp1 kunwp1 self-requested a review May 15, 2026 20:47
@kunwp1 kunwp1 linked an issue May 15, 2026 that may be closed by this pull request
6 tasks
Copy link
Copy Markdown
Contributor

@kunwp1 kunwp1 left a comment

Choose a reason for hiding this comment

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

Left a few comments and can you add a few more test cases:

  1. choosePythonBin selection logic (fallback, missing dir, non-executable, "Default" sentinel)
  2. The new /pve/environments endpoint (PveResourceSpec has the harness for it)
  3. patchPythonUdfEnvironmentSchema

@SarahAsad23 SarahAsad23 requested a review from kunwp1 May 19, 2026 21:41
Copy link
Copy Markdown
Contributor

@kunwp1 kunwp1 left a comment

Choose a reason for hiding this comment

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

LGTM! Left some minor comments.

@kunwp1 kunwp1 merged commit 13c4836 into apache:main May 19, 2026
20 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

common engine frontend Changes related to the frontend GUI

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Execute Python UDFs Inside Python Virtual Environments

3 participants