James Shubin 790b7199ca lang: New function engine
This mega patch primarily introduces a new function engine. The main
reasons for this new engine are:

1) Massively improved performance with lock-contended graphs.

Certain large function graphs could have very high lock-contention which
turned out to be much slower than I would have liked. This new algorithm
happens to be basically lock-free, so that's another helpful
improvement.

2) Glitch-free function graphs.

The function graphs could "glitch" (an FRP term) which could be
undesirable in theory. In practice this was never really an issue, and
I've not explicitly guaranteed that the new graphs are provably
glitch-free, but in practice things are a lot more consistent.

3) Simpler graph shape.

The new graphs don't require the private channels. This makes
understanding the graphs a lot easier.

4) Branched graphs only run half.

Previously we would run two pure side of an if statement, and while this
was mostly meant as an early experiment, it stayed in for far too long
and now was the right time to remove this. This also means our graphs
are much smaller and more efficient too.

Note that this changed the function API slightly. Everything has been
ported. It's possible that we introduce a new API in the future, but it
is unexpected to cause removal of the two current APIs.

In addition, we finally split out the "schedule" aspect from
world.schedule(). The "pick me" aspects now happen in a separate
resource, rather than as a yucky side-effect in the function. This also
lets us more precisely choose when we're scheduled, and we can observe
without being chosen too.

As usual many thanks to Sam for helping through some of the algorithmic
graph shape issues!
2025-09-11 23:19:45 -04:00
2025-01-26 17:17:02 -05:00
2025-09-09 02:21:59 -04:00
2025-01-26 16:24:51 -05:00
2025-09-11 23:19:45 -04:00
2025-09-11 23:19:45 -04:00
2025-01-26 16:24:51 -05:00
2025-09-11 23:19:45 -04:00
2025-09-11 23:19:45 -04:00
2025-01-26 16:24:51 -05:00
2025-09-11 23:19:45 -04:00
2025-09-11 23:19:45 -04:00
2025-09-11 23:19:45 -04:00
2025-09-09 00:04:21 -04:00
2025-02-24 16:01:46 +01:00
2025-01-26 16:24:51 -05:00
2025-09-11 23:19:45 -04:00
2025-09-11 23:19:45 -04:00
2025-09-11 23:19:45 -04:00
2016-05-21 11:08:14 +02:00
2025-05-06 02:52:26 -04:00
2024-03-05 01:05:50 -05:00
2025-01-26 16:24:51 -05:00
2025-01-26 16:24:51 -05:00
2025-09-09 02:21:59 -04:00
2025-09-09 02:21:59 -04:00
2016-01-04 21:00:13 -05:00
2015-09-25 01:16:03 -04:00
2024-11-23 01:25:40 -05:00
2019-11-17 20:25:06 -05:00

mgmt: next generation config management!

mgmt!

Go Report Card Build Status GoDoc Matrix IRC Patreon Liberapay

Tip

Resource reference guide now available!

Tip

Function reference guide now available!

About:

Mgmt is a real-time automation tool. It is familiar to existing configuration management software, but is drastically more powerful as it can allow you to build real-time, closed-loop feedback systems, in a very safe way, and with a surprisingly small amount of our mcl code. For example, the following code will ensure that your file server is set to read-only when it's friday.

import "datetime"
$is_friday = datetime.weekday(datetime.now()) == "friday"
file "/srv/files/" {
	state => $const.res.file.state.exists,
	mode => if $is_friday { # this updates the mode, the instant it changes!
		"0550"
	} else {
		"0770"
	},
}

It can run continuously, intermittently, or on-demand, and in the first case, it will guarantee that your system is always in the desired state for that instant! In this mode it can run as a decentralized cluster of agents across your network, each exchanging information with the others in real-time, to respond to your changing needs. For example, if you want to ensure that some resource runs on a maximum of two hosts in your cluster, you can specify that as well:

import "sys"
import "world"

# we'll set a few scheduling options:
$opts = struct{strategy => "rr", max => 2, ttl => 10,}

# schedule in a particular namespace with options:
$set = world.schedule("xsched", $opts)

if sys.hostname() in $set {
	# use your imagination to put something more complex right here...
	print "i got scheduled" {} # this will run on the chosen machines
}

As you add and remove hosts from the cluster, the real-time schedule function will dynamically pick up to two hosts from the available pool. These specific functions aren't intrinsic to the core design, and new ones can be easily added.

Please read on if you'd like to learn more...

Community:

Come join us in the mgmt community!

Medium Link
Matrix #mgmtconfig on Matrix.org
IRC #mgmtconfig on Libera.Chat
Twitter @mgmtconfig & #mgmtconfig
Mailing list looking for a new home, suggestions welcome
Patreon purpleidea on Patreon

Status:

Mgmt is a next generation automation tool. It has similarities to other tools in the configuration management space, but has a fast, modern, distributed systems approach. The project contains an engine and a language. Please have a look at an introductory video or blog post.

Mgmt is a fairly new project. It is usable today, but not yet feature complete. With your help you'll be able to influence our design and get us to 1.0 sooner! Interested users should read the quick start guide.

Documentation:

Please read, enjoy and help improve our documentation!

Documentation Additional Notes
quick start guide for everyone
frequently asked questions for everyone
general documentation for everyone
resource reference for everyone
function reference for everyone
language guide for everyone
function guide for mgmt developers
resource guide for mgmt developers
style guide for mgmt developers
contributing guide for mgmt contributors
service API guide for external developers
godoc API reference for mgmt developers
prometheus guide for everyone
puppet guide for puppet sysadmins
development for mgmt developers
videos for everyone
blogs for everyone

Questions:

Please ask in the community! If you have a well phrased question that might benefit others, consider asking it by sending a patch to the FAQ section. I'll merge your question, and a patch with the answer!

Get involved:

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! Please get involved by working on one of these items or by suggesting something else! There are some lower priority issues and harder issues available in our TODO file. Please have a look.

Bugs:

Please set the DEBUG constant in main.go to true, and post the logs when you report the issue. Feel free to read my article on debugging golang programs.

Patches:

We'd love to have your patches! Please send them by email, or as a pull request.

On the web:

Blog posts and recorded talks about mgmt are listed here!

Happy hacking!

Description
No description provided
Readme 12 MiB
Languages
Go 95%
Shell 2.3%
Yacc 0.9%
Makefile 0.8%
JavaScript 0.4%
Other 0.6%