cylc / cylc-ui

Web app for monitoring and controlling Cylc workflows
https://cylc.github.io
GNU General Public License v3.0
37 stars 27 forks source link

aotf: load the schema for each workflow #1225

Open oliver-sanders opened 1 year ago

oliver-sanders commented 1 year ago

See also https://github.com/cylc/cylc-uiserver/issues/419

Presently the UI loads the UIS schema from which it gets the list of mutations.

This means that if the UIS is talking to two schedulers with different mutations (e.g. different Cylc versions), then mutations issued to one of the two will be drawn up with the wrong schema and will fail if the interfaces differ.

Rather than loading the schema once per-app, we should load it once-per-workflow.

Note: Since the AOTF work was put in, we have come to rely on introspection for the edit-runtime forms too, the same problem applies here also.

Pull requests welcome!

dwsutherland commented 1 year ago

Since the UI only interacts with the UIS, how does it make sense to load a scheduler schema that might be incompatible with the UIS? (even if the UIS is just a pass-through for most mutations, can we guarantee this will always work?)

oliver-sanders commented 1 year ago

Providing that the UIS passes the mutations through to the scheduler without meddling with them this should work fine.

The design and motive are documented here - https://github.com/cylc/cylc-flow/issues/2123

tldr; We keep fiddling the workflow interfaces for valid reasons, adding mutations, options, etc. But our users have valid reasons for working with different versions of Cylc simultaneously (e.g. research & production workloads). This has caused a number of problems with GUIs over the years and has made user-facing documentation tricky.

Note this is only for mutations, for queries / subscriptions the only thing we can do is to add back-compat in the UIS and try to handle forward compatibility breakages gracefully. In general we should expect the UI/UIS to be running at more recent versions. Related ideas (not documented anywhere yet):