-
Notifications
You must be signed in to change notification settings - Fork 94
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
Fix.platform is regex remote tidy fail #5445
Fix.platform is regex remote tidy fail #5445
Conversation
adfa520
to
0aee582
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, couple of minor points.
Gotta small lint failure. |
…ote tidy Remove broken unit test tests for map_platforms_used_for_install_targets unit test select_platforms_used Test remote_tidy Changelog f
Co-authored-by: Oliver Sanders <[email protected]>
and replaced it by adding a "quiet" mode to get_install_targets_platform_map. Added test for the new quiet option. Factored some logic from remote_tidy to a staticmethod of TaskRemoteMgr to allow unit testing. Added unit test. monkeypatch test to avoid actual subproc calls
d56e9dd
to
dd2a373
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested with this workflow:
[scheduling]
[[graph]]
R1 = x => y
[runtime]
[[x]]
platform = myhost01
script = cylc stop "${CYLC_WORKFLOW_ID}" --now --now
[[y]]
and this global config:
[platforms]
[[myhost0.]]
Where "myhost01" exists on my network (obviously edit this to match an actual host).
Before:
INFO - Workflow shutting down - REQUEST(NOW-NOW)
WARNING - Orphaned tasks:
* 1/x (running)
ERROR - Error during shutdown
ERROR - local variable 'platform' referenced before assignment
Traceback (most recent call last):
File "~/cylc-flow/cylc/flow/scheduler.py", line 1756, in shutdown
await self._shutdown(reason)
File "~/cylc-flow/cylc/flow/scheduler.py", line 1834, in _shutdown
self.task_job_mgr.task_remote_mgr.remote_tidy()
File "~/cylc-flow/cylc/flow/task_remote_mgr.py", line 312, in remote_tidy
platform['name'],
UnboundLocalError: local variable 'platform' referenced before assignment
INFO - DONE
After:
INFO - Workflow shutting down - REQUEST(NOW-NOW)
WARNING - Orphaned tasks:
* 1/x (running)
INFO - platform: exvcylcdev01 - remote tidy (on exvcylcdev01)
INFO - DONE
cylc/flow/task_remote_mgr.py
Outdated
platforms_used = ( | ||
self.db_mgr.get_pri_dao().select_platforms_used()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should ensure the DB is closed
platforms_used = ( | |
self.db_mgr.get_pri_dao().select_platforms_used()) | |
with self.db_mgr.get_pri_dao() as dao: | |
platforms_used = dao.select_platforms_used() |
Co-authored-by: Oliver Sanders <[email protected]>
Co-authored-by: Ronnie Dutta <[email protected]>
d1ff32e
to
7a9da9f
Compare
…gex_remote_tidy_fail * upstream/8.1.x: Update cylc/flow/scripts/message.py Upload coverage to Codecov in separate job (cylc#5459) upgrade cylc message internal help with details of severity levels Update tests/functional/platforms/10-do-not-host-check-platforms.t Fix flake8-comprehensions C419 Don't use any([i for i in iterable]) use any(i for i in iterable). It's more efficient because we don't have to expand the entire thing. Improve readability of host/platform eval code (#53) small changlog error fix update comment on localhost check and add test for case localhost4.localhost42 undo mistake clarification of nomenclature Avoid running host check on platform names - this doesn't make any sense.
platforms_used = ( | ||
self.db_mgr.get_pri_dao().select_task_job_platforms()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
platforms_used = ( | |
self.db_mgr.get_pri_dao().select_task_job_platforms()) | |
with self.db_mgr.get_pri_dao() as dao: | |
platforms_used = dao.select_task_job_platforms()) |
e43c13f
to
94a61da
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Tested out using a regex pattern platform section in global.cylc
@oliver-sanders - Ronnie's had me make some changes since last you looked.. mind giving it another quick look? |
@wxtim, some minor conflicts with the other branch. |
Gotta couple of test failures :( |
I think that the one in |
I've re-run the |
Co-authored-by: Ronnie Dutta <[email protected]>
Co-authored-by: Ronnie Dutta <[email protected]>
Have you looked at what's in it? |
Merging with an unrelated test failure fixed in #5479 |
…too_soon * upstream/8.1.x: Fix.platform is regex remote tidy fail (cylc#5445) parsec: better error messages for section/setting mixups cat-log: change interface for scheduler logs to include the dirname cat-log: support other workflow files Fix workflow shutdown on no platforms error (cylc#5395) actions: add build test
…too_soon * upstream/8.1.x: (46 commits) Bump dev version (cylc#5518) Prepare release 8.1.4 cat-log: fix issues with file listing Update changelog Fix `eval_host()` localhost bug & plug testing gap Bump dev version (cylc#5501) Prepare release 8.1.3 Ignore off-sequence parents, for datastore. (cylc#5495) Avoid duplicate prerequisites from multiple recurrences. (cylc#5466) tests/f: fix events/11 swarm: convert cylc-dev Docker image to run on ubuntu:latest fix changelog Apply prerequisite changes to spawned tasks, on reload & restart (cylc#5334) cat-log: don't list directories which don't exist (cylc#5488) task_job_mgr: move compute out of open call manylinux tests: update to ubuntu-20.04 Update changelog Address review Fix.platform is regex remote tidy fail (cylc#5445) parsec: better error messages for section/setting mixups ...
Closes #5429
@dpmatthews tagged as reviewer as reporter of original issue.
To test manually see #5429 .
Check List
CONTRIBUTING.md
and added my name as a Code Contributor.setup.cfg
(andconda-environment.yml
if present).CHANGES.md
entry included if this is a change that can affect users?.?.x
branch.