Skip to content

Commit c874331

Browse files
committed
feat: introduce JobSpec.id property
This is intended to uniquely disambiguate a job. It is exposed as a property so it can be easily changed throughout all the new async scheduler and runtime backend internals in a single place if it needs to change in the future (e.g. if the `full_name` no longer becomes enough to uniquely disambiguate a job, and a tuple of more information is needed). Signed-off-by: Alex Jones <alex.jones@lowrisc.org>
1 parent 63e8d12 commit c874331

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

src/dvsim/job/data.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -117,6 +117,12 @@ class JobSpec(BaseModel):
117117
fail_patterns: Sequence[str]
118118
"""regex patterns to match on to determine if the job has failed."""
119119

120+
@property
121+
def id(self) -> str:
122+
"""Returns a string that uniquely identifies this job."""
123+
# The full name disambiguates jobs, so `id` is just an alias here.
124+
return self.full_name
125+
120126
@property
121127
def timeout_secs(self) -> int | None:
122128
"""Returns the timeout applied to the launched job, in seconds."""

0 commit comments

Comments
 (0)