-
Notifications
You must be signed in to change notification settings - Fork 45
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
use cache.grains function to display inventory data #551
Conversation
note: the cache API is in https://docs.saltproject.io/en/latest/ref/runners/all/salt.runners.cache.html |
this looks like a nice addition to SaltGUI as it can be implemented just using the salt-api. any decision on the implementation of the cache will not affect SaltGUI. when made available in SaltGUI, it should be done for all 3 categories: grains, pillars and mine. (support for 'mine' is on a development branch only at this moment). steps:
|
technical overview, current function use:
[*] Nodegroups screen is only reachable when at least one nodegroup is defined |
output for (salt)
output for (salt-run)
--> OK to use as replacement |
output for (salt)
output for (salt-run)
--> OK to use as replacement |
output for (salt)
there is no strict equivalent that uses the cache. --> OK to use as replacement (i.e. use |
changed this github issue to a PR |
decision: let's not bother with the |
996ab4f
to
3c6a324
Compare
@mbgevers
but you can also switch it on for the current session in the Options screen (ctrl-click on the SaltGUI logo). Can you give it a try? |
Only seen this comment now, yeah for sure will give it a try |
Hi, doing some testing at the moment, looks good so far, however found some drawbacks. There should be some symbol indicating if a minion is online (thus no cache used) or offline (cache used) what do you think about that? So cached should be a fallback. Thx much for your work already! |
I'll investigate on how to display the offline status in a different way. |
I just had the idea, it should be sufficient if you just write the "cache timestamp" or "last cache update time" if that info is somehow available. Another maybe even easier method would be to only load cache if device is offline. |
no such facility is described in https://docs.saltproject.io/en/latest/ref/runners/all/salt.runners.cache.html
there should be no problem to always using cached information. it is used often in SaltStack. e.g. each time you the The problem that we still need to solve is that regular salt-functions (those executed on minions) indirectly provide availability-indicator as extra information because they fail. In SaltGUI this was even optimized by using an extra call (wheel.minions.connected), so that the availability information is already visible while you are waiting. But with the use of cached information, that indicator is overwritten by the cached information. I'm now changing the presentation of that, so that it remains visible in all cases. |
@mbgevers |
That looks nice, thank you. |
Quality Gate passedKudos, no new issues were introduced! 0 New issues |
Hi,
When doing some research on why i never get cached minion data on SaltGUI i discovered #538 which mentions there is a need for a database, however i found another possible solution:
Instead of using a Backend-Database to display some inventory/stored grains data of minions it should be possible to use the cache.grains function as documented in https://docs.saltproject.io/en/latest/topics/cache/index.html it looks like this cache also supports multiple backends/modules, see https://docs.saltproject.io/en/latest/ref/cache/all/index.html#all-salt-cache for a list so the database question is also answered.
It looks like implementing this could be really easy, actually a config-file option which exchanges the "normal grains command" with the "cached grains command" should do the job perfectly. After that only the documentation of salt for cached grains has to be followed.
If somebody wants to implement, just ensure to not hit saltstack/salt#48694
As we are just starting with salt, i would be willing to test.
Kind regards
Mike