Skip to content

Commit

Permalink
Merge pull request #16707 from martenson/wfi-fastapi
Browse files Browse the repository at this point in the history
port invocation API to fastapi
  • Loading branch information
mvdbeek authored Jan 1, 2024
2 parents 5e7401a + 6d45249 commit 35918d9
Show file tree
Hide file tree
Showing 9 changed files with 5,077 additions and 2,723 deletions.
6,717 changes: 4,254 additions & 2,463 deletions client/src/api/schema/schema.ts

Large diffs are not rendered by default.

24 changes: 8 additions & 16 deletions lib/galaxy/model/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,11 @@
from galaxy.model.orm.now import now
from galaxy.model.orm.util import add_object_to_object_session
from galaxy.objectstore import ObjectStore
from galaxy.schema.invocation import InvocationCancellationUserRequest
from galaxy.schema.invocation import (
InvocationCancellationUserRequest,
InvocationState,
InvocationStepState,
)
from galaxy.schema.schema import (
DatasetCollectionPopulatedState,
DatasetState,
Expand Down Expand Up @@ -8261,14 +8265,7 @@ class WorkflowInvocation(Base, UsesCreateAndUpdateTime, Dictifiable, Serializabl
"state",
]

class states(str, Enum):
NEW = "new" # Brand new workflow invocation... maybe this should be same as READY
READY = "ready" # Workflow ready for another iteration of scheduling.
SCHEDULED = "scheduled" # Workflow has been scheduled.
CANCELLED = "cancelled"
CANCELLING = "cancelling" # invocation scheduler will cancel job in next iteration
FAILED = "failed"

states = InvocationState
non_terminal_states = [states.NEW, states.READY]

def create_subworkflow_invocation_for_step(self, step):
Expand Down Expand Up @@ -8311,7 +8308,7 @@ def active(self):
states = WorkflowInvocation.states
return self.state in [states.NEW, states.READY]

def set_state(self, state: "WorkflowInvocation.states"):
def set_state(self, state: InvocationState):
session = object_session(self)
priority_states = (WorkflowInvocation.states.CANCELLING, WorkflowInvocation.states.CANCELLED)
if session and self.id and state not in priority_states:
Expand Down Expand Up @@ -8902,12 +8899,7 @@ class WorkflowInvocationStep(Base, Dictifiable, Serializable):
"action",
]

class states(str, Enum):
NEW = "new" # Brand new workflow invocation step
READY = "ready" # Workflow invocation step ready for another iteration of scheduling.
SCHEDULED = "scheduled" # Workflow invocation step has been scheduled.
# CANCELLED = 'cancelled', TODO: implement and expose
# FAILED = 'failed', TODO: implement and expose
states = InvocationStepState

@property
def is_new(self):
Expand Down
Loading

0 comments on commit 35918d9

Please sign in to comment.