Skip to content

chore: complete uv migration (CI triggers, Dockerfiles, cleanup and generator fixes). Follow up to #12770#13085

Open
sh4shv4t wants to merge 59 commits intokubeflow:masterfrom
sh4shv4t:chore/uv-migration-sdk
Open

chore: complete uv migration (CI triggers, Dockerfiles, cleanup and generator fixes). Follow up to #12770#13085
sh4shv4t wants to merge 59 commits intokubeflow:masterfrom
sh4shv4t:chore/uv-migration-sdk

Conversation

@sh4shv4t
Copy link
Contributor

Description of your changes:

This PR is a follow-up to #12770 and addresses @hbelmiro's review comments on issue #12686 after the revert in #12979.

1. CI trigger coverage for dependency changes

  • Updated workflow path filters to include:
  • **pyproject.toml
  • uv.lock
  • Ensures Python-related workflows rerun when dependencies change.
  • Added safeguards for lockfile drift (check-uv-lock).

2. Dockerfile migration to uv

  • Migrated non-visualization Dockerfiles from requirements.txt-based installs to uv-based installs.
  • For workspace-oriented images, this uses:
  • install uv
  • copy pyproject.toml and uv.lock
  • run uv sync --frozen
  • For standalone/component images, this uses uv pip install with pinned dependencies.
  • Ensures reproducible, dependency-controlled builds across images.

Exception (intentional):

  • Dockerfile.visualization continues using requirements.txt
  • Reason: standalone module with dependency conflicts (as noted by reviewers)

3. Removal of legacy requirements-based dependency management

Removed many scattered:

  • requirements.txt
  • requirements.in
  • setup.py
  • MANIFEST.in
  • Introduced workspace-based dependency management using:
  • pyproject.toml
  • uv.lock

Result:

  • Single source of truth for dependencies
  • Reduced drift between environments
  • Some requirements files are intentionally retained (see Known exceptions)

4. Generator-aware fixes (CI stability)

  • Fixed validate-generated-files failures caused by editing generated outputs directly.
  • Moved changes to source-of-truth templates:
  • tox.mustache
  • test-requirements.mustache
  • Updated build_kfp_server_api_python_package.sh:
  • Preserve requirements.txt for tox compatibility
  • Regenerated v2beta1 Python client to align with generation output.

5. Protobuf + generated file drift fixes

  • Aligned generated .pb.go outputs with the current generator behavior used in CI.
  • Prevents recurring check-diff failures due to generator drift.

6. Docker build fix (visualization)

  • Fixed legacy ENV key value to ENV key=value
  • Replaced fragile gcloud install invocation with a more stable approach
  • Resolves CI Docker build failure

7. CI / tooling consistency improvements

  • Updated shared actions and scripts to consistently use uv.
  • Standardized Python setup and dependency sync in CI.
  • Improved reproducibility and reduced environment-specific issues.

Known exceptions / intentional deviations

  • Dockerfile.visualization continues using requirements.txt
  • Some requirements.txt files are retained:
  • Generated API clients (tox compatibility)
  • PyTorch components (tooling dependency)

These are temporary and required to avoid breaking:

  • OpenAPI generator outputs
  • tox-based workflows

Notes

  • make check-diff now passes after regeneration
  • Changes are aligned with generator behavior (no manual edits to generated files)
  • CI failures previously observed were due to:
  • generator drift
  • missing trigger paths
  • Dockerfile issues

Issue linkage


Checklist:

  • You have signed off your commits
  • The title follows the PR title convention

Copilot AI review requested due to automatic review settings March 20, 2026 00:57
@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign droctothorpe for approval. For more information see the Kubernetes Code Review Process.

The full list of commands accepted by this bot can be found here.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@google-oss-prow
Copy link

Hi @sh4shv4t. Thanks for your PR.

I'm waiting for a kubeflow member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work. Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Completes the repository-wide migration from requirements*.txt/setup.py workflows to a uv workspace with pyproject.toml + uv.lock, updating CI triggers, Dockerfiles, docs, and generator templates to keep builds reproducible and generated outputs in sync.

