This repository has been archived by the owner on Jan 24, 2024. It is now read-only.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
SEP 22: Compartmentalize salt: Use pop-grains (grainsv2) for grain collection #30
SEP 22: Compartmentalize salt: Use pop-grains (grainsv2) for grain collection #30
Changes from all commits
03635e4
3dbf254
f94cd0e
18c9083
ffd805d
87ad286
ea5a4f1
f2c8705
File filter
Filter by extension
Conversations
Jump to
There are no files selected for viewing
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.
My impression is that scaling issues currently revolve around the event bus and job storage, not the grains implementation. Can we elaborate on what we mean by scale here? How does the current implementation fail to scale? How does the proposed change make things more scalable?
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.
@thatch45 ^^
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.
Are there other alternative approaches we could take instead of 'Plugin Oriented Programming'?
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.
For something as important as grains to be changing, I'd like to take a more in depth look at POP in salt to understand the significance before a major migration is undertaken.
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.
Would and alternate method be to simply split up core.py into multiple files?
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.
Grains is the first focus of this SEP and the associated changes. It also opens the door for getting execution modules and state modules from idem in the future. For example, Mac specific execution modules could be put in idem-darwin, tested in idem-darwin, and PRs/issues can be handled by the Mac working group. Grainsv2 is the simplest and first step towards more compartmentalization of salt in this way.
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.
This is one of the thing I think that should be highlighted more in the SEP. We're saying this is opening the door to door to all of these changes, but we're also saying
Which is it?
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.
Are we sure that all of the changes that have taken place in recent releases are also present in the current pop version?
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.
I have been focused on idem-cloud since March, there will need to be a code freeze of future PRs into core.py and changes in the past two months into core.py will need to be merged into the new platform.
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.
Which bugs specifically?
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.
No specific open issues, but a lot of work has been done to standardize grains between the different idem platforms. For example, idem-windows implements the
oscodename
grain and thegpus
grain, which are missing on windows in salt. grainsv2 is more complete and consistent across all platformsThere 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.
Have PRs been opened to fix these things in the current grains?
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.
not to my knowledge.
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.
conflicts directly with
Are there open bugs that this solves, or not? If not, perhaps this SEP should not claim that there are. Regardless, I think this point needs to be clarified.
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.
Are they tested against current versions of salt?
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.
yes, this PR has a test that runs both versions of grains and does a line by line comparison of each
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.
Farming out implementations to outside of salt itself h bring up new continuity issues when there's no central authority to determine if for example Ubuntu or Void has the "official/accepted/blessed" format/implementation.
(Examples picked for systemd disagreement reasons)
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.
Good point, also, how would we ensure that a
requires_reboot
grain on one system isn't namedrequires_restart
on another system?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.
To build on @dwoz's question, assuming that the platform-specific projects are going to be providing certain grains that used to be in core.py, what are the plans for enforcing that a given platform's
idem-XXXXX
project provides the grains it is supposed to?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.
I think we should discuss how we gate this change. Adding a config value that will be rendered un-needed in a future release doesn't seem like a great approach to me.
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.
Perhaps a new value isn't necessary. We have
use_superseded
, which was only being used for the format change inmodule.run
. Couldn't it be used here?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.
So does this mean that no new core grains will be able to be added to Python 3.5 platforms (Ubuntu 16.04 LTS, etc.)?
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.
What indicators will be used to gauge the
maturity
of this new version? How can we ensure that we're not decreasing stability of salt? What tests need to be run?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.
I don't think it is fair to say the only alternative is maintaining a monolith. I can think of several other possibilities.
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.
While the purpose of this sep does not intend to provide an answer to this question it certainly seems to provide an opinion about it. I feel it would be pertinent to this discussion, especially because the current PR implementing this change is adding a lot more than just a grains specific library. The addition of idem-* means would be adding idem and POP into salt core.
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.
You're right, this SEP and the accompanying PR do provide strong opinions on this, I mean to say that the future of idem in POP in salt has been discussed by a small group, but warrants a larger discussion, more firm plans, and possibly it's own SEP. With this PR we add the
__hub__
to the loader, which means custom execution modules and states could make use of idem's hub... but we have discussed adding the option to specify the salt/idem engine in salt states (defaulting to the salt engine) is a possible future integration of idem into salt. This SEP opens the door for that discussion, but that is an implementation/discussion that should happen separately from grains.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.
Seems like the addition of
__hub__
is inviting a lot of confusion and potential complexity to and already complex code base in regards to the loader. What problem is the addition of__hub__
intended to solve? How will developers know which one to use? What happens if we mix the use of__salt__
and__hub__
?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.
Have we had a discussion with the core team and community at large around how we want to compartmentalize salt or has this decision been made (by a small group) already?
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.
Compartmentalizing salt is a discussion that has been had in small groups, and it will happen in larger groups before decisions are made
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.
I feel the asyncio portion also warents further exploration and discussion. Especially considering the challenges we've had trying to upgrade tornado to a version which uses asyncio.
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.
Pure python grains and idem-posix are great ideas 👍. We will create an
idem-universal
for pure python grains/exec/state modules andidem-posix
that has the shared code between posix platforms. I am especially a fan of not having to push updates to idem's implementation of cmd.run to 7 different platform specific repos. Code that is similar between platforms should be in universal repos.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.
This seems like we are adding a fair amount management and community synchronization overhead. Are we sure we have thought through all of this and developed the processes needed to deal with it?
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.
I think this is an excellent point and exposes the crux of what needs to be discussed in this SEP. Broadly I've speculated that the windows working group would manage idem-windows and the mac working group would manage idem-darwin and at a certain point in the release there would be a discussion about which version of idem-darwin and idem-windows would be pinned to the next release of salt. But we do need a concrete process in place.
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.
Specifically what documentation are we lacking now? What is the plan and time-lines around getting all of the needed documentation in place?
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.
For grains there isn't much more documentation changes that will need to happen, but for the future of the compartmentalization of salt this is an unaddressed problem. Execution and state modules could be maintained in platform specific projects... How do we merge that documentation into salt?