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

Decouple ray submitter, worker, and head resources #2924

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

Sovietaced
Copy link
Contributor

@Sovietaced Sovietaced commented Nov 13, 2024

Tracking issue

Related to flyteorg/flyte#5666

Why are the changes needed?

These changes update the flytekit-ray package such that users can configure pod specs for worker and head workloads.

What changes were proposed in this pull request?

Updating the version of flyteidl and plumb k8s pods through worker and head config.

How was this patch tested?

See unit tests.

Check all the applicable boxes

  • I updated the documentation accordingly.
  • All new and existing tests passed.
  • All commits are signed-off.

Related PRs

flyteorg/flyte#5933

@Sovietaced Sovietaced changed the title wip Decouple ray submitter, worker, and head resources Nov 13, 2024
Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 79.31%. Comparing base (8feb3b8) to head (185ba39).
Report is 3 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #2924       +/-   ##
===========================================
- Coverage   94.25%   79.31%   -14.94%     
===========================================
  Files          18      199      +181     
  Lines        1358    20853    +19495     
  Branches        0     2684     +2684     
===========================================
+ Hits         1280    16540    +15260     
- Misses         78     3564     +3486     
- Partials        0      749      +749     

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

self,
metadata: K8sObjectMetadata = None,
pod_spec: typing.Dict[str, typing.Any] = None,
data_config: typing.Optional[DataLoadingConfig] = None,
Copy link
Contributor

Choose a reason for hiding this comment

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

drop this. Also why add this K8s pod. We dont need that, as Ray config will simply float like a json. So just use K8s pod object?

Copy link
Contributor

Choose a reason for hiding this comment

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

we can keep the k8s pod too, i see that you are actually setting the pod properties.
This way we could also use pod template?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yeah we had a discussion about this on the backend change here: flyteorg/flyte#5933 (comment)

It started as just adding support for resources but we realized it would be more flexible if we added support for something similar to a pod template since that is ultimately what the kuberay contract is.

@@ -89,7 +92,9 @@ def get_custom(self, settings: SerializationSettings) -> Optional[Dict[str, Any]
ray_job = RayJob(
ray_cluster=RayCluster(
head_group_spec=(
HeadGroupSpec(cfg.head_node_config.ray_start_params) if cfg.head_node_config else None
HeadGroupSpec(cfg.head_node_config.ray_start_params, cfg.head_node_config.k8s_pod)
Copy link
Contributor

Choose a reason for hiding this comment

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

IMO this is not great
cc @EngHabu @pingsutw
I would have loved us to model it more like a json so that modifying it would be faster without needing a protobuf change.

But i see what you are doing now

Copy link
Contributor

Choose a reason for hiding this comment

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

but i donot want to block. I see that we have backend ray plugin proto already.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I appreciate it thank you.

@@ -1018,7 +1018,7 @@ def data_config(self) -> typing.Optional[DataLoadingConfig]:

def to_flyte_idl(self) -> _core_task.K8sPod:
return _core_task.K8sPod(
metadata=self._metadata.to_flyte_idl(),
metadata=self._metadata.to_flyte_idl() if self.metadata else None,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Handles cases where metadata is None

@eapolinario eapolinario merged commit 73dea5b into flyteorg:master Nov 15, 2024
105 of 106 checks passed
Copy link

welcome bot commented Nov 15, 2024

Congrats on merging your first pull request! 🎉

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.

3 participants