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

Python API #1962

Open
hjoliver opened this issue Aug 14, 2016 · 8 comments
Open

Python API #1962

hjoliver opened this issue Aug 14, 2016 · 8 comments
Milestone

Comments

@hjoliver
Copy link
Member

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.

@hjoliver hjoliver added this to the some-day milestone Aug 14, 2016
@benfitzpatrick
Copy link
Contributor

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).

@arjclark
Copy link
Contributor

... I think we thought that if someone else developed it, we wouldn't mind!

That is pretty much my recollection too.

@matthewrmshin
Copy link
Contributor

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.

@matthewrmshin
Copy link
Contributor

matthewrmshin commented Dec 4, 2017

Just a bit more thoughts on this one. We can have decent APIs and/or documented ways to do these in Python programs:

@hjoliver
Copy link
Member Author

hjoliver commented Jul 4, 2019

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.

@hjoliver
Copy link
Member Author

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
    )

@oliver-sanders
Copy link
Member

(example taken from the wiki)

@hjoliver
Copy link
Member Author

(example taken from the wiki)

(Ah, brilliant, forgot where that write-up was 👍 )

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

No branches or pull requests

5 participants