Skip to content

Conversation

@DharmitD
Copy link
Member

@DharmitD DharmitD commented Oct 30, 2024

Description of your changes:
This PR introduces semaphoreKey and mutexName fields in PipelineConfig to support pipeline-level concurrency controls in KFP SDK.

This PR should be merged only after #11384 gets merged.

Testing instructions

Create a Python virtualenv and install the SDK and IR YAML API packages locally:

$ python -m venv .venv
$ source .venv/bin/activate
$ pip install wheel setuptools protobuf grpcio grpcio-tools
$ pip install -r sdk/python/requirements-dev.txt
$ pip install -e api/v2alpha1/python
$ pip install -e sdk/python

Use the example code to compile

$ kfp dsl compile --py main.py --output main.yaml

You should be able to compile and find the following snippet in the main.yaml file:

---
platforms:
  kubernetes:
    pipelineConfig:
      mutexName: mutex
      semaphoreKey: semaphore

Checklist:

@gregsheremeta
Copy link
Contributor

couple nitpicks but overall lgtm.

I don't want to merge it until the backend PR is posted and close to shipping.

@DharmitD DharmitD force-pushed the semaphore-mutex branch 3 times, most recently from c3178ce to 15b89b0 Compare October 30, 2024 22:45
Copy link
Contributor

@gregsheremeta gregsheremeta left a comment

Choose a reason for hiding this comment

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

/hold

lgtm but let's wait until the backend PR is ready to go too
edit: need to use the right protoc version when generating the pipeline_spec files

@DharmitD DharmitD force-pushed the semaphore-mutex branch 2 times, most recently from 39665e1 to 8ef1f2d Compare October 31, 2024 18:45
@github-actions github-actions bot added ci-passed All CI tests on a pull request have passed and removed ci-passed All CI tests on a pull request have passed labels Oct 31, 2024
@HumairAK
Copy link
Collaborator

HumairAK commented Nov 4, 2024

can we add a test where we verify the semaphore setting compiles to the expected IR?

@DharmitD
Copy link
Member Author

Edit: Updated to have the DSL generated SemaphoreKey instead of SemaphoreName field, since having a fixed, hardcoded semaphore name and letting users define the semaphore key is the format prescribed in Argo Workflows' synchronization docs here.

@github-actions github-actions bot added the ci-passed All CI tests on a pull request have passed label Nov 14, 2024
@gregsheremeta
Copy link
Contributor

can we add a test where we verify the semaphore setting compiles to the expected IR?

still need to do this. Here's an example:
https://github.com/kubeflow/pipelines/pull/10913/files#diff-cac76397fcf6a375f3865a864a3f6725b023c69b5216fa1ed71a86b334641399

@DharmitD
Copy link
Member Author

can we add a test where we verify the semaphore setting compiles to the expected IR?

still need to do this. Here's an example: https://github.com/kubeflow/pipelines/pull/10913/files#diff-cac76397fcf6a375f3865a864a3f6725b023c69b5216fa1ed71a86b334641399

Yes I'm working on this ATM. I'm adding a unit test to the compiler_test.py similar to the platform tests here:

def test_one_task_one_platform(self):

Have a draft ready, testing locally and pushing it in a bit.

@github-actions github-actions bot added ci-passed All CI tests on a pull request have passed and removed ci-passed All CI tests on a pull request have passed labels Nov 14, 2024
@google-oss-prow google-oss-prow bot removed the size/M label Nov 14, 2024
@DharmitD DharmitD force-pushed the semaphore-mutex branch 2 times, most recently from a0e94f1 to 32f5d01 Compare September 24, 2025 17:30
@DharmitD DharmitD force-pushed the semaphore-mutex branch 6 times, most recently from f14c9a5 to 3c42c15 Compare September 25, 2025 14:47
Signed-off-by: ddalvi <[email protected]>

Add tests to verify setting of SemaphoreKey and MutexName fields in DSL

Signed-off-by: ddalvi <[email protected]>

Implement getter setter functions with latest Pythonic properties

Signed-off-by: ddalvi <[email protected]>
Copy link
Collaborator

@mprahl mprahl left a comment

Choose a reason for hiding this comment

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

/approve
/lgtm
/hold for @gmfrasca to review again

@google-oss-prow
Copy link

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mprahl

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

The pull request process is described here

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

Copy link
Member

@gmfrasca gmfrasca left a comment

Choose a reason for hiding this comment

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

/lgtm
/unhold

@google-oss-prow google-oss-prow bot merged commit e4efd5b into kubeflow:master Sep 26, 2025
38 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved ci-passed All CI tests on a pull request have passed lgtm size/L

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants