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

Ray Task Support #1093

Merged
merged 31 commits into from
Aug 10, 2022
Merged

Ray Task Support #1093

merged 31 commits into from
Aug 10, 2022

Conversation

pingsutw
Copy link
Member

@pingsutw pingsutw commented Jul 5, 2022

TL;DR

Flyte ray task contains Ray Cluster Config that will be used by propeller to create a Ray cluster.

There are three ways to run Ray job

  1. submit to the existing cluster
import typing
import ray
from flytekit import task, workflow, Resources
from flytekitplugins.ray import RayJobConfig, WorkerNodeConfig, HeadNodeConfig

@ray.remote
def f(x):
    return x * x

@task(task_config=RayJobConfig(
    address=<RAY_CLUSTER_ADDRESS>
    runtime_env={"pip": ["numpy", "pandas"]})
)
def ray_task() -> typing.List[int]:
    futures = [f.remote(i) for i in range(5)]
    return ray.get(futures)
  1. Running the below task locally, and flyte will create a local Ray cluster
  2. Running the below task in Flyte Cluster, Flyte will create a RayJob CR in Kubernetes.
@task(task_config=RayJobConfig(
    worker_node_config=[WorkerNodeConfig(group_name="test-group", replicas=10)],
)
def ray_task() -> typing.List[int]:
    futures = [f.remote(i) for i in range(5)]
    return ray.get(futures)

Type

  • Bug Fix
  • Feature
  • Plugin

Are all requirements met?

  • Code completed
  • Smoke tested
  • Unit tests added
  • Code documentation added
  • Any pending items have an associated Issue

Complete description

How did you fix the bug, make the feature etc. Link to any design docs etc

Tracking Issue

flyteorg/flyte#2641

Follow-up issue

NA

pingsutw added 8 commits May 23, 2022 15:34
Signed-off-by: Kevin <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw marked this pull request as draft July 5, 2022 14:23
pingsutw added 3 commits July 5, 2022 22:25
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@codecov
Copy link

codecov bot commented Jul 5, 2022

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 68.25%. Comparing base (a968a5a) to head (444bd49).
Report is 1018 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff             @@
##           master    #1093       +/-   ##
===========================================
- Coverage   86.67%   68.25%   -18.43%     
===========================================
  Files         269      287       +18     
  Lines       25074    25814      +740     
  Branches     2826     2884       +58     
===========================================
- Hits        21734    17620     -4114     
- Misses       2871     7717     +4846     
- Partials      469      477        +8     

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

Signed-off-by: Kevin Su <[email protected]>
@kumare3
Copy link
Contributor

kumare3 commented Jul 13, 2022

looks pretty good

pingsutw added 9 commits July 19, 2022 16:14
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
pingsutw added 3 commits July 26, 2022 21:39
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
pingsutw added 3 commits July 28, 2022 14:16
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw marked this pull request as ready for review July 28, 2022 13:45
Signed-off-by: Kevin Su <[email protected]>
@wild-endeavor
Copy link
Contributor

trying to be better about pr comments - since this is a new feature/integration, can you write a couple examples and put them in the pr description? we'll need the examples for the documentation in any case so it's not wasted work.

Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
Signed-off-by: Kevin Su <[email protected]>
@pingsutw pingsutw merged commit 73eaad1 into master Aug 10, 2022
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.

4 participants