Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update run mode in schema #609

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
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
28 changes: 3 additions & 25 deletions cylc/uiserver/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,11 @@
STRIP_NULL_DEFAULT,
Subscriptions,
WorkflowID,
WorkflowRunMode as RunMode,
_mut_field,
sstrip,
get_nodes_all
)
from cylc.flow.util import sstrip
from cylc.uiserver.resolvers import (
Resolvers,
list_log_files,
Expand Down Expand Up @@ -81,29 +82,6 @@ async def mutator(
return GenericResponse(result=res)


class RunMode(graphene.Enum):
"""The mode to run a workflow in."""

Live = 'live'
Dummy = 'dummy'
DummyLocal = 'dummy-local'
Simulation = 'simulation'

@property
def description(self):
if self == RunMode.Live:
return 'The normal default run mode'
if self == RunMode.Dummy:
return 'Replaces all *-script items with nothing'
if self == RunMode.DummyLocal:
return (
'Replaces all *-script items with nothing and sets'
' platform = localhost for all tasks.'
)
if self == RunMode.Simulation:
return 'Simulates job submission, does not run anything at all.'


class CylcVersion(graphene.String):
"""A Cylc version identifier e.g. 8.0.0"""

Expand Down Expand Up @@ -170,7 +148,7 @@ class Arguments:
''')
)
mode = RunMode(
default_value=RunMode.Live.name # type: ignore[attr-defined]
default_value=RunMode.Live.name
)
host = graphene.String(
description=sstrip('''
Expand Down
Loading