Changes:

  • Introduces a workspace-level pyproject.toml and updates multiple Python packages to pyproject.toml-based builds, aligning CI/scripts on uv sync / uv run.
  • Migrates many Dockerfiles and CI workflows from pip install -r ... to uv-based installs; adds a lockfile drift check workflow.
  • Removes legacy requirements/setup artifacts and adjusts generator templates and docs to reflect the new source-of-truth.

Reviewed changes

Copilot reviewed 134 out of 135 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
third_party/ml-metadata/update_version.sh Updates MLMD version replacement to target Dockerfile instead of requirements files
test/tag_for_hosted.sh Sync comment updated to point to metadata_writer Dockerfile
test/presubmit-yapf-sdk.sh Switches formatting presubmit to uv run
test/presubmit-tests-sdk.sh Runs SDK regression tests via uv run
test/presubmit-tests-sdk-unit.sh Runs SDK unit tests via uv run
test/presubmit-tests-sdk-client.sh Runs SDK client tests via uv run
test/presubmit-test-sdk-upgrade.sh Adjusts SDK upgrade test to build with uv and install wheels via pip
test/presubmit-isort-sdk.sh Switches import cleanup presubmit to uv run
test/presubmit-docformatter-sdk.sh Switches docformatter presubmit to uv run
test/presubmit-component-yaml.sh Removes per-script pip setup; relies on CI env and runs component-yaml test script
test/kfp-kubernetes-native-migration-tests/requirements.txt Removes standalone requirements file for native migration tests
test/README.md Updates local test instructions to use uv sync / uv run
sdk/python/setup.py Removes setuptools setup.py for SDK in favor of pyproject.toml
sdk/python/requirements.txt Removes compiled requirements lock for SDK
sdk/python/requirements.in Removes legacy SDK requirements input file
sdk/python/requirements-dev.txt Removes legacy SDK dev requirements file
sdk/python/requirements-deprecated.txt Removes deprecated runtime requirements file (inlined elsewhere)
sdk/python/pyproject.toml Adds SDK pyproject.toml with dependencies/extras and hatch versioning
sdk/python/pre-release-requirements-update.sh Removes pip-tools based pre-release requirements generation
sdk/python/kfp/version.py Bumps SDK version to 2.16.0
sdk/python/kfp/client/auth.py Updates comment to be less requirements-file specific
sdk/python/MANIFEST.in Removes requirements inclusion from manifest
sdk/Makefile Builds SDK package with uv build inside generator image
sdk/CONTRIBUTING.md Updates contributor docs to use uv workflows
samples/tutorials/Data passing in python components/Data passing in python components - Files.py.yaml Adds regenerated compiled pipeline YAML (kfp 2.16.0)
samples/tutorials/DSL - Control structures/DSL - Control structures.py.yaml Adds regenerated compiled pipeline YAML (kfp 2.16.0)
pyproject.toml Adds workspace pyproject.toml defining members and shared extras
proxy/requirements.txt Removes proxy requirements file
proxy/Dockerfile Installs requests via uv pip during image build
manifests/kustomize/base/metadata/base/metadata-grpc-deployment.yaml Updates MLMD sync comment to point to metadata_writer Dockerfile
manifests/kustomize/base/installs/multi-user/pipelines-profile-controller/run_tests.sh Inlines test deps install instead of requirements-dev.txt
manifests/kustomize/base/installs/multi-user/pipelines-profile-controller/requirements-dev.txt Removes requirements-dev.txt for profile controller tests
kubernetes_platform/python/setup.py Removes setuptools setup.py in favor of pyproject.toml
kubernetes_platform/python/requirements.txt Removes compiled requirements lock for kfp-kubernetes
kubernetes_platform/python/requirements.in Removes legacy requirements input file
kubernetes_platform/python/requirements-dev.txt Removes legacy dev requirements file
kubernetes_platform/python/release.sh Builds via python -m build and avoids importing package for version
kubernetes_platform/python/pyproject.toml Adds kfp-kubernetes pyproject.toml with hatch versioning
kubernetes_platform/python/pre-release-requirements-update.sh Removes pip-tools based pre-release requirements generation
kubernetes_platform/python/kfp/kubernetes/init.py Bumps kfp-kubernetes version to 2.16.0
kubernetes_platform/python/docs/requirements.txt Removes docs requirements file for kfp-kubernetes docs
kubernetes_platform/python/docs/.readthedocs.yml Switches RTD install flow to pip installs with extra requirements
kubernetes_platform/python/create_release_branch.sh Avoids importing package for version check (grep version)
kubernetes_platform/python/RELEASE.md Updates release docs to mention uv/pip build prerequisites
kubernetes_platform/python/MANIFEST.in Removes requirements files from manifest
kubernetes_platform/Makefile Builds kfp-kubernetes via uv build; updates python-dev install
hack/update-requirements.sh Removes pip-tools docker-based requirements update script
hack/update-all-requirements.sh Removes script that updated multiple requirements files
docs/sdk/requirements.txt Removes docs requirements file
docs/sdk/build_docs_locally.sh Updates local docs build to uv sync --extra docs
components/test_load_all_components.sh Switches to running loader under uv run
components/kserve/requirements.txt Removes kserve component requirements file
components/kserve/Dockerfile Installs component deps via uv pip
components/aws/sagemaker/v2.Dockerfile.dockerignore Stops ignoring removed requirements files
components/aws/sagemaker/v2.Dockerfile Installs v2 image deps via uv pip
components/aws/sagemaker/tests/unit_tests/README.md Inlines dependency install instructions
components/aws/sagemaker/tests/unit_tests/Dockerfile Installs unit test deps via uv pip
components/aws/sagemaker/tests/integration_tests/requirements.txt Removes integration test requirements file
components/aws/sagemaker/tests/integration_tests/Dockerfile Installs integration test deps via uv pip
components/aws/sagemaker/requirements_v2.txt Removes v2 requirements file
components/aws/sagemaker/requirements.txt Removes runtime requirements file
components/aws/sagemaker/dev_requirements.txt Removes dev requirements file
components/aws/sagemaker/TrainingJob/samples/mnist-kmeans-training/requirements.txt Removes sample requirements file
components/aws/sagemaker/TrainingJob/samples/mnist-kmeans-training/README.md Inlines pip install command for sample
components/aws/sagemaker/Dockerfile Installs runtime deps via uv pip
components/aws/sagemaker/CONTRIBUTING.md Updates contributor instructions to uv-centric setup
components/PyTorch/pytorch-kfp-components/tox.ini Switches tox deps to requirements files
components/PyTorch/pytorch-kfp-components/test-requirements.txt Adds pinned-ish test requirements for tox
components/PyTorch/pytorch-kfp-components/requirements.txt Adds base requirements for tox installs
backend/update_requirements.sh Replaces pip-tools update with uv lock
backend/src/v2/test/requirements.txt Removes v2 test requirements file
backend/src/v2/test/components/run_sample.yaml Inlines deprecated deps install list in sample runner
backend/src/v2/test/Dockerfile Uses uv sync + editable install for SDK in v2 test image
backend/src/v2/README.md Updates test deps instructions to use uv
backend/requirements.txt Removes backend requirements lock file
backend/requirements.in Removes backend requirements input file
backend/metadata_writer/update_requirements.sh Replaces pip-tools update with uv lock
backend/metadata_writer/requirements.txt Removes metadata_writer requirements lock file
backend/metadata_writer/requirements.in Removes metadata_writer requirements input file
backend/metadata_writer/README.md Updates dependency editing instructions to workspace pyproject + uv lock
backend/metadata_writer/Dockerfile Migrates metadata_writer image to uv sync + explicit MLMD install
backend/api/v2beta1/python_http_client_template/tox.mustache Adds tox template using requirements + test-requirements
backend/api/v2beta1/python_http_client_template/test-requirements.mustache Adds test requirements template
backend/api/v2beta1/python_http_client/tox.ini Updates tox config to include test requirements and skip missing interpreters
backend/api/v2beta1/python_http_client/test-requirements.txt Updates pytest/pytest-cov/pytest-randomly versions
backend/api/v2beta1/python_http_client/setup.py Removes setup.py in favor of pyproject
backend/api/v2beta1/python_http_client/pyproject.toml Adds pyproject for generated client
backend/api/v1beta1/python_http_client_template/tox.mustache Adds tox template using requirements + test-requirements
backend/api/v1beta1/python_http_client_template/test-requirements.mustache Adds test requirements template
backend/api/v1beta1/python_http_client/tox.ini Updates tox config to include test requirements and skip missing interpreters
backend/api/v1beta1/python_http_client/test-requirements.txt Updates pytest/pytest-cov/pytest-randomly versions
backend/api/build_kfp_server_api_python_package.sh Makes removal robust and adds post-build pyproject restoration for v2beta1
backend/README.md Updates dependency management docs to uv-based workflow
backend/Dockerfile.visualization Fixes ENV syntax and gcloud install invocation
backend/Dockerfile Migrates compiler stage to uv workspace + generates protos during build
api/v2alpha1/python/setup.py Removes setup.py in favor of pyproject
api/v2alpha1/python/requirements.txt Removes compiled requirements lock file
api/v2alpha1/python/requirements.in Removes requirements input file
api/v2alpha1/python/pyproject.toml Adds pyproject for pipeline spec package
api/v2alpha1/python/MANIFEST.in Removes requirements inclusion from manifest
api/Makefile Builds pipeline spec package with uv build inside generator image
RELEASE.md Updates release workflow steps to pyproject+uv lock model
AGENTS.md Updates agent/developer workflows to uv commands
.readthedocs.yml Migrates RTD build to uv sync + commands-based build
.pre-commit-config.yaml Switches Python formatting hooks to run via uv run
.github/workflows/validate-generated-files.yml Adds uv-related path triggers and switches to shared setup-python action
.github/workflows/upgrade-test.yml Adds uv-related path triggers
.github/workflows/sdk-yapf.yml Adds uv-related path triggers and switches to shared setup-python action
.github/workflows/sdk-upgrade.yml Adds uv-related path triggers and updates protobuf step usage
.github/workflows/sdk-isort.yml Adds uv-related path triggers and switches to shared setup-python action
.github/workflows/sdk-docformatter.yml Adds uv-related path triggers and switches to shared setup-python action
.github/workflows/sdk-component-yaml.yml Adds uv-related path triggers and simplifies setup steps
.github/workflows/readthedocs-builds.yml Adds uv-related path triggers and updates docs build commands to uv run
.github/workflows/publish-packages.yml Builds/checks wheels via uv build and uv run twine
.github/workflows/legacy-v2-api-integration-tests.yml Adds uv-related path triggers
.github/workflows/kfp-sdk-unit-tests.yml Adds uv-related path triggers and simplifies setup steps
.github/workflows/kfp-sdk-tests.yml Adds uv-related path triggers and simplifies setup steps
.github/workflows/kfp-sdk-client-tests.yml Adds uv-related path triggers and simplifies setup steps
.github/workflows/kfp-kubernetes-native-migration-tests.yaml Adds uv-related path triggers and switches test runs to uv run
.github/workflows/kfp-kubernetes-library-test.yml Adds uv-related path triggers and switches tests to uv run
.github/workflows/integration-tests-v1.yml Adds uv-related path triggers
.github/workflows/gcpc-modules-tests.yml Adds uv-related path triggers and switches setup/tests to uv-based flow
.github/workflows/e2e-test.yml Adds uv-related path triggers
.github/workflows/e2e-test-frontend.yml Adds uv-related path triggers
.github/workflows/docs-freshness.yml Adds uv-related path triggers
.github/workflows/compiler-tests.yml Adds uv-related path triggers
.github/workflows/check-uv-lock.yml Adds new workflow to detect uv.lock drift
.github/workflows/backend-visualization.yml Adds uv-related path triggers
.github/workflows/api-server-tests.yml Adds uv-related path triggers
.github/resources/scripts/kfp-readiness/requirements.txt Removes readiness requirements file
.github/resources/scripts/helper-functions.sh Inlines readiness deps install instead of requirements file
.github/actions/setup-python/action.yml Adds composite action to install Python+uv and sync CI deps
.github/actions/protobuf/action.yml Simplifies protobuf action to rely on uv and install spec wheel via uv
.github/actions/kfp-k8s/action.yml Switches build/install steps to uv build and uv pip install
Comments suppressed due to low confidence (5)

