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
4 changes: 4 additions & 0 deletions src/dagster_ray/_base/cluster_sharing_lock.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ class ClusterSharingLock(BaseModel):
def identifier(self) -> str:
return f"{self.run_id}-{self.step_key}"

@property
def tag(self) -> str:
return f"dagster/lock-{self.identifier}"[:63] # 63 is the limit for k8s

@property
def expired_at(self) -> datetime:
return self.created_at + timedelta(seconds=self.ttl_seconds)
Expand Down
2 changes: 1 addition & 1 deletion src/dagster_ray/kuberay/resources/raycluster.py
Original file line number Diff line number Diff line change
Expand Up @@ -266,7 +266,7 @@ def get_sharing_lock_annotations(self, context: AnyDagsterContext) -> dict[str,
ttl_seconds=self.cluster_sharing.ttl_seconds,
created_at=datetime.now(),
)
annotations[f"dagster/lock-{lock.identifier}"] = lock.model_dump_json()
annotations[lock.tag] = lock.model_dump_json()
return annotations

def get_cluster_sharing_alive_locks(self, context: AnyDagsterContext) -> Sequence[ClusterSharingLock]:
Expand Down
2 changes: 1 addition & 1 deletion src/dagster_ray/kuberay/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ def normalize_k8s_label_values(labels: dict[str, str]) -> dict[str, str]:
- Max 63 characters
- Empty string is valid

Additionally, key starting with `dagster/` are replaced with `dagster.io/`
Additionally, key starting with `dagster.io/` are replaced with `dagster/`
"""
normalized = {}

Expand Down