Skip to content

Conversation

@sduvvuri1603
Copy link

@sduvvuri1603 sduvvuri1603 commented Dec 2, 2025

Summary

  • add scripts/compile_check.py to discover metadata-based components/pipelines, validate dependency specs, and compile each target with the KFP SDK

  • add scripts/test_compile_check.py(Unit Tests) to exercise a passing component and an invalid dependency case in a temporary repo layout

  • wire .github/workflows/compile-and-deps.yml so every PR runs the compile checker and its unit tests on Python 3.10 using uv

Testing

  • Ran the compile checker locally (scripts/compile_check.py --tier all --verbose) to confirm metadata discovery and compilation logic succeeds after the PyYAML install fix—no targets yet, so it exits cleanly.
  • Executed the unit suite (python -m pytest) in a virtualenv; both scenarios in scripts/test_compile_check.py pass (valid component compiles, malformed dependency is rejected). This also proves the __init__.py import fallback works when pytest imports the package directly.

@hbelmiro
Copy link
Contributor

hbelmiro commented Dec 3, 2025

/ok-to-test

@sduvvuri1603 sduvvuri1603 force-pushed the feature/compile-check-ci branch 3 times, most recently from 4f3a624 to 0abdee9 Compare December 4, 2025 19:59
@sduvvuri1603 sduvvuri1603 marked this pull request as ready for review December 4, 2025 20:46
@sduvvuri1603 sduvvuri1603 marked this pull request as draft December 5, 2025 21:38
@sduvvuri1603 sduvvuri1603 force-pushed the feature/compile-check-ci branch 2 times, most recently from 68cbff0 to 31c36f0 Compare December 8, 2025 16:54
@sduvvuri1603 sduvvuri1603 marked this pull request as ready for review December 8, 2025 16:55
@@ -0,0 +1,382 @@
#!/usr/bin/env python3
Copy link
Contributor

Choose a reason for hiding this comment

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

Could you move this script and its test to .github/scripts by following this- https://github.com/kubeflow/pipelines-components/blob/main/.github/scripts/README.md

Copy link
Author

Choose a reason for hiding this comment

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

Sure, moved it to .github/scripts

run: |
python scripts/compile_check.py --tier all

- name: Run unit tests
Copy link
Contributor

Choose a reason for hiding this comment

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

Once you move the compile_check.py and test_compile_check.py to .github/scripts, you can remove this step, since https://github.com/kubeflow/pipelines-components/blob/main/.github/workflows/scripts-tests.yml takes care of running the tests under .github/scripts

Copy link
Author

Choose a reason for hiding this comment

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

Done, moved both scripts to .github/scripts and removed the step mentioned

@sduvvuri1603 sduvvuri1603 force-pushed the feature/compile-check-ci branch 3 times, most recently from ba47cce to 57fedc5 Compare December 13, 2025 00:59
from pathlib import Path
from typing import Dict, Iterable, List, Optional, Sequence, Tuple

try:
Copy link
Contributor

Choose a reason for hiding this comment

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

The try-except block can be removed, since pyyaml is a required dependency listed in pyproject.toml.

Copy link
Author

Choose a reason for hiding this comment

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

Removed the block and pushed updated changes

@sduvvuri1603 sduvvuri1603 force-pushed the feature/compile-check-ci branch from 17b3c4e to 0950e84 Compare December 19, 2025 18:23
@sduvvuri1603
Copy link
Author

/retest

@sduvvuri1603 sduvvuri1603 force-pushed the feature/compile-check-ci branch 2 times, most recently from 1e1873c to 8633626 Compare December 19, 2025 18:58
@sduvvuri1603 sduvvuri1603 marked this pull request as draft December 19, 2025 18:59
@sduvvuri1603 sduvvuri1603 force-pushed the feature/compile-check-ci branch 5 times, most recently from 228f419 to f5080c8 Compare December 19, 2025 19:38
@sduvvuri1603 sduvvuri1603 marked this pull request as ready for review December 19, 2025 19:38
on:
pull_request:
branches:
- main
Copy link
Contributor

Choose a reason for hiding this comment

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

could you add the required path filters to trigger this workflow-
paths:
- 'components/'
- 'pipelines/
'
- '.github/scripts/compile_check/'
- '.github/workflows/compile-and-deps.yml'
- '.github/actions/setup-python-ci/
'
- 'pyproject.toml'
- 'uv.lock'

"""Parse command-line arguments for the compile check tool."""
parser = argparse.ArgumentParser(description="Compile Kubeflow components and pipelines.")
parser.add_argument(
"--tier",
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can remove the tier filtering since we are not going to have third party components or pipelines.

Copy link
Author

Choose a reason for hiding this comment

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

removed tier filtering accordingly

@sduvvuri1603 sduvvuri1603 force-pushed the feature/compile-check-ci branch from 99c0e3e to 0a5fdb1 Compare December 23, 2025 15:46
@sduvvuri1603 sduvvuri1603 force-pushed the feature/compile-check-ci branch from cc6afeb to 96403fe Compare December 23, 2025 16:00
@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 vaniharipriya 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

)
return component_dir

def test_successful_compile(self) -> None:
Copy link
Contributor

@VaniHaripriya VaniHaripriya Jan 5, 2026

Choose a reason for hiding this comment

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

Could add a test for pipeline compilation, invalid component and pipeline.

@VaniHaripriya
Copy link
Contributor

@sduvvuri1603 Could you create a sample run for the new workflow.

import traceback
from dataclasses import dataclass, field
from pathlib import Path
from typing import Dict, Iterable, List, Optional, Sequence, Tuple
Copy link
Contributor

Choose a reason for hiding this comment

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

To keep it consistent wherever it is applicable,please update imports to use built-in generic types for Python 3.9+: Dict → dict, List → list, Tuple → tuple .

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.

3 participants