The old converged detection was hacked in code, instead of something with a nice interface. This cleans it up, splits it into a separate file, and removes a race condition that happened with the old code. We also take the time to get rid of the ugly Set* methods and replace them all with a single AssociateData method. This might be unnecessary if we can pass in the Converger method at Resource construction. Lastly, and most interesting, we suspend the individual timeout callers when they've already converged, thus reducing unnecessary traffic, and avoiding fast (eg: < 5 second) timers triggering more than once if they stay converged! A quick note on theory for any future readers... What happens if we have --converged-timeout=0 ? Well, for this and any other positive value, it's important to realize that deciding if something is converged is actually a race between if the converged timer will fire and if some random new event will get triggered. This is because there is nothing that can actually predict if or when a new event will happen (eg the user modifying a file). As a result, a race is always inherent, and actually not a negative or "incorrect" algorithm. A future improvement could be to add a global lock to each resource, and to lock all resources when computing if we are converged or not. In practice, this hasn't been necessary. The worst case scenario would be (in theory, because this hasn't been tested) if an event happens *during* the converged calculation, and starts running, the exit command then runs, and the event finishes, but it doesn't get a chance to notify some service to restart. A lock could probably fix this theoretical case.
mgmt: This is: mgmt!
Community:
Come join us on IRC in #mgmtconfig on Freenode! You may like the #mgmtconfig hashtag if you're on Twitter.
Questions:
Please join the #mgmtconfig IRC community! If you have a well phrased question that might benefit others, consider asking it by sending a patch to the documentation FAQ section. I'll merge your question, and a patch with the answer!
Quick start:
- Either get the golang dependencies on your own, or run
make depsif you're comfortable with how we install them. - Run
make buildto get a freshly builtmgmtbinary. - Run
cd $(mktemp --tmpdir -d tmp.XXX) && etcdto get etcd running. Themgmtsoftware will do this automatically for you in the future. - Run
time ./mgmt run --file examples/graph0.yaml --converged-timeout=1to try out a very simple example! - To run continuously in the default mode of operation, omit the
--converged-timeoutoption. - Have fun hacking on our future technology!
Examples:
Please look in the examples/ folder for more examples!
Documentation:
Please see: DOCUMENTATION.md or PDF.
Roadmap:
Please see: TODO.md for a list of upcoming work and TODO items. Please get involved by working on one of these items or by suggesting something else! Feel free to grab one of the straightforward #mgmtlove issues if you're a first time contributor to the project or if you're unsure about what to hack on!
Bugs:
Please set the DEBUG constant in main.go to true, and post the logs when you report the issue.
Bonus points if you provide a shell or OMV reproducible test case.
Feel free to read my article on debugging golang programs.
Dependencies:
-
golang 1.4 or higher (required, available in most distros)
-
golang libraries (required, available with
go get)go get github.com/coreos/etcd/client go get gopkg.in/yaml.v2 go get gopkg.in/fsnotify.v1 go get github.com/codegangsta/cli go get github.com/coreos/go-systemd/dbus go get github.com/coreos/go-systemd/util -
stringer (required for building), available as a package on some platforms, otherwise via
go getgo get golang.org/x/tools/cmd/stringer -
pandoc (optional, for building a pdf of the documentation)
-
graphviz (optional, for building a visual representation of the graph)
Patches:
We'd love to have your patches! Please send them by email, or as a pull request.
On the web:
- Introductory blog post: https://ttboj.wordpress.com/2016/01/18/next-generation-configuration-mgmt/
- Introductory recording from DevConf.cz 2016: https://www.youtube.com/watch?v=GVhpPF0j-iE&html5=1
- Introductory recording from CfgMgmtCamp.eu 2016: https://www.youtube.com/watch?v=fNeooSiIRnA&html5=1
- Julian Dunn at CfgMgmtCamp.eu 2016: https://www.youtube.com/watch?v=kfF9IATUask&t=1949&html5=1
- Walter Heck at CfgMgmtCamp.eu 2016: http://www.slideshare.net/olindata/configuration-management-time-for-a-4th-generation/3
- Marco Marongiu on mgmt: http://syslog.me/2016/02/15/leap-or-die/
- Felix Frank on puppet to mgmt "transpiling" https://ffrank.github.io/features/2016/02/18/from-catalog-to-mgmt/
- Blog post on automatic edges and the pkg resource: https://ttboj.wordpress.com/2016/03/14/automatic-edges-in-mgmt/
Happy hacking!




