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

Jupyter server #4331

Merged
merged 3 commits into from
Aug 31, 2021
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
14 changes: 9 additions & 5 deletions cylc/flow/network/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -1444,11 +1444,15 @@ class TimePoint(String):
class WorkflowStopMode(Enum):
"""The mode used to stop a running workflow."""

# NOTE: using a different enum because:
# * Graphene requires special enums.
# * We only want to offer a subset of stop modes.

# Note: contains only the REQUEST_* values from StopMode
Clean = StopMode.REQUEST_CLEAN
Kill = StopMode.REQUEST_KILL
Now = StopMode.REQUEST_NOW
NowNow = StopMode.REQUEST_NOW_NOW
Clean = StopMode.REQUEST_CLEAN.value
Kill = StopMode.REQUEST_KILL.value
Now = StopMode.REQUEST_NOW.value
NowNow = StopMode.REQUEST_NOW_NOW.value

@property
def description(self):
Expand Down Expand Up @@ -1722,7 +1726,7 @@ class Meta:
class Arguments:
workflows = List(WorkflowID, required=True)
mode = WorkflowStopMode(
default_value=StopMode.REQUEST_CLEAN
default_value=WorkflowStopMode.Clean.value # type: ignore
)
cycle_point = CyclePoint(
description='Stop after the workflow reaches this cycle.'
Expand Down
5 changes: 5 additions & 0 deletions cylc/flow/scheduler.py
Original file line number Diff line number Diff line change
Expand Up @@ -856,6 +856,11 @@ def command_stop(
pass
else:
# immediate shutdown
try:
mode = StopMode(mode)
except ValueError:
LOG.error(f'Invalid stop mode {mode}')
return
self._set_stop(mode)
if mode is StopMode.REQUEST_KILL:
self.time_next_kill = time()
Expand Down
17 changes: 9 additions & 8 deletions cylc/flow/scripts/cylc.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,8 +137,6 @@ def get_version(long=False):
' use cylc graph <flow1> --diff <flow2>',
'gscan':
'cylc gscan has been removed, use the web UI',
'gui':
'cylc gui has been removed, use the web UI',
'insert':
'inserting tasks is now done automatically',
'jobscript':
Expand Down Expand Up @@ -329,7 +327,7 @@ def cli_version(long_fmt=False):
"""Wrapper for get_version."""
print(get_version(long_fmt))
if long_fmt:
list_plugins()
print(list_plugins())
sys.exit(0)


Expand Down Expand Up @@ -357,23 +355,26 @@ def list_plugins():
for entry_point in entry_points
}

lines = []
if dists:
print('\nPlugins:')
lines.append('\nPlugins:')
maxlen1 = max(len(dist.project_name) for dist in dists) + 2
maxlen2 = max(len(dist.version) for dist in dists) + 2
for dist in dists:
print(
lines.append(
f' {dist.project_name.ljust(maxlen1)}'
f' {dist.version.ljust(maxlen2)}'
f' {dist.module_path}'
)

print('\nEntry Points:')
lines.append('\nEntry Points:')
for entry_point_name, entry_points in entry_point_groups.items():
if entry_points:
print(f' {entry_point_name}:')
lines.append(f' {entry_point_name}:')
for entry_point in entry_points:
print(f' {entry_point}')
lines.append(f' {entry_point}')

return '\n'.join(lines)


@contextmanager
Expand Down