Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ jobs:
- .github/workflows/CI.yml
- 'src/dagster_ray/**'
- 'tests/**'
- 'examples/**'
- 'examples/**/*.py'
- pyproject.toml
- uv.lock
- .pre-commit-config.yaml
Expand Down
2 changes: 1 addition & 1 deletion docs/api/kuberay.md
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ These resources initialize Ray client connection with a remote cluster.

A Dagster sensor that monitors shared `RayCluster` resources created by the current Dagster [code location](https://docs.dagster.io/deployment/code-locations/managing-code-locations-with-definitions) (with a `dagster/code-location=<current-code-location>` label selector) and submits jobs to delete clusters either:
- use [Cluster Sharing](../tutorial/kuberay.md#cluster-sharing) (`dagster/cluster-sharing=true`) and have expired
- are older than `DAGSTER_RAY_CLUSTER_EXPIRATION_SECONDS` (defaults to 24 hours)
- are older than `DAGSTER_RAY_CLUSTER_EXPIRATION_SECONDS` (defaults to 4 hours)

By default it monitors the `ray` namespace. This can be configured by setting `DAGSTER_RAY_NAMESPACES` (accepts a comma-separated list of namespaces).

Expand Down
2 changes: 1 addition & 1 deletion src/dagster_ray/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
DAGSTER_RAY_NAMESPACES_ENV_VAR = "DAGSTER_RAY_NAMESPACES"
DAGSTER_RAY_NAMESPACES_DEFAULT_VALUE = "ray"
DAGSTER_RAY_CLUSTER_EXPIRATION_SECONDS_ENV_VAR = "DAGSTER_RAY_CLUSTER_EXPIRATION_SECONDS"
DAGSTER_RAY_CLUSTER_EXPIRATION_SECONDS_DEFAULT_VALUE = str(24 * 60 * 60)
DAGSTER_RAY_CLUSTER_EXPIRATION_SECONDS_DEFAULT_VALUE = str(4 * 60 * 60)


class Lifecycle(dg.Config):
Expand Down
2 changes: 1 addition & 1 deletion src/dagster_ray/kuberay/configs.py
Original file line number Diff line number Diff line change
Expand Up @@ -309,7 +309,7 @@ class MatchDagsterLabels(dg.Config):
)


DEFAULT_CLUSTER_SHARING_TTL_SECONDS = 60 * 60.0
DEFAULT_CLUSTER_SHARING_TTL_SECONDS = 30 * 60.0


class ClusterSharing(dg.Config):
Expand Down
2 changes: 1 addition & 1 deletion src/dagster_ray/kuberay/sensors.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def cleanup_expired_kuberay_clusters(
) -> Generator[dg.RunRequest | dg.SkipReason, None, None]:
f"""A Dagster sensor that monitors shared `RayCluster` resources created by the current code location and submits jobs to delete clusters that either:
- use [Cluster Sharing](../tutorial/#cluster-sharing) (`dagster/cluster-sharing=true`) and have expired
- are older than `DAGSTER_RAY_CLUSTER_EXPIRATION_SECONDS` (defaults to 24 hours)
- are older than `DAGSTER_RAY_CLUSTER_EXPIRATION_SECONDS` (defaults to 4 hours)
By default it monitors the `ray` namespace. This can be configured by setting `{DAGSTER_RAY_NAMESPACES_ENV_VAR}` (accepts a comma-separated list of namespaces)."""
assert context.code_location_origin is not None
Expand Down
2 changes: 1 addition & 1 deletion tests/kuberay/test_raycluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -456,7 +456,7 @@ def my_asset(context: dg.AssetExecutionContext, ray_cluster: RayResource):
):
assert isinstance(item, dg.RunRequest)
assert (
item.run_config["ops"]["delete_kuberay_clusters"]["config"]["clusters"][0]["name"]
item.run_config["ops"]["delete_kuberay_clusters_op"]["config"]["clusters"][0]["name"]
== cluster["metadata"]["name"]
)

Expand Down