-
Notifications
You must be signed in to change notification settings - Fork 94
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
Extra xtriggers #3116
Comments
Hi @ColemanTom Once #2989 is merged, we will have the option to create a separate project like cylc-xtriggers (or cylc/xtriggers, etc). For me this would be helpful as it would keep Cylc's core small and with less responsibilities. Users could request new features and get bugs fixed more quickly in this small project, without having to wait for the build and release of Cylc. Furthermore, once we are using setuptools, we can make xtriggers as plugins, so if you had an xtrigger that was super specific for your environment, it could still be loaded automatically by Cylc's core, without the need to move it under certain directories, or append/prepend to Just my 0.02 cents, but still pending more discussion with @cylc/core |
To elaborate on your question @ColemanTom, it is my understanding (though @hjoliver knows best of course, having devised & implemented these) that xtriggers were designed to be a plugin interface, rather than as a means to extend our triggering mechanism capabilities per se. The aim was to allow users to define any trigger that would be useful for them, leaving them to create them as they wish, hence we didn't plan to collect any such xtrigger custom function implementations as far as I am aware. Though we do classify the non-standard triggering systems we already supported before xtriggers were established, such as clock triggers & client-server triggers, as xtriggers, so the codebase includes those. You have raised an important point in that there could be generic xtrigger functions that would feasibly be useful to a lot of the user base. Those you have created & linked seem like perfect examples. While it would be useful to keep these together in an open & advertised location, sadly I don't think we have the resources or time (given our roadmap & priorities) to be able to moderate these thoroughly. That's why I really like @kinow's idea:
With a separate repository we can keep everything contained & have a disclaimer (or license or similar) that the repository is for user-created xtrigger functions that could be convenient but are not maintained or approved by @cylc/core. Perhaps trusted volunteers might want to help establish this repo, though, as having it under the official 'cylc organisation implies some accountability.
This is also a great idea that I second. 💯 From my experience I know Sphinx (calling them 'extensions') & Vue make use of |
Thanks for the feedback. So the idea would be to have a Anyway, this all sounds quite reasonable and logical. |
It could be under the cylc organisation in GitHub I think. Something like
Thanks. We also have the challenge that with The xtriggers shipped with Cylc will reside under this directory, but not all users will be able to add extra xtriggers there due to restrictions. So having this other repository, we could have shorter release cycles, and users would install it via Or if you created your own Of course we could also simply load it from other directories. So that's another possibility too. |
@kinow -
We do currently allow users to keep xtrigger functions in their own suite Python dirs. However, I generally like your separate repository suggestion better anyway. I can go ahead and create a new repository under the Cylc org for @ColemanTom's new functions. However, I'm still not clear on the naming convention, and how that will work under the new packaging methods: should it be |
I have the same concern. We are going with |
Just to chip in with a thought:
If we anticipate that in the near or far future (in the latter case accounting for possible new directions, etc. we might not even entertain or imagine right now) there might be other cases, besides triggering, where it would be useful to provide entry points & allow users to create & use custom functionality, we could make the repository dedicated to more general "pluggable extensions" so that we can use the cool name Admittedly, I'm not sure whether it is because I think this is an especially good idea, or simply because I really like Cylc X as a sub-project name... |
@kinow - my reasoning for the current redundant |
@sadielbartholomew - not a bad idea and we can see what others think, but my inclination is to not group all current and future kinds of Cylc extension in a single repository because with proper packaging it seems easy to have multiple dependencies and then maintain them all separately (no need re-release all future "batch system" extensions (say) when one of our external triggers gets a bug fix, etc.). |
That's correct. It's more a convention that you normally find a project
That makes sense to me. But I am horrible naming and organizing things like this 😥
Yup, we have ways to configure the package name. The pull request to add After installed, users actually have two modules added, |
+1 🎉 |
Yep, same conclusion I came to above. Creating the new repo now... |
@ColemanTom new repo here: https://github.com/cylc/cylc-xtriggers Please post a PR there with your external trigger functions. For the moment, they can probably just go in the top level (not a sub-dir) of the repository. We can move things around later once packaging is sorted out, if that has an impact. I'm not sure about moving the existing xtriggers there at this stage (except for the Kafka example ... I'll move that) as they represent quite core functionality (clock triggers and other-suite triggers) and are documented in the User Guide. Do you have an opinion this @kinow ? |
@ColemanTom - once the new PR is up, you can refer to this issue, then close this issue. |
+1
I think these could be moved there too. We recently did a bit of re-work in the existing xtriggers. This could be released earlier before Cylc 7.8.2 or Cylc 8 were done. And later users could ask that other functions from After we get
Another possibility, is to add a dependency group in What do you think @hjoliver ? |
I like 👍 |
hmmm, actually maybe each xtrigger should be in its own directory, so that it can have accompanying documentation and/or usage examples. |
OK, PRs posted to move the Kafka example xtrigger. I think we should move the others later, after #2990, so we can amend the user guide documentation at the same time, for how to get and use the xtriggers. |
Is moving the I'll start adding my currently made ones next week. Thanks all. |
From what I remember without looking at the code now, it was a special Xtrigger, that did not seem to be designed to be changed or extended by users. So perhaps we could instead leave it here for now and decide what to do about it later. |
Yes, clock-triggering is core functionality. Although it is only singled out in the main library because it is executed synchronously in the main loop (because a clock check is known to be quick and doesn't need the full asynchronous treatment). (So now it occurs to me we could move it too, to the xtriggers repo, if we allowed the xtrigger writer to specify synchronous or asynchronous operation). |
Interesting! Now that we have the The next step would then be to move everything to their final destination 👍 |
@hjoliver I don't believe that is technically accurate. But, I had a proposal on that point. I was thinking that xtriggers could benefit from a small adjustment. If all xtriggers had to have a signature which included |
@kinow -
Thanks, that would be really good. |
You mean All I really meant was: the fundamental reason for the different, simpler, treatment of clock xtriggers was that they can be called synchronously ... whereas arbitrary user-supplied trigger functions can't be guaranteed to be sufficiently well behaved for that. After making that distinction, i guess I built on it slightly! |
@ColemanTom - regarding your proposal above, do you mean essentially what we're already doing for the general (non-clock) case? If so, then i think I agree that would be the way to "remove that difference of handling" as per my previous comment. |
I'm going to close this. I don't think it really matters that much. |
I was wondering if you want a few extra xtriggers added to the core cylc code, or if the idea is to keep the number in cylc itself quite small and leave xtriggers to external users to implement locally only?
I'm making some for myself, and 3 of them I think might be suitable for general usage as they are not really specific to my use cases or environments.
https://github.com/ColemanTom/cylc/blob/7.8.x_extra_xtriggers/lib/cylc/xtriggers/file_exists.py
https://github.com/ColemanTom/cylc/blob/7.8.x_extra_xtriggers/lib/cylc/xtriggers/file_contains.py
https://github.com/ColemanTom/cylc/blob/7.8.x_extra_xtriggers/lib/cylc/xtriggers/remote_file_contains.py
The text was updated successfully, but these errors were encountered: