{"id":3783,"date":"2018-04-25T09:25:06","date_gmt":"2018-04-25T08:25:06","guid":{"rendered":"https:\/\/www.devco.net\/?p=3783"},"modified":"2018-04-25T10:10:56","modified_gmt":"2018-04-25T09:10:56","slug":"choria-progress-update-2","status":"publish","type":"post","link":"https:\/\/www.devco.net\/archives\/2018\/04\/25\/choria-progress-update-2.php","title":{"rendered":"Choria Progress Update"},"content":{"rendered":"
It’s been a while since my previous update<\/a> and quite a bit have happened since.<\/p>\n As previously mentioned the Choria Server will aim to replace mcollectived<\/em> eventually. Thus far I was focussed on it’s registration subsystem, Golang based MCollective RPC compatible agents and being able to embed it into other software<\/a> for IoT and management backplanes.<\/p>\n Over the last few weeks I learned that MCollective will no longer be shipped in Puppet Agent version 6 which is currently due around Fall 2018. This means we have to accelerate making Choria standalone in it’s own right.<\/p>\n A number of things have to happen to get there:<\/p>\n Yesterday I released the first step in this direction, you can now replace mcollectived<\/em> with choria server<\/em>. For now I am marking this as a preview\/beta feature while we deal with issues the community finds.<\/p>\n The way this works is that we provide a small shim that uses just enough of MCollective to get the RPC framework running – luckily this was initially developed as a MCollective plugin and it retained its quite separate code base. When the Go code needs to invoke a ruby agent it will call the shim to do so, the shim in turn will provide the result from the agent – in JSON format – back to Go.<\/p>\n This works for me with any agent I’ve tried it with and I am quite pleased with the results:<\/p>\n <\/code><\/p>\n MCollective would of course include the entire Puppet as soon as any agent that uses Puppet is loaded – service, package, puppet – and so over time things only get worse. Here is Choria:<\/p>\n <\/code><\/p>\n I run a couple 100 000 instances of this and this is what you get, it never changes really. This is because Choria spawns the Ruby code and that will exit when done.<\/p>\n This has an unfortunate side effect that the service<\/em>, package<\/em> and puppet<\/em> agents are around 1 second slower per invocation because loading Puppet is really slow. Ones that do not load Puppet are only marginally slower.<\/p>\n <\/code><\/p>\n There is a page set up dedicated to the Beta<\/a> that details how to run it and what to look out for.<\/p>\n Some of the reasons for breakage that you might run into – like mco facts<\/em> is not working now with Choria Server – is due to a hugely significant change in the background. Choria – both plugged into MCollective and Standalone – is JSON safe. The Ruby Plugin is optionally so (and off by default) but the Choria daemon only supports JSON.<\/p>\n Traditionally MCollective have used YAML on the wire, being quite old JSON was really not that big a deal back in the early 2000s when the foundation for this choice was laid down, XML was more important. Worse MCollective have exposed Ruby specific data types and YAML extensions on the wire which have made creating cross platform support nearly impossible.<\/p>\n YAML is also of course capable of carrying any object – which means some agents are just never going to be compatible with anything but Ruby. This was the case with the process<\/em> agent but I fixed that before shipping it in Choria. It also essentially means YAML can invoke things you might not have anticipated and so happens big security problems.<\/p>\n Since quite some time now the Choria protocol is defined, versioned and JSON schemas are available. The protocol makes the separation between Payload, Security, Transport and Federation much clearer and the protocol can now support anything that can move JSON – Middleware, REST, SSH, Postal Doves are all capable of carrying Choria packets.<\/p>\nChoria Server<\/H2><\/p>\n
\n
<\/p>\n
\r\nUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\r\nroot 10820 0.0 1.1 1306584 47436 ? Sl 13:50 0:06 \/opt\/puppetlabs\/puppet\/bin\/ruby \/opt\/puppetlabs\/puppet\/bin\/mcollectived\r\n<\/pre>\n
<\/p>\n
\r\nUSER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND\r\nroot 32396 0.0 0.5 296436 9732 ? Ssl 16:07 0:03 \/usr\/sbin\/choria server --config=\/etc\/choria\/server.conf\r\n<\/pre>\n
<\/p>\n
\r\nirb(main):002:0> Benchmark.measure { require \"puppet\" }.real\r\n=> 0.619865644723177\r\n<\/pre>\n
JSON pure protocol<\/H2><\/p>\n