Open hjoliver opened 8 years ago
We've talked about this informally in Exeter before (or is there a proper issue?). There are suites that justifiably push the configuration file interface to the limits. My memory is that we were a bit divided about a Python API, but I think we thought that if someone else developed it, we wouldn't mind! The others may chip in.
This could even extend to skipping the graph string as a way to define dependencies.
I quite like the idea of also being able to define file-based dependencies for tasks, since that is what our dependencies nearly always are based around. Once you know what files a task needs, you can wrap it all up and push it to a platform with a different filesystem. Obviously this doesn't lend itself to the full dependency syntax power (no OR, no failure triggers, no suicide triggers).
... I think we thought that if someone else developed it, we wouldn't mind!
That is pretty much my recollection too.
This does not have to be complicated. All we really need is an easy and documented way for users to generate the internal data structure of a parsed suite.rc
in Python.
Just a bit more thoughts on this one. We can have decent APIs and/or documented ways to do these in Python programs:
SuiteConfig
class!)Comment from Matt on Riot.im:
http://regent-lang.org/ This is work flow at the language level. We can probably learn something from this when we design the Python API.
Example from @oliver-sanders of multiple distinct graph sections:
with cylc.graph() as start_up:
make_something >> install_cold(platform)
with cylc.graph() as workflow:
foo >> bar >> baz
bar & qux >> pub
with cylc.graph() as wrap_up:
post_process >> tidy
cylc.run(
start_up >> workflow.every('P1D') >> wrap_up
)
(example taken from the wiki)
We could easily provide a Python API for defining suites (and also reformulate our current
suite.rc
file parser a little to plug into it). For normal use, I can't see this being the recommended way of writing suites, compared with the current paradigm of config file + Jinja2 support, but maybe there's a case for defining workflows in Python programs as well. (And a few people seem to view it as a deficiency that we don't currently have this). This could even extend to skipping the graph string as a way to define dependencies.