Skip to content

Commit

Permalink
document the ray ttl_seconds_after_finished
Browse files Browse the repository at this point in the history
Signed-off-by: Kevin Su <[email protected]>
  • Loading branch information
pingsutw committed Aug 5, 2024
1 parent c8fed8b commit 105cd09
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions examples/ray_plugin/ray_plugin/ray_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,13 +55,16 @@ def f(x):
# - `replicas`: Specifies the desired number of replicas for the worker group. The default is 1.
# - `group_name`: A RayCluster can host multiple worker groups, each differentiated by its name.
# - `runtime_env`: The [runtime environment](https://docs.ray.io/en/latest/ray-core/handling-dependencies.html#runtime-environments)
# - `ttl_seconds_after_finished`: Shutdown Ray cluster after 1 hour of inactivity.
# definition outlines the necessary dependencies for your Ray application to function.
# This environment is dynamically installed on the cluster at runtime.
# %%
ray_config = RayJobConfig(
head_node_config=HeadNodeConfig(ray_start_params={"log-color": "True"}),
worker_node_config=[WorkerNodeConfig(group_name="ray-group", replicas=1)],
runtime_env={"pip": ["numpy", "pandas"]}, # or runtime_env="./requirements.txt"
shutdown_after_job_finishes=True,
ttl_seconds_after_finished=3600,
)


Expand Down

0 comments on commit 105cd09

Please sign in to comment.