forked from ray-project/ray
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[workflow] Update workflow doc and examples (ray-project#24804)
* update doc of workflow options * update examples and make sure they are working
- Loading branch information
Showing
17 changed files
with
110 additions
and
54 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
python/ray/workflow/examples/comparisons/argo/dag_workflow.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
import ray | ||
from ray import workflow | ||
|
||
|
||
@workflow.step | ||
@ray.remote | ||
def echo(msg: str, *deps) -> None: | ||
print(msg) | ||
|
||
|
||
if __name__ == "__main__": | ||
workflow.init() | ||
A = echo.options(name="A").step("A") | ||
B = echo.options(name="B").step("B", A) | ||
C = echo.options(name="C").step("C", A) | ||
D = echo.options(name="D").step("D", A, B) | ||
D.run() | ||
A = echo.options(**workflow.options(name="A")).bind("A") | ||
B = echo.options(**workflow.options(name="B")).bind("B", A) | ||
C = echo.options(**workflow.options(name="C")).bind("C", A) | ||
D = echo.options(**workflow.options(name="D")).bind("D", A, B) | ||
workflow.create(D).run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
14 changes: 7 additions & 7 deletions
14
python/ray/workflow/examples/comparisons/argo/multi_step_workflow.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
import ray | ||
from ray import workflow | ||
|
||
|
||
@workflow.step | ||
@ray.remote | ||
def hello(msg: str, *deps) -> None: | ||
print(msg) | ||
|
||
|
||
@workflow.step | ||
@ray.remote | ||
def wait_all(*args) -> None: | ||
pass | ||
|
||
|
||
if __name__ == "__main__": | ||
workflow.init() | ||
h1 = hello.options(name="hello1").step("hello1") | ||
h2a = hello.options(name="hello2a").step("hello2a") | ||
h2b = hello.options(name="hello2b").step("hello2b", h2a) | ||
wait_all.step(h1, h2b).run() | ||
h1 = hello.options(**workflow.options(name="hello1")).bind("hello1") | ||
h2a = hello.options(**workflow.options(name="hello2a")).bind("hello2a") | ||
h2b = hello.options(**workflow.options(name="hello2b")).bind("hello2b", h2a) | ||
workflow.create(wait_all.bind(h1, h2b)).run() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.