minion-agent-client

Version, currently master branch1 version
  • master branchlatestJun 23, 2020

github.com/wyhaines/minion-agent-client.cr

This is the Crystal implementation of the Minion Agent Client.

0 stars
0 dependents
License: MIT

Installation

# Add this to your shard.yml
dependencies:
  minion-agent-client:
    github: wyhaines/minion-agent-client.cr
    branch: master

master is a branch, not a release, so this tracks it rather than pinning a version.

Then run:

shards install

shard.yml

Crystal
0.35.1
License
MIT
Author
Kirk Haines

Dependencies

Runtime Dependencies

README

Minion Agent Client

This is the Crystal version of the Minion Agent Client.

It provides a Crystal Language library to connect to and interact with a Minion Streamserver.

Key features currently:

  • Connects to a streamserver
  • Basic authentication
  • Can send logs
  • Sophisticated handling of server failures; messages and logs are queued locally, and spooled back to the server when it reconnects.
  • Is generally robust to poor network connections and losing connectivity.
  • Interactive Agent REPL Shell to manually send and receive from the stream server.

TODO:

  • Fix failure handling. It actually has a bug right now.
  • Add support for TLS encryption of the socket communications.
  • Add a real debug option to show all communications.

Communications Protocol

The payloads are serialized using the MessagePack protocol. MessagePack does not serialize the length of the serialized data, which negatively affects network read performance. To work around this, all data which is sent or received is prefixed with two bytes which encode the length of the data packet that follows.

The total size of this two byte header plus the data packet can be no longer than 8k (8192 bytes).

The two byte length is transfered in Big Endian order.

So, for example, consider the following message:

2020-06-10 16:23:50 -06:00|stderr|warn|this is very very serious

That is 66 bytes when serialized to MessagePack. Expressed as two bytes, big endian, that is:

00.42

Those two bytes should be the first two sent, and then immediately after those bytes should come the other 66 bytes.