-
-
Notifications
You must be signed in to change notification settings - Fork 741
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
Pack Install should be Idempotent #3052
Comments
I personally like it to keep it simple and idempotent (so just download and reinstall the pack). Logic to determine if pack is already installed completely would be quite complex (would need to some how very that pack is correctly installed - checksum or similar, files are in place, etc. it's also more problematic because "install" consists of multiple steps which we can't easily make as part of a "transaction") and this introduce all kinda of edge cases probably. If we can make the whole approach very robust, I would be fine with it though. |
I don't think that current pack install is "really" Idempotent, even when pinning the version We assume it is Idempotent in perfect "vacuum" conditions. But in real life any process involving re-running a bunch of logic could produce different results:
So the better way is not to change the resource, if it's already in desired state. But the most annoying thing is that re-applying If And yeah, I agree that it could be hard to do the right way, preserving the state and so on. |
+1 |
Current
st2 pack install
always re-downloads and re-installs the pack, no matter what.If pack is already installed - we shouldn't reinstall it again, unless some special flag or command specified. Re-downloading/re-installing by default takes time and in fact, it's
upgrade
(if no version is pinned) or maybereinstall
(if version specified).Example story is configuration management tools, when you apply playbook/cookbook on a set of machines. Apart of deploying st2, it for example can install a bunch of st2 packs (10-20) on the same machine. And it's normal to run playbook on the same machine several times. Re-downloading/Re-installing packs every time takes time and it's a waste of resources and doesn't guarantee successfull execution every time.
See related discussion #2982 (comment)
The text was updated successfully, but these errors were encountered: