Skip to content

Commit

Permalink
ruff format
Browse files Browse the repository at this point in the history
Signed-off-by: Jan Fiedler <[email protected]>
  • Loading branch information
fiedlerNr9 committed Jan 3, 2025
1 parent 3f58b60 commit 13c7847
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions examples/ray_plugin/ray_plugin/ray_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,28 @@ def ray_task(n: int) -> typing.List[int]:
from flytekit.core.resources import pod_spec_from_resources

ray_config = RayJobConfig(
head_node_config=HeadNodeConfig(ray_start_params={"log-color": "True"}, k8s_pod=K8sPod(pod_spec=pod_spec_from_resources(k8s_pod_name="ray-head", requests=Resources(cpu="4",mem="5Gi")))),
worker_node_config=[WorkerNodeConfig(group_name="ray-group", replicas=1, k8s_pod=K8sPod(pod_spec=pod_spec_from_resources(k8s_pod_name="ray-worker", requests=Resources(cpu="1",mem="1Gi"))))],
head_node_config=HeadNodeConfig(
ray_start_params={"log-color": "True"},
k8s_pod=K8sPod(
pod_spec=pod_spec_from_resources(k8s_pod_name="ray-head", requests=Resources(cpu="4", mem="5Gi"))
),
),
worker_node_config=[
WorkerNodeConfig(
group_name="ray-group",
replicas=1,
k8s_pod=K8sPod(
pod_spec=pod_spec_from_resources(k8s_pod_name="ray-worker", requests=Resources(cpu="1", mem="1Gi"))
),
)
],
runtime_env={"pip": ["numpy", "pandas"]}, # or runtime_env="./requirements.txt"
enable_autoscaling=True,
shutdown_after_job_finishes=True,
ttl_seconds_after_finished=3600,
)


# Lastly, define a workflow to call the Ray task.
# %%
@workflow
Expand Down

0 comments on commit 13c7847

Please sign in to comment.