Skip to content

Commit a4609dc

Browse files
authored
Merge pull request #206 from hjoliver/suite-to-workflow
Terminology: suite to workflow.
2 parents a758054 + 3101d19 commit a4609dc

File tree

7 files changed

+30
-30
lines changed

7 files changed

+30
-30
lines changed

.github/workflows/update_copyright.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
1+
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
22
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
33
#
44
# This program is free software: you can redistribute it and/or modify

cylc/uiserver/data_store_mgr.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,8 @@
4646
EDGES, DATA_TEMPLATE, ALL_DELTAS, DELTAS_MAP, WORKFLOW,
4747
apply_delta, generate_checksum, create_delta_store
4848
)
49-
from cylc.flow.suite_files import ContactFileFields as CFF
50-
from cylc.flow.suite_status import SuiteStatus
49+
from cylc.flow.workflow_files import ContactFileFields as CFF
50+
from cylc.flow.workflow_status import WorkflowStatus
5151

5252
from .workflows_mgr import workflow_request
5353

@@ -90,7 +90,7 @@ def update_contact(self, w_id, contact_data=None):
9090
flow.port = 0
9191
# flow.pub_port = 0
9292
flow.api_version = 0
93-
flow.status = SuiteStatus.STOPPED.value
93+
flow.status = WorkflowStatus.STOPPED.value
9494

9595
# Apply to existing workflow data
9696
if 'delta_times' not in self.data[w_id]:

