-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Implemented the update_endtime and get_endtime functions for the etcd_returner from PR #51363. #55186
Conversation
…t to include the bugfix from my PR at saltstack/salt#55186.
f08e1d4
to
931a576
Compare
Force-pushed due to rebase. Also implemented the |
This PR's initial comment was also updated to reference the new additions. Please review the history if you wish to see the initial reason for the PR prior to the addition of the new functionality. |
…lt#55186 which introduces the job endtime.
3ac9974
to
f161c64
Compare
force-pushed due to yet another rebase. |
what's going on with this, it's been 2 years back when you guys were asking people to merge into the develop branch? This PR significantly improves the etcd returner whilst still retaining the original etcd functionality. |
…d into salt.utils but didn't test anything and hid all the exceptions. To restore functionality we just pass through to the client attribute.
…table manner by ensuring None is always returned (the caller seems to depend on this) and empty strings aren't deserialized.
…hing the EtcdKeyNotFound exception, added a ton of comments, and debug + trace logs.
…ropery, leaves. Fixed.
…organized the trace logs to output the key that was returned from EtcdResult, and re-worded the logs so they use the word "job" when referring to a jid.
…ing for the format method).
This was tagged with "needs-testcase". Not sure why here as it's backwards compatible with the already-existing etcd returner testcases. |
The errors before the prior rebase are all similar to the following which isn't related to the PR.
|
…this PR yet nobody has merged this for 2 years without mentioning any kind of reason.
ci/py3/ubuntu1604 is erroring out because of:
|
…umber of linter passes you have in your build chain.
…evant logic itself.
…itionals in format parameters.
Not sure where to mention this as the original PR is in the process of being ported to master. Despite the mered PR passing all of the tests from the original returner, I just realized that it's not "exactly" backwards-compatible with the previous etcd returner schema and this is due to the names for the keys not being plural. The schema for the previous returner was very minimal and not actually linking the ttl between jobs and events. This caused races when using the former returner that could result in orphaned events or jobs when querying them. Albeit verbose, I tried to document how this was fixed in the PR's module documentation where I explain the schema and the relationships between the records. The aforementioned backwards-compatibility issue, however, is easily remedied as I wrote all the keys that are used into a The usage of the "minion.job" name was originally chosen to show that there's a relationship between the Other than these naming issues I described how to fix, I think everything else should be backwards compatible with the schema used by the previous implementation of the etcd returner. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
im not seeing etcd returner tests in the tests
directory so this will need test coverage added, but only for the changes you are making.
This is still waiting for the original PR to get merged as that one's been locked in project #5 for almost 2 years, hence there hasn't been any continued development on this until that occurs. I can write tests for this around then when that base PR gets merged, but since returners don't seem to have been shown much "love" wrt testing.. I really have no idea how to legitimately get to this component since even the On another note, none of the returners have implementations for Which one of the returners would you guys consider a reference implementation that all the returners should be modeled upon? |
Hey @arizvisa I'm not sure which original PR you were referring to - I couldn't find it looking through these comments or the project board - do you have a PR number of the original PR that this is waiting on?
I took a glance at the changes here, but there's a lot of them, so a good method of testing was not immediately apparent. I'm happy to take a closer look if it's not obvious based on existing tests (I'm guessing not), as you point out there's not been much love - only 13 returner test files between tests/unit/returners and tests/integration/returners
I'm not super familiar with returners, and I'm not sure what the history is there - I'll put this on our team agenda and make sure that we're on the same page in regards to either fully supporting the functionality or deprecation/removal.
I'll also ask this question. Thanks for your efforts! |
And I think you can find it on the project boards with this link: https://github.com/saltstack/salt/projects/5?card_filter_query=etcd Thanks a ton for looking into this. Etcd3 is already out which has a different API and support both the Etcd2/Etcd3 apis, but we're still using Etcd2 at the moment while waiting for that PR to get merged. |
I actually tried to write that PR to be a sort-of reference implementation with a ton of docs (and detailed description of its schema), and to take advantage of as many features of etcd as made sense (which is why I pushed for it so hard way back when). As you confirmed, the runners don't receive a lot of love. For my systems the etcd returners combined with all the other etcd components in salt are a necessity since the systems are heavily CoreOS based w/ etcd seeding everything and their salt-masters always running in a container. Despite it likely being an uncommon configuration, I'd love to see salt's etcd support become more of a thing in similar setups, heh. That old PR is pretty much the first step. |
Just following up here. Any bandwidth to finish this one up? Looks like test coverage and changelog needs to be added. Do you need help with the test coverage? |
me? |
Yes, that was my understanding of the status of this PR, but please correct me if i'm wrong. |
I attempted to merge this just over 3 years ago, with #51363 which was previously accepted. However, then it dead-ended into project #5 where I've tried to maintain contact with the maintainer to no avail. I tried to accelerate this with this particular PR back in 2019. However, due to a suggestion, I ended up adding more features as a follow up to the original because only one of the other returners was using the particular Throughout this entire process, I've pinged you guys multiple times with no responses (see #51363), and even did the same in this PR and was left hanging on this one since September of last year. I only have just now gotten a polite followup as of 4 days ago. Now the etcd v2 api, which is what this code was originally written for, is being deprecated as is noted in #61034. Essentially the 82 commits of maintaining this PR over the past 3 years and trying literally everything to get it merged has been for naught. So, nah. I'm sorry, I know it's not your fault, but unfortunately I'm over it. It is hellacious to get code merged into this project and I'm completely tired of fighting for it. As much as I preferred saltstack compared to ansible or any of the other solutions (and even still prefer it), I've been forced to move on as this software isn't even in my field of expertise and so I can't even make shit up to my boss saying "oh, but we really need this" because it's entirely unrelated to my normal job and the project that I originally needed this for was from years ago. As Etcdv2 API is being deprecated, I highly recommend you actually put a dever on this returner as really, the only ones in saltstack that are viable are the "local_cache" and the relational database ones. Etcd has a lot of capabilities that make it an elegant manager for job results which is why I worked on this returner way back when. Also keep in mind the special "req" job id as well (whenever you guys write it), as only my "etcd" returner and your "local_cache" returner actually seem to support it properly. |
See #51809 for the special handling of the "req" job id. |
I apologize for the inactivity that you have dealt with on the PR and issue. After reviewing them both I can understand your frustrations. I have personally updated my github notification to ensure I am getting notified of more PRs and issues that I need to be responding to. I understand you do not have the time to continue the efforts on this PR. Did you want to close? If someone else wants to pick it up they can surely start from this PR. Also, regarding etcd2v2 being deprecated I did notice this issue #61034 which is slated for the next release so that should be handled soon. |
yes, any further maintenance of this PR after 1600 lines of code + documentation, after being previously approved yet lost in some fake project, and attempted continued maintenance.. will definitely not happen. even moreso as it's being completely deprecated in favor of an official saltstack employee's different design, and even most-so because development and administration is not-at-all my profession. the only other returner that actually has tests is local_cache as the rest are basically smoke tests due to them using a write-only medium. if anybody by sheer luck learns about the deprecated etcd returner, they might be able to use it via the awesome module synchronization system you guys fortunately merged half a decade ago. just do me a favor make your version of the etcd returner not suck. etcd has a lot of features that make it pretty ideal as a r/w distributed returner with the ability to trigger other forms of automation.. such as being able to link and time out keys containing job information automatically after a given period of time (no need to manually spend cpu time expiring old jids). the majority of the returners are entirely incomplete, and the only one that can be considered a reference implementation just thrashes the disk i/o in default configurations which is entirely not ideal on virtualized infrastructure. |
Alrighty, I'll close this PR and if you want to add any other suggestions in this issue #61034 to ensure the etcd3 support is adequate I would appreciate it. Please let me know if you want me to re-open. |
What does this PR do?
This PR implements the
update_endtime
andget_endtime
functions that are also implemented in thesalt.returners.local_cache
returner. It seems that these functions are updated when using the display_progress functionality in some of the runners. These aren't documented anywhere but within that returner, but this should implement everything that is supported collectively by all of the returners. The only thing it fails to implement is theget_register
andload_register
functions(?) which was only used by thorium which has since been deprecated.The documentation for this PR has also been updated to describe the new ".endtime" addition to the schema.
Project 5 has a card mentioning that PR #51363 needs to be ported to master. Since I was the original author of that PR and needed these capabilities, I re-based it on top of master and added the new functionality. This PR is the result of that port with the new additions.
What issues does this PR fix or reference?
This is PR #51363, ported to master as mentioned in project https://github.com/saltstack/salt/projects/5#card-28249107, along with two new functions that make it consistent with the
salt.returners.local_cache
returner.Previous Behavior
Previously these functions weren't implemented as none of the other returners seemed to define them. This might be for a particular case, but I figured that we might as well have a complete returner implementation that can be used as a reference.
New Behavior
Now jobs can be updated with the
endtime
that is passed as a string to theupdate_endtime
function.Tests written?
This uses the exact same interface as the previous etcd returner that was already merged, so the already existing tests should exhaustively test this.
Commits signed with GPG?
No
(edited to describe the new editions of this PR. Please review history of this comment to see prior reason for the PR)