backend/api/v2beta1/python_http_client/tox.ini:1

  • envlist = py27, py3 is incompatible with the updated test dependencies (pytest>=7) and with the package metadata (requires-python = \">=3.9\" in pyproject.toml). This can make tox -e py27 fail if Python 2.7 is present, and it also advertises unsupported environments. Update the envlist to only supported Python versions (e.g., py39, py310, py311) or drop py27 entirely in both this file and the generator templates.
    .readthedocs.yml:1
  • make -C api python and make -C kubernetes_platform python invoke Docker-based build steps (per the Makefile diffs), which Read the Docs build environments typically do not support. This is likely to break RTD builds. Prefer non-Docker proto generation steps in RTD (e.g., install protoc and run the generate_proto.py scripts directly), or switch RTD to targets that do not require Docker.
    test/presubmit-yapf-sdk.sh:1
  • find sdk/python/kfp/**/*.py -type f is not a reliable find invocation because ** globbing isn’t expanded by find (and may not be enabled in the shell), so this can yield no files or errors depending on the environment. Use a find root directory plus -name '*.py' (e.g., search under sdk/python/kfp). Also, || true can mask real failures (not just 'file modified' exits); if the intent is to ignore only 'changes made' behavior, handle that specific exit code instead of swallowing all errors.
    backend/Dockerfile:1
  • Downloading .proto files during the Docker build introduces a supply-chain risk and reduces reproducibility (no hash verification; relies on external availability). Prefer vendoring these protos into the repo and copying them into the image, or at minimum verify downloads via pinned SHA256 checksums and fail closed if verification fails.
    backend/api/build_kfp_server_api_python_package.sh:1
  • The TODO references a placeholder issue (issues/XXXX), which makes it hard to track and can confuse future maintainers. Replace with the actual issue link (or create one and reference it), or remove the link if no issue exists.

sh4shv4t and others added 15 commits March 20, 2026 06:34
…low#12686)

This commit performs a complete migration of the Kubeflow Pipelines SDK
and related packages from pip-based installation (setup.py, requirements.txt)
to uv workspaces with modern pyproject.toml configuration.

Addresses issue kubeflow#12686 by adopting uv for faster, more reliable dependency
management and build processes. The uv workspace architecture provides:
- 10-100x faster dependency resolution and installation
- Deterministic builds via uv.lock
- Unified tooling for development, testing, and CI
- Better integration with modern Python packaging standards (PEP 517/518/621)

- Created root pyproject.toml with workspace configuration for 4 packages:
  - kfp (sdk/python)
  - kfp-pipeline-spec (api/v2alpha1/python)
  - kfp-kubernetes (kubernetes_platform/python)
  - kfp-server-api (backend/api/v2beta1/python_http_client)

- Created individual pyproject.toml files for each package with:
  - Package metadata and dependencies
  - Build system configuration (hatchling)
  - Optional dependency groups (lint, test, dev, ci, docs)
  - Tool configurations (mypy, pytest, coverage, isort, etc.)

- All setup.py files (4 packages)
- All requirements.txt, requirements.in, requirements-dev.txt files
- All MANIFEST.in files
- hack/update-all-requirements.sh (no longer needed)
- hack/update-requirements.sh (no longer needed)

- uv.lock: Lockfile with 196 resolved packages and exact versions
- .github/actions/setup-python/action.yml: Composite action for CI setup
- .github/workflows/check-uv-lock.yml: Workflow to validate lockfile

**Test Scripts (8 files updated):**
- presubmit-yapf-sdk.sh: Uses `uv run yapf` and `uv run python -m pre_commit_hooks.string_fixer`
- presubmit-isort-sdk.sh: Uses `uv run pycln` and `uv run isort`
- presubmit-docformatter-sdk.sh: Uses `uv run docformatter`
- presubmit-tests-sdk-unit.sh: Uses `uv sync --extra ci` and `uv run pytest`
- presubmit-tests-sdk-client.sh: Uses uv for package installation and pytest
- presubmit-tests-sdk.sh: Uses uv for full SDK tests
- presubmit-test-sdk-upgrade.sh: Uses `uv build --package` instead of `python -m build`
- presubmit-component-yaml.sh: Uses uv sync and uv pip install

**Workflows (6 files updated):**
- kfp-kubernetes-library-test.yml: Replaced custom action with setup-python
- kfp-sdk-tests.yml: Replaced custom action with setup-python
- sdk-docformatter.yml: Uses .github/actions/setup-python
- sdk-isort.yml: Uses .github/actions/setup-python
- sdk-upgrade.yml: Uses .github/actions/setup-python
- sdk-component-yaml.yml: Replaced custom action with setup-python

**Other CI Changes:**
- .github/dependabot.yml: Added pip ecosystem monitoring for uv requirements
- gcpc-modules-tests.yml: Updated to use uv for package installation
- Updated pre-commit config to use uv

- developer_guide.md: Updated installation instructions to use uv
- sdk/python/README.md: Updated development setup instructions
- Various workflow README files updated

- Updated Makefiles to work without requirements.in files
- Fixed uv PATH issues in Docker containers by using ~/.local/bin/uv
- Removed README.md requirement from auto-generated packages

- Added pre-commit-hooks to lint dependencies (required for string_fixer)
- All dependencies now managed through pyproject.toml dependency groups
- Version pins preserved from original requirements files

- All 4 packages build successfully with `uv build --package <name>`
- Proto generation works via updated Makefiles
- Local tests pass with `uv run pytest`
- CI test scripts updated to use uv instead of pip

**For developers:**
- Must install uv: `curl -LsSf https://astral.sh/uv/install.sh | sh`
- Replace `pip install -e .` with `uv sync` or `uv pip install -e .`
- Replace `pip install -r requirements.txt` with `uv sync`
- Replace `python -m tool` with `uv run tool`

**For CI/automation:**
- requirements.txt files no longer exist
- Must use uv for package installation
- Use composite action `.github/actions/setup-python` for workflow setup

Users can continue using pip to install published packages from PyPI.
This change only affects development workflows, not end-user installation.

Signed-off-by: Shashvat <sh4shv4t@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…ion steps

Several CI workflows were failing because they were missing required setup steps:

1. kfp-sdk-unit-tests.yml: Added proto generation and workspace package
   installation steps before running tests. The workflow was setting
   SETUP_ENV=false but wasn't providing the required dependencies.

2. sdk-upgrade.yml: Added workspace package installation step. The workflow
   had proto generation but was missing the editable package installations.

3. readthedocs-builds.yml: Added workspace package installation after proto
   generation. sphinx-build requires the packages to be installed to build
   documentation.

All workflows now follow the same pattern:
- Setup Python with uv
- Generate proto files (via protobuf action or make commands)
- Install workspace packages in editable mode with uv pip install -e
- Run tests with SETUP_ENV=false

This ensures tests run in the uv-managed virtual environment with all
dependencies correctly installed.

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
The CI workflows were failing because 'uv pip install -e' was trying to
resolve and install dependencies for workspace packages, which conflicts
with the dependencies already installed by 'uv sync --extra ci'.

Changes made:
- Added --no-deps flag to all 'uv pip install -e' commands in workflows
- This prevents uv from reinstalling/resolving dependencies that are
  already satisfied by the uv.lock file
- Applies to: kfp-sdk-tests, kfp-sdk-unit-tests, kfp-kubernetes-library-test,
  sdk-component-yaml, sdk-upgrade, and readthedocs-builds workflows

The --no-deps flag ensures workspace packages are installed in editable mode
without touching the already-installed dependency tree, avoiding version
conflicts and installation errors.

This follows the pattern:
1. uv sync --extra ci (installs all deps from lockfile)
2. Generate proto files
3. uv pip install --no-deps -e packages (install workspace packages only)
4. Run tests in the uv-managed environment

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
The composite actions were failing with error:
'The wheel filename "*.whl" is invalid: Must have a version'

This occurred because shell glob patterns (*.whl) were not being expanded
before being passed to uv pip install. The literal string '*.whl' was
treated as a filename instead of a wildcard pattern.

Fixed by:
- Using bash array expansion to properly handle wheel file globs
- Added nullglob option to handle cases where no files match
- Added error checking to detect missing wheel files
- Quote array expansion to handle filenames with spaces

Changes in:
- .github/actions/protobuf/action.yml: Fixed kfp-pipeline-spec wheel install
- .github/actions/kfp-k8s/action.yml: Fixed kfp-server-api and kfp wheel installs

This pattern now correctly expands globs:
  shopt -s nullglob
  wheels=(dist/*.whl)
  uv pip install --system "${wheels[@]}"

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
The previous glob expansion using bash arrays was causing failures across
multiple CI workflows. Simplified the approach to use ls with error checking.

Changes:
- Replace bash array glob expansion with $(ls dist/*.whl | head -n1)
- This approach is more portable and reliable across different shell contexts
- Maintains error checking to ensure wheel files exist before installation
- Uses head -n1 to select the first wheel file (there should only be one)

This fixes the 55 failing tests by using a simpler, more reliable approach
to wheel file discovery that works consistently in GitHub Actions workflows.

Applies to:
- .github/actions/protobuf/action.yml
- .github/actions/kfp-k8s/action.yml

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
The --system flag causes uv to install packages into the system Python
instead of the virtual environment created by 'uv sync'. This was
causing CI failures because:
1. setup-python action runs 'uv sync' creating .venv/
2. protobuf/kfp-k8s actions used 'uv pip install --system' installing
   to system Python, not the venv
3. 'uv run pytest' runs in .venv/ which lacked those packages

Changes:
- Remove redundant uv setup from protobuf and kfp-k8s actions (now
  provided by setup-python action)
- Remove --system flag from all uv pip install commands
- Update kfp-kubernetes-native-migration-tests workflow to use our
  setup-python action and uv commands

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Several workflows were missing required setup steps:

1. kfp-sdk-client-tests.yml: Added protobuf action and workspace
   packages installation before running tests

2. gcpc-modules-tests.yml: Replaced manual protobuf-compiler installation
   with protobuf action, added workspace packages installation

3. readthedocs-builds.yml: Added protobuf action instead of manual
   make command

4. components/test_load_all_components.sh: Changed python3 to uv run
   python to use the correct virtual environment

5. setup-python/action.yml: Updated to actions/setup-python@v6 for
   consistency with other workflows

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
- Use 'uv run twine check' for consistency in publish-packages.yml
- Run 'uv build' from workspace root in all Makefiles
- Pin uv version to 0.6.6 for supply-chain security
- Add comment explaining pip/uv mixing in upgrade test

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
uv build uses --out-dir flag, not --out. Fixes build failures in
protobuf generation and all downstream CI checks.

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
uv sync only installs packages reachable from the root project's
dependency graph. Without workspace members listed as root dependencies,
their transitive deps (docstring_parser, google-protobuf, etc.) were
never installed, causing ModuleNotFoundError at runtime.

- Add kfp, kfp-pipeline-spec, kfp-server-api, kfp-kubernetes as root
  project dependencies with workspace sources
- Remove redundant 'uv pip install --no-deps -e' steps from 8 workflows
  since uv sync now handles editable workspace package installation
- Regenerate uv.lock

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…n venv

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…ontainer

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: CollinHowland <47928984+CollinHowland@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
sh4shv4t and others added 26 commits March 20, 2026 06:34
…thor names

Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com>
Signed-off-by: Shashvat Singh <145356337+sh4shv4t@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…ct proper author names

Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com>
Signed-off-by: Shashvat Singh <145356337+sh4shv4t@users.noreply.github.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
- Add prerequisite note to kubernetes_platform/python/RELEASE.md for
  'uv sync --extra ci' before running release.sh
- Add release checklist items in RELEASE.md for updating pinned versions
  of kfp-kubernetes, kfp-pipeline-spec, kfp-server-api, and kfp
- Pin kfp-pipeline-spec and kfp-server-api to exact version (==2.15.2)
  in sdk/python/pyproject.toml to match kfp/version.py
- Pin kfp to exact version (==2.15.2) in kubernetes_platform/python/pyproject.toml
- Remove hardcoded protobuf/setuptools/wheel installs from protobuf action;
  these are now provided by uv sync --extra ci from the lockfile
- Remove unused protobuf_python_version, setuptools_version, wheels_version
  inputs from protobuf action.yml
- Remove 'extra' input from setup-python action (always use 'ci')
- Remove unpinned 'uv pip install pip setuptools wheel' from setup-python;
  setuptools and wheel are now in the test extra group
- Add pytest-mock, kubernetes, setuptools, wheel to root pyproject.toml
  test dependencies so they are lockfile-pinned
- Replace 'uv pip install -r requirements.txt' with direct uv pip install
  of missing packages in migration tests workflow
- Simplify build_kfp_server_api_python_package.sh to use codegen setup.py
  for all versions (added TODO for Mustache template migration)
- Update UV_VERSION from 0.6.6 to 0.10.3 in api/, kubernetes_platform/,
  and sdk/ Makefiles
- Fix create_release_branch.sh: remove uv fallback, fix error message
  to reference __init__.py instead of setup.py
- Remove dead SETUP_ENV blocks from all four presubmit test scripts
  (CI always sets SETUP_ENV=false)
- Regenerate uv.lock

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
- Use grep to extract __version__ from __init__.py instead of importing
  the module, which avoids needing protobuf installed in the system
  python (fixes ModuleNotFoundError: No module named 'google')
- Restore pyproject.toml after building with codegen setup.py in
  build_kfp_server_api_python_package.sh so the committed tree stays
  clean for uv workspace resolution (fixes check-diff failure)

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…e frozen sync

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…ility

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
… to use correct install statement

Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com>
Signed-off-by: Shashvat Singh <145356337+sh4shv4t@users.noreply.github.com>
…rameter

Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com>
Signed-off-by: Shashvat Singh <145356337+sh4shv4t@users.noreply.github.com>
Co-authored-by: Helber Belmiro <helber.belmiro@gmail.com>
Signed-off-by: Shashvat Singh <145356337+sh4shv4t@users.noreply.github.com>
- Accept deletion of requirements.txt/requirements.in/setup.py (replaced by pyproject.toml + uv.lock)
- Bump protobuf lower bound from 6.31.1 to 6.33.5 across all pyproject.toml files
- Align kfp-server-api pyproject.toml version with VERSION file (2.16.0)
- Regenerate uv.lock

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Update version pins in pyproject.toml files, version.py, __init__.py,
and regenerate uv.lock to align with VERSION file (2.16.0).

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…files

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…uilds

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…dter uv migration

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…extra

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
…n builds

Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
@sh4shv4t sh4shv4t force-pushed the chore/uv-migration-sdk branch from 4a2f071 to 700cc4a Compare March 20, 2026 01:08
sh4shv4t and others added 3 commits March 20, 2026 07:18
Signed-off-by: sh4shv4t <shashvat.k.singh.16@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Signed-off-by: Shashvat Singh <145356337+sh4shv4t@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

chore(sdk): Migrate Python dependency management to uv workspaces

2 participants