cylc/uiserver/schema.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -141,19 +141,19 @@ class Arguments:
141141
)
142142
hold = Boolean(
143143
description=sstrip('''
144-
Hold suite immediately on starting.
144+
Hold workflow immediately on starting.
145145
''')
146146
)
147147
hold_point = CyclePoint(
148148
description=sstrip('''
149-
Set hold cycle point. Hold suite AFTER all tasks have PASSED
149+
Set hold cycle point. Hold workflow AFTER all tasks have PASSED
150150
this cycle point.
151151
''')
152152
)
153153
mode = RunMode()
154154
host = String(
155155
description=sstrip('''
156-
Specify the host on which to start-up the suite. If not
156+
Specify the host on which to start-up the workflow. If not
157157
specified, a host will be selected using the
158158
`[scheduler]run hosts` global config.
159159
''')
@@ -187,7 +187,7 @@ class Arguments:
187187
set = List(
188188
String,
189189
description=sstrip('''
190-
Set the value of a Jinja2 template variable in the suite
190+
Set the value of a Jinja2 template variable in the workflow
191191
definition. Values should be valid Python literals so strings
192192
must be quoted e.g. `STR="string"`, `INT=43`, `BOOL=True`.
193193
This option can be used multiple times on the command line.
@@ -198,7 +198,7 @@ class Arguments:
198198
)
199199
set_file = String(
200200
description=sstrip('''
201-
Set the value of Jinja2 template variables in the suite
201+
Set the value of Jinja2 template variables in the workflow
202202
definition from a file containing NAME=VALUE pairs (one per
203203
line). As with "set" values should be valid Python literals so
204204
strings must be quoted e.g. `STR='string'`. NOTE: these

cylc/uiserver/tests/test_data_store_mgr.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919

2020
import pytest
2121
from cylc.flow.network import MSG_TIMEOUT
22-
from cylc.flow.suite_files import ContactFileFields as CFF
22+
from cylc.flow.workflow_files import ContactFileFields as CFF
2323

2424
import cylc.uiserver.data_store_mgr as data_store_mgr_module
2525
from cylc.uiserver.data_store_mgr import DataStoreMgr

cylc/uiserver/tests/test_workflows_mgr.py

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
from cylc.flow import ID_DELIM
2626
from cylc.flow.exceptions import ClientError, ClientTimeout
2727
from cylc.flow.network import API
28-
from cylc.flow.suite_files import (
29-
SuiteFiles,
28+
from cylc.flow.workflow_files import (
29+
WorkflowFiles,
3030
ContactFileFields as CFF,
3131
)
3232

@@ -139,7 +139,7 @@ async def test_est_workflow(
139139
if x == 'remote' else False
140140

141141
mocked_client = mocker.patch(
142-
'cylc.uiserver.workflows_mgr.SuiteRuntimeClient')
142+
'cylc.uiserver.workflows_mgr.WorkflowRuntimeClient')
143143
mocked_client.return_value = async_client
144144

145145
mocked_get_host_ip_by_name = mocker.patch(
@@ -179,9 +179,9 @@ def mk_flow(path, reg, active=True):
179179
180180
"""
181181
run_dir = path / reg
182-
srv_dir = run_dir / SuiteFiles.Service.DIRNAME
183-
contact = srv_dir / SuiteFiles.Service.CONTACT
184-
fconfig = run_dir / SuiteFiles.FLOW_FILE
182+
srv_dir = run_dir / WorkflowFiles.Service.DIRNAME
183+
contact = srv_dir / WorkflowFiles.Service.CONTACT
184+
fconfig = run_dir / WorkflowFiles.FLOW_FILE
185185
run_dir.mkdir()
186186
fconfig.touch() # cylc uses this to identify a dir as a workflow
187187
srv_dir.mkdir()
@@ -352,8 +352,8 @@ async def test_register(
352352
)
353353
# The following functions also depend on a running workflow
354354
# with pyzmq socket, so we also mock them.
355-
mocker.patch('cylc.flow.network.client.SuiteRuntimeClient.start')
356-
mocker.patch('cylc.flow.network.client.SuiteRuntimeClient.get_header')
355+
mocker.patch('cylc.flow.network.client.WorkflowRuntimeClient.start')
356+
mocker.patch('cylc.flow.network.client.WorkflowRuntimeClient.get_header')
357357
mocker.patch('cylc.uiserver.data_store_mgr.DataStoreMgr.'
358358
'start_subscription')
359359

@@ -427,8 +427,8 @@ async def test_connect(
427427
)
428428
# The following functions also depend on a running workflow
429429
# with pyzmq socket, so we also mock them.
430-
mocker.patch('cylc.flow.network.client.SuiteRuntimeClient.start')
431-
mocker.patch('cylc.flow.network.client.SuiteRuntimeClient.get_header')
430+
mocker.patch('cylc.flow.network.client.WorkflowRuntimeClient.start')
431+
mocker.patch('cylc.flow.network.client.WorkflowRuntimeClient.get_header')
432432
mocker.patch('cylc.uiserver.data_store_mgr.DataStoreMgr.'
433433
'start_subscription')
434434

@@ -489,8 +489,8 @@ async def test_disconnect_and_stop(
489489
)
490490
# The following functions also depend on a running workflow
491491
# with pyzmq socket, so we also mock them.
492-
mocker.patch('cylc.flow.network.client.SuiteRuntimeClient.start')
493-
mocker.patch('cylc.flow.network.client.SuiteRuntimeClient.get_header')
492+
mocker.patch('cylc.flow.network.client.WorkflowRuntimeClient.start')
493+
mocker.patch('cylc.flow.network.client.WorkflowRuntimeClient.get_header')
494494
mocker.patch('cylc.uiserver.data_store_mgr.DataStoreMgr.'
495495
'start_subscription')
496496
mocker.patch('cylc.uiserver.data_store_mgr.DataStoreMgr.update_contact')

cylc/uiserver/workflows_mgr.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@
3434
from cylc.flow.exceptions import ClientError, ClientTimeout
3535
from cylc.flow.hostuserutil import is_remote_host, get_host_ip_by_name
3636
from cylc.flow.network import API
37-
from cylc.flow.network.client import SuiteRuntimeClient
37+
from cylc.flow.network.client import WorkflowRuntimeClient
3838
from cylc.flow.network import MSG_TIMEOUT
3939
from cylc.flow.network.scan import (
4040
api_version,
4141
contact_info,
4242
is_active,
4343
scan
4444
)
45-
from cylc.flow.suite_files import ContactFileFields as CFF
45+
from cylc.flow.workflow_files import ContactFileFields as CFF
4646

4747
logger = logging.getLogger(__name__)
4848
CLIENT_TIMEOUT = 2.0
@@ -53,7 +53,7 @@ async def workflow_request(client, command, args=None,
5353
"""Workflow request command.
5454
5555
Args:
56-
client (SuiteRuntimeClient): Instantiated workflow client.
56+
client (WorkflowRuntimeClient): Instantiated workflow client.
5757
command (str): Command/Endpoint name.
5858
args (dict): Endpoint arguments.
5959
timeout (float): Client request timeout (secs).
@@ -87,11 +87,11 @@ async def est_workflow(reg, host, port, pub_port, context=None, timeout=None):
8787
logger.error("ERROR: %s: %s\n", exc, host)
8888
return (reg, host, port, pub_port, None)
8989

90-
# NOTE: Connect to the suite by host:port. This way the
91-
# SuiteRuntimeClient will not attempt to check the contact file
90+
# NOTE: Connect to the workflow by host:port. This way the
91+
# WorkflowRuntimeClient will not attempt to check the contact file
9292
# which would be unnecessary as we have already done so.
9393
# NOTE: This part of the scan *is* IO blocking.
94-
client = SuiteRuntimeClient(reg, context=context, timeout=timeout)
94+
client = WorkflowRuntimeClient(reg, context=context, timeout=timeout)
9595
_, result = await workflow_request(client, 'identify')
9696
return (reg, host, port, pub_port, client, result)
9797

@@ -195,7 +195,7 @@ async def _register(self, wid, flow):
195195
async def _connect(self, wid, flow):
196196
"""Open a connection to a running workflow."""
197197
self.active[wid] = flow
198-
flow['req_client'] = SuiteRuntimeClient(flow['name'])
198+
flow['req_client'] = WorkflowRuntimeClient(flow['name'])
199199
await self.uiserver.data_store_mgr.sync_workflow(
200200
wid,
201201
flow

pytest.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# THIS FILE IS PART OF THE CYLC SUITE ENGINE.
1+
# THIS FILE IS PART OF THE CYLC WORKFLOW ENGINE.
22
# Copyright (C) NIWA & British Crown (Met Office) & Contributors.
33
#
44
# This program is free software: you can redistribute it and/or modify

0 commit comments

Comments
 (0)