Merge branch 'topic/christian/cluster-controller'

* topic/christian/cluster-controller:
  Add a cluster controller testcase for agent-controller checkin
  Add zeek-client via new submodule
  Update baselines affected by cluster controller changes
  Introduce cluster controller and cluster agent scripting
  Establish a separate init script when using the supervisor
  Add optional bare-mode boolean flag to Supervisor's node configuration
  Add support for making the supervisor listen for requests
  Add support for setting environment variables via supervisor
This commit is contained in:
Christian Kreibich 2021-07-08 16:49:55 -07:00
commit 8db985ea78
41 changed files with 1483 additions and 7 deletions

View file

@ -42,8 +42,13 @@ export {
stdout_file: string &optional;
## The filename/path to which the node's stderr will be redirected.
stderr_file: string &optional;
## Whether to start the node in bare mode. When left out, the node
## inherits the bare-mode status the supervisor itself runs with.
bare_mode: bool &optional;
## Additional script filenames/paths that the node should load.
scripts: vector of string &default = vector();
## Environment variables to define in the supervised node.
env: table[string] of string &default=table();
## A cpu/core number to which the node will try to pin itself.
cpu_affinity: int &optional;
## The Cluster Layout definition. Each node in the Cluster Framework

View file

@ -4,6 +4,7 @@
##! That is, it may change in various incompatible ways without warning or
##! deprecation until the stable 4.0.0 release.
@load base/frameworks/broker
@load ./api
module SupervisorControl;
@ -15,6 +16,10 @@ export {
## for their topic names.
const topic_prefix = "zeek/supervisor" &redef;
## When enabled, the Supervisor will listen on the configured Broker
## :zeek:see:`Broker::default_listen_address`.
const enable_listen = F &redef;
## Send a request to a remote Supervisor process to create a node.
##
## reqid: an arbitrary string that will be directly echoed in the response

View file

@ -3,7 +3,6 @@
@load ./api
@load ./control
@load base/frameworks/broker
function Supervisor::status(node: string): Supervisor::Status
{
@ -42,6 +41,13 @@ function Supervisor::node(): Supervisor::NodeConfig
event zeek_init() &priority=10
{
if ( Supervisor::is_supervisor() && SupervisorControl::enable_listen )
{
Broker::listen(Broker::default_listen_address,
Broker::default_port,
Broker::default_listen_retry);
}
Broker::subscribe(SupervisorControl::topic_prefix);
}

View file

@ -0,0 +1,5 @@
##! This script loads functionality needed by the supervisor. Zeek only sources
##! this when the supervisor is active (-j). Like init-default.zeek, this isn't
##! loaded in bare mode.
@load base/frameworks/supervisor