Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[KFP] Obtain the Ray cluster run ID from the user for KFP v2. #956

Open
wants to merge 8 commits into
base: dev
Choose a base branch
from

Conversation

revit13
Copy link
Collaborator

@revit13 revit13 commented Jan 20, 2025

Why are these changes needed?

In KFPv2 dsl.RUN_ID_PLACEHOLDER is deprecated and cannot be used since SDK 2.5.0. On another hand we cannot create
a unique string in a component (at runtime) and pass it to the clean_up_task of ExitHandler, due to
kubeflow/pipelines#10187.
Therefore, meantime the user is requested to insert a unique Ray cluster name at Run creation time.

@revit13 revit13 marked this pull request as draft January 20, 2025 12:03
Signed-off-by: Revital Sur <[email protected]>
Signed-off-by: Revital Sur <[email protected]>
Signed-off-by: Revital Sur <[email protected]>
Signed-off-by: Revital Sur <[email protected]>
Signed-off-by: Revital Sur <[email protected]>
@revit13 revit13 marked this pull request as ready for review January 22, 2025 11:17
@revit13 revit13 requested a review from roytman January 22, 2025 11:18
@roytman
Copy link
Member

roytman commented Jan 22, 2025

Please update the PR explanation:
"meantime the user is requested to insert a unique string created at compilation time." -> "meantime the user is requested to insert a unique Ray cluster name at Run creation time."

# In KFPv2 dsl.RUN_ID_PLACEHOLDER is deprecated and cannot be used since SDK 2.5.0. On another hand we cannot create
# a unique string in a component (at runtime) and pass it to the `clean_up_task` of `ExitHandler`, due to
# https://github.com/kubeflow/pipelines/issues/10187. Therefore, meantime the user is requested to insert
# a unique string created at compilation time.
Copy link
Member

Choose a reason for hiding this comment

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

at run creation time

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed. Thanks

"same version of the same pipeline !!!")
run_id = ray_id_KFPv2
else:
run_id = dsl.RUN_ID_PLACEHOLDER
Copy link
Member

Choose a reason for hiding this comment

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

the next line uses dsl.RUN_ID_PLACEHOLDER ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed. Thanks

func=compute_exec_params_func, base_image=base_kfp_image
)
else:
compute_exec_params_op = comp.create_component_from_func(func=compute_exec_params_func, base_image=base_kfp_image)
# create Ray cluster
create_ray_op = comp.load_component_from_file("../../../kfp_ray_components/createRayComponent.yaml")
Copy link
Member

Choose a reason for hiding this comment

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

should it be component_spec_path + "createRayClusterComponent.yaml"
and below

@@ -57,11 +57,16 @@ Ray cluster. For each step we have to define a component that will execute them:
```python
# components
base_kfp_image = "quay.io/dataprep1/data-prep-kit/kfp-data-processing:0.0.2"
Copy link
Member

Choose a reason for hiding this comment

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

is it the correct image name?

@@ -107,6 +112,7 @@ The input parameters section defines all the parameters required for the pipelin
The parameters used here are as follows:

* ray_name: name of the Ray cluster
* ray_run_id_KFPv2: Ray cluster unique ID used only in KFP v2
Copy link
Member

Choose a reason for hiding this comment

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

it is not in the pipeline parameters; it should be around line 91

@@ -111,9 +99,11 @@ def {{ pipeline_name }}(
ray_name: str = "{{ pipeline_name }}-kfp-ray", # name of Ray cluster
# Add image_pull_secret and image_pull_policy to ray workers if needed
{%- if image_pull_secret != "" %}
ray_run_id_KFPv2: str = "",
Copy link
Member

Choose a reason for hiding this comment

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

why do we need to define it twice? Here and at L 106?

@@ -139,6 +128,7 @@ def code2parquet(
"""
Pipeline to execute NOOP transform
:param ray_name: name of the Ray cluster
:param ray_run_id_KFPv2: string holding the id used for the Ray cluster used only in KFP v2
Copy link
Member

Choose a reason for hiding this comment

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

maybe a unique string id, ..."

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.

2 participants