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

Add xtriggers to GraphQL schema #3921

Closed
kinow opened this issue Nov 5, 2020 · 1 comment · Fixed by #3938
Closed

Add xtriggers to GraphQL schema #3921

kinow opened this issue Nov 5, 2020 · 1 comment · Fixed by #3938
Milestone

Comments

@kinow
Copy link
Member

kinow commented Nov 5, 2020

Describe exactly what you would like to see in an upcoming release

I couldn't find an existing issue in Cylc Flow. Related to

The UI needs information about the external triggers, so that they can be displayed in the components/views.

Additional context

I tested the UI with the following workflow

[scheduling]
initial cycle point = 2000-01-01

[[xtriggers]]
clock_1 = wall_clock(offset=PT1M):PT20S

[[dependencies]]
[[[P1D]]]
graph = "@clock_1 => foo"

[runtime]
[[foo]]
script = true

Which works fine in the tree view. It shows foo task, but you have no information about the external trigger. I started with the wall_clock as that's the only one I could remember using before.

In GraphQL, with the current schema, the closest I found is the task.proxies.extras field. The query

subscription {
  workflows (ids: ["kinow|xtrigger1"]) {
    id
    tasks {
      id
      proxies {
        id
        extras
      }
    }
  }
}

does return some information about the external trigger of the task

{
  "data": {
    "workflows": [
      {
        "id": "kinow|xtrigger1",
        "tasks": [
          {
            "id": "kinow|xtrigger1|foo",
            "proxies": [
              {
                "id": "kinow|xtrigger1|20030725T0000+1300|foo",
                "extras": {
                  "xtrigger \"clock_1 = wall_clock(offset=PT1M)\"": "satisfied"
                }
              },
              {
                "id": "kinow|xtrigger1|20030724T0000+1300|foo",
                "extras": {
                  "xtrigger \"clock_1 = wall_clock(offset=PT1M)\"": "satisfied"
                }
              },
              {
                "id": "kinow|xtrigger1|20030726T0000+1300|foo",
                "extras": {
                  "xtrigger \"clock_1 = wall_clock(offset=PT1M)\"": "satisfied"
                }
              }
            ]
          }
        ]
      }
    ]
  }
}

But I think we might need more information/structure than what we have at the moment, which is just "xtrigger \"clock_1 = wall_clock(offset=PT1M)\"": "satisfied".

Pull requests welcome!

@kinow kinow added this to the cylc-8.0a3 milestone Nov 5, 2020
@hjoliver
Copy link
Member

hjoliver commented Nov 5, 2020

That information in the schema is what powers the old cylc show command, which shows the current state of prerequisites and xtriggers for a task proxy in the task pool:

[scheduling]
   initial cycle point = 2050  # future!
   [[graph]]
      R1 = """
           foo => bar
           @wall_clock => bar
      """

Run this, then:

$ cylc show foo bar.20500101T0000+1300
title: (not given)
description: (not given)
URL: (not given)

prerequisites (- => not satisfied):
  + foo.20500101T0000+1300 succeeded

outputs (- => not completed):
  - bar.20500101T0000+1300 expired
  - bar.20500101T0000+1300 submitted
  - bar.20500101T0000+1300 submit-failed
  - bar.20500101T0000+1300 started
  - bar.20500101T0000+1300 succeeded
  - bar.20500101T0000+1300 failed

other:
  o  xtrigger "wall_clock = wall_clock()" ... NOT satisfied

@hjoliver hjoliver modified the milestones: cylc-8.0a3, cylc-8.0b0 Feb 25, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants