Skip to content

Commit

Permalink
[jobs] allow for null schedule_state (skypilot-org#4588)
Browse files Browse the repository at this point in the history
* [jobs] allow for null schedule_state

* Update sky/jobs/state.py

Co-authored-by: Zhanghao Wu <[email protected]>

* add to docstring

---------

Co-authored-by: Zhanghao Wu <[email protected]>
  • Loading branch information
cg505 and Michaelvll authored Jan 18, 2025
1 parent 6b23582 commit 11861fd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions sky/jobs/state.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,8 @@ def failure_statuses(cls) -> List['ManagedJobStatus']:
class ManagedJobScheduleState(enum.Enum):
"""Captures the state of the job from the scheduler's perspective.
A job that predates the introduction of the scheduler will be INVALID.
A newly created job will be INACTIVE. The following transitions are valid:
- INACTIVE -> WAITING: The job is "submitted" to the scheduler, and its job
controller can be started.
Expand Down Expand Up @@ -342,6 +344,10 @@ class ManagedJobScheduleState(enum.Enum):
briefly observe inconsistent states, like a job that just finished but
hasn't yet transitioned to DONE.
"""
# This job may have been created before scheduler was introduced in #4458.
# This state is not used by scheduler but just for backward compatibility.
# TODO(cooperc): remove this in v0.11.0
INVALID = None
# The job should be ignored by the scheduler.
INACTIVE = 'INACTIVE'
# The job is waiting to transition to LAUNCHING for the first time. The
Expand Down

0 comments on commit 11861fd

Please sign in to comment.