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

Db store force triggered #5023

Merged
merged 10 commits into from
Sep 27, 2022
Merged

Conversation

hjoliver
Copy link
Member

@hjoliver hjoliver commented Jul 28, 2022

These changes close #5020

Note

db change Change to the workflow database structure - added is_manual_submit column to task_states table

Requirements check-list

  • I have read CONTRIBUTING.md and added my name as a Code Contributor.
  • Contains logically grouped changes (else tidy your branch by rebase).
  • Does not contain off-topic changes (use other PRs for other changes).
  • Applied any dependency changes to both setup.cfg and conda-environment.yml.
  • Appropriate tests are included (unit and/or functional).
  • Appropriate change log entry included.
  • No documentation update required.
  • [if bugfix] PRs raised to both master and the relevant bugfix branch.

@hjoliver hjoliver added the bug Something is wrong :( label Jul 28, 2022
@hjoliver hjoliver self-assigned this Jul 28, 2022
@hjoliver hjoliver added this to the cylc-8.0.1 milestone Jul 28, 2022
@hjoliver hjoliver marked this pull request as ready for review July 28, 2022 12:43
@hjoliver hjoliver requested a review from MetRonnie July 28, 2022 12:43
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixes the bug, just a couple of queries

CHANGES.md Outdated Show resolved Hide resolved
cylc/flow/rundb.py Outdated Show resolved Hide resolved
cylc/flow/workflow_db_mgr.py Show resolved Hide resolved
@oliver-sanders oliver-sanders changed the base branch from master to 8.0.x August 2, 2022 09:23
@MetRonnie MetRonnie deleted the branch cylc:8.0.x August 3, 2022 11:58
@MetRonnie MetRonnie closed this Aug 3, 2022
@MetRonnie
Copy link
Member

Sorry, accidentally deleted 8.0.x!

@MetRonnie MetRonnie reopened this Aug 3, 2022
Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good pending resolution of my flow nums query

@hjoliver
Copy link
Member Author

hjoliver commented Aug 10, 2022

Yes, I need to (re)-investigate that - I ~think I did it deliberately, and it seems to work correctly, but have forgotten my own chain of thought already... [DONE]

A good way to check updates of the task status table:

[scheduling]
    [[graph]]
        R1 = "a => b => c => d"
[runtime]
    [[a, b, d]]
        pre-script = sleep 5
    [[c]]   # trigger a new flow at a, then fail so the new flow will merge with me
        script = """
            sleep 5
            if ((CYLC_TASK_SUBMIT_NUMBER == 1 )); then
               cylc trigger --flow=new $CYLC_WORKFLOW_ID//1/a
               false
            fi
         """

Run the above with this alongside:

$ watch -n 1 sqlite3 -header -column ~/cylc-run/test/runN/log/db \
   "select name, flow_nums, submit_num, status from task_states"

@MetRonnie
Copy link
Member

I tried your example running on 8.0.x and this branch, but I can't say I noticed a difference in the changes to the task_states table

@hjoliver
Copy link
Member Author

Sorry, poorly explained by me! - that was just intended to show that my changes to the task status DB calls had not broken anything.

Copy link
Member

@MetRonnie MetRonnie left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me. I'm out of my depth when it comes to knowing what some of the changes will mean, though

@oliver-sanders oliver-sanders modified the milestones: cylc-8.0.1, 8.0.2 Aug 16, 2022
CHANGES.md Outdated Show resolved Hide resolved
hjoliver and others added 2 commits August 18, 2022 16:45
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
@hjoliver
Copy link
Member Author

hjoliver commented Aug 18, 2022

(TBD: resolve Oliver's question above.) DONE

@oliver-sanders oliver-sanders modified the milestones: cylc-8.0.2, cylc-8.0.3 Sep 12, 2022
CHANGES.md Show resolved Hide resolved
@oliver-sanders oliver-sanders merged commit 20bc9a0 into cylc:8.0.x Sep 27, 2022
datamel pushed a commit that referenced this pull request Sep 27, 2022
* fix reversed data-store edge source-target (#5156)

Co-authored-by: David Sutherland <davidwollow@gmail.com>

* `log_vc_info`: Redirect diff straight to file to avoid blocking pipe (#5139)

* log_vc_info: redirect diff straight to file to avoid blocking pipe
* Update changelog

* A no-flow task should not merge and retrigger incomplete children (#5146)

Prevent no-flow merge.

* remote-install: add "ana/" to the default install list (#5137)

* The `ana/` directory is used by `rose_ana` to load comparison modules.
* These are typically run where the data is generated which is often
  remote.
* These directories typically contain a small number of Python files.

* Db store force triggered (#5023)

Store force-triggered flag in the run DB.

* Add a new functional test.
* Remove some redundant DB updates.
* Update change log.

Co-authored-by: David Sutherland <davidwollow@gmail.com>
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
@hjoliver hjoliver deleted the db-store-force-triggered branch September 28, 2022 20:53
datamel pushed a commit that referenced this pull request Sep 29, 2022
* fix reversed data-store edge source-target (#5156)

Co-authored-by: David Sutherland <davidwollow@gmail.com>

* `log_vc_info`: Redirect diff straight to file to avoid blocking pipe (#5139)

* log_vc_info: redirect diff straight to file to avoid blocking pipe
* Update changelog

* A no-flow task should not merge and retrigger incomplete children (#5146)

Prevent no-flow merge.

* remote-install: add "ana/" to the default install list (#5137)

* The `ana/` directory is used by `rose_ana` to load comparison modules.
* These are typically run where the data is generated which is often
  remote.
* These directories typically contain a small number of Python files.

* Auto bump dev version on release

* Run GH Actions tests on push to `8.*.x` branches

* Db store force triggered (#5023)

Store force-triggered flag in the run DB.

* Add a new functional test.
* Remove some redundant DB updates.
* Update change log.

* remote: ensure all remote commands use a platform config (#5152)

Remote interfaces (SSH & rsync) now all require a platform object for configuration purposes (e.g. "ssh command").
Convenience interfaces added for remote calls to Cylc servers which use the localhost platform configuration. These are now used for:
* `cylc play` command re-invocation on a Cylc server.
* Evaluation of host selection rankings (via `cylc psutil`).
* The detect old contact file check, which tests whether a workflow is still running on the server recored in the contact file.

Co-authored-by: David Sutherland <davidwollow@gmail.com>
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
wxtim added a commit to wxtim/cylc that referenced this pull request Oct 3, 2022
…l-failure.bk

* upstream/8.0.x:
  remote: ensure all remote commands use a platform config (cylc#5152)
  Db store force triggered (cylc#5023)
  Run GH Actions tests on push to `8.*.x` branches
  Auto bump dev version on release
  remote-install: add "ana/" to the default install list (cylc#5137)
  A no-flow task should not merge and retrigger incomplete children (cylc#5146)
  `log_vc_info`: Redirect diff straight to file to avoid blocking pipe (cylc#5139)
  fix reversed data-store edge source-target (cylc#5156)
  Fix Jinja2 support if HOME undefined.
  Assume Jinja2 might be used in global-tests.cylc.
  Fix post-reload trigger. (cylc#5104)
  Bump dev version
  Update changelog
  workflow_state xtrigger: infer run num
  Type annotations
  Prepare release 8.0.2
  Remove HOME Env Variable from get_remote_workflow_run_dir (cylc#5115)
@MetRonnie MetRonnie added the db change Change to the workflow database structure label Oct 3, 2022
@MetRonnie
Copy link
Member

MetRonnie commented Oct 3, 2022

Oops, this breaks the ability of Cylc to restart 8.0.{0,1,2} workflows.

ERROR - no such column: task_states.is_manual_submit
    Traceback (most recent call last):
      File "~/github/cylc-flow/cylc/flow/scheduler.py", line 670, in start
        await self.configure()
      File "~/github/cylc-flow/cylc/flow/scheduler.py", line 459, in configure
        self._load_pool_from_db()
      File "~/github/cylc-flow/cylc/flow/scheduler.py", line 719, in _load_pool_from_db
        self.workflow_db_mgr.pri_dao.select_task_pool_for_restart(
      File "~/github/cylc-flow/cylc/flow/rundb.py", line 860, in select_task_pool_for_restart
        for row_idx, row in enumerate(self.connect().execute(stmt)):
    sqlite3.OperationalError: no such column: task_states.is_manual_submit
CRITICAL - Workflow shutting down - no such column: task_states.is_manual_submit

We need to make this an 8.1.0-only bugfix.

Edit: Oliver has suggested an alternative is implementing a DB upgrader


Generally we need to be careful about changes to the DB structure.

MetRonnie added a commit to MetRonnie/cylc-flow that referenced this pull request Oct 3, 2022
@oliver-sanders
Copy link
Member

Dammit, not sure how I missed that 🤦

wxtim added a commit that referenced this pull request Oct 6, 2022
* fix reversed data-store edge source-target (#5156)

Co-authored-by: David Sutherland <davidwollow@gmail.com>

* `log_vc_info`: Redirect diff straight to file to avoid blocking pipe (#5139)

* log_vc_info: redirect diff straight to file to avoid blocking pipe
* Update changelog

* A no-flow task should not merge and retrigger incomplete children (#5146)

Prevent no-flow merge.

* remote-install: add "ana/" to the default install list (#5137)

* The `ana/` directory is used by `rose_ana` to load comparison modules.
* These are typically run where the data is generated which is often
  remote.
* These directories typically contain a small number of Python files.

* Auto bump dev version on release

* Run GH Actions tests on push to `8.*.x` branches

* Db store force triggered (#5023)

Store force-triggered flag in the run DB.

* Add a new functional test.
* Remove some redundant DB updates.
* Update change log.

* remote: ensure all remote commands use a platform config (#5152)

Remote interfaces (SSH & rsync) now all require a platform object for configuration purposes (e.g. "ssh command").
Convenience interfaces added for remote calls to Cylc servers which use the localhost platform configuration. These are now used for:
* `cylc play` command re-invocation on a Cylc server.
* Evaluation of host selection rankings (via `cylc psutil`).
* The detect old contact file check, which tests whether a workflow is still running on the server recored in the contact file.

* host select: allow unary operators in ranking expressions (#5151)

* host select: allow unary operators in ranking expressions

* Whitelist unary operators (required for expressions like `-1 * x`)
  in `[scheduler][run hosts]ranking` expressions.
* Improve error formatting.

* Update tests/unit/test_exceptions.py

Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com>

Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com>

* reinstall changes to `rose-suite.conf` (#5125)

reinstall: ensure rose-suite.conf changes trigger reinstallation

Co-authored-by: David Sutherland <davidwollow@gmail.com>
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com>
@hjoliver
Copy link
Member Author

hjoliver commented Oct 9, 2022

Oops, sorry 😵‍💫 should have thought of that myself!

@hjoliver hjoliver mentioned this pull request Oct 10, 2022
8 tasks
datamel pushed a commit to datamel/cylc-flow that referenced this pull request Oct 19, 2022
* fix reversed data-store edge source-target (cylc#5156)

Co-authored-by: David Sutherland <davidwollow@gmail.com>

* `log_vc_info`: Redirect diff straight to file to avoid blocking pipe (cylc#5139)

* log_vc_info: redirect diff straight to file to avoid blocking pipe
* Update changelog

* A no-flow task should not merge and retrigger incomplete children (cylc#5146)

Prevent no-flow merge.

* remote-install: add "ana/" to the default install list (cylc#5137)

* The `ana/` directory is used by `rose_ana` to load comparison modules.
* These are typically run where the data is generated which is often
  remote.
* These directories typically contain a small number of Python files.

* Db store force triggered (cylc#5023)

Store force-triggered flag in the run DB.

* Add a new functional test.
* Remove some redundant DB updates.
* Update change log.

Co-authored-by: David Sutherland <davidwollow@gmail.com>
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
datamel pushed a commit to datamel/cylc-flow that referenced this pull request Oct 19, 2022
* fix reversed data-store edge source-target (cylc#5156)

Co-authored-by: David Sutherland <davidwollow@gmail.com>

* `log_vc_info`: Redirect diff straight to file to avoid blocking pipe (cylc#5139)

* log_vc_info: redirect diff straight to file to avoid blocking pipe
* Update changelog

* A no-flow task should not merge and retrigger incomplete children (cylc#5146)

Prevent no-flow merge.

* remote-install: add "ana/" to the default install list (cylc#5137)

* The `ana/` directory is used by `rose_ana` to load comparison modules.
* These are typically run where the data is generated which is often
  remote.
* These directories typically contain a small number of Python files.

* Auto bump dev version on release

* Run GH Actions tests on push to `8.*.x` branches

* Db store force triggered (cylc#5023)

Store force-triggered flag in the run DB.

* Add a new functional test.
* Remove some redundant DB updates.
* Update change log.

* remote: ensure all remote commands use a platform config (cylc#5152)

Remote interfaces (SSH & rsync) now all require a platform object for configuration purposes (e.g. "ssh command").
Convenience interfaces added for remote calls to Cylc servers which use the localhost platform configuration. These are now used for:
* `cylc play` command re-invocation on a Cylc server.
* Evaluation of host selection rankings (via `cylc psutil`).
* The detect old contact file check, which tests whether a workflow is still running on the server recored in the contact file.

* host select: allow unary operators in ranking expressions (cylc#5151)

* host select: allow unary operators in ranking expressions

* Whitelist unary operators (required for expressions like `-1 * x`)
  in `[scheduler][run hosts]ranking` expressions.
* Improve error formatting.

* Update tests/unit/test_exceptions.py

Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com>

Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com>

* reinstall changes to `rose-suite.conf` (cylc#5125)

reinstall: ensure rose-suite.conf changes trigger reinstallation

Co-authored-by: David Sutherland <davidwollow@gmail.com>
Co-authored-by: Ronnie Dutta <61982285+MetRonnie@users.noreply.github.com>
Co-authored-by: Hilary James Oliver <hilary.j.oliver@gmail.com>
Co-authored-by: Tim Pillinger <26465611+wxtim@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is wrong :( db change Change to the workflow database structure
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Triggered task intercycle prereq bug
3 participants