Skip to content

Commit

Permalink
wait until RayCluster is ready
Browse files Browse the repository at this point in the history
  • Loading branch information
danielgafni committed Sep 16, 2024
1 parent 5c09f36 commit f863da4
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 3 deletions.
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,9 @@ def my_asset(context: AssetExecutionContext, pipes_rayjob_client: PipesRayJobCli
pipes_rayjob_client.run(
context=context,
ray_job={
# RayJob manifest goes here, only .metadata.name is not required and will be generated if not provided
# RayJob manifest goes here
# .metadata.name is not required and will be generated if not provided
# *.container.image is not required and will be set to the current `dagster/image` tag if not provided
# full reference: https://ray-project.github.io/kuberay/reference/api/#rayjob
...
},
Expand Down
4 changes: 2 additions & 2 deletions dagster_ray/kuberay/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"env": [],
"envFrom": [],
"resources": {
"limits": {"cpu": "1000m", "memory": "1Gi"},
"requests": {"cpu": "1000m", "memory": "1Gi"},
"limits": {"cpu": "50m", "memory": "0.1Gi"},
"requests": {"cpu": "50m", "memory": "0.1Gi"},
},
}
DEFAULT_HEAD_GROUP_SPEC = {
Expand Down
9 changes: 9 additions & 0 deletions dagster_ray/kuberay/pipes.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,15 @@ def _start(self, context: OpExecutionContext, ray_job: Dict[str, Any]) -> Dict[s
namespace=ray_job["metadata"]["namespace"],
)

self.client.ray_cluster_client.wait_until_ready(
name=self.client.get_ray_cluster_name(
name=name,
namespace=namespace,
),
namespace=namespace,
timeout=self.timeout,
)

self.client.wait_until_running(
name=name,
namespace=namespace,
Expand Down

0 comments on commit f863da4

Please sign in to comment.