This change set is for enabling MineMeld (minemeld-core and
minemeld-webui to be debugged on the desktop using docker to run the
required services, PyCharm for editing and debugging minemeld-core,
and WebStorm for editing and debugging minemeld-webui. To accomplish
this, changes are required to be able to configure remote connections
to the services as they appear remote when running in the docker
containers.
The minemeld/cli files are used for creating debug targets in
PyCharm. These guarantee that GEvent monkey patching is performed
before loading other files.
The collectd path can be prefixed with tcp://, in which case a
remote connection to collectd will be created. Otherwise, a UNIX
socket at the specified path is created.
The zmqredis file was modified to centralize the creation of the
path to connect or bind to, reducing the number of times
'ipc:///var/run/minemeld/' is hardcoded into the file and
standardizing the interpretation of '@' at the beginning of the
path. It should also be possible to use TCP as the ZMQ transport
using tcp:// as the configured path, though this has not been
attempted.
Since minemeld-core is being run not as an installed package, it was
necessary to introduce 'initialize_default_nodes_distribution()' to
load nodes from the json file at startup so that the node prototypes
can be found.
Configuration, such as the redis URL, is looked up from
configuration using a 'get_config_value()' convenience function
which loads from this path until the value is found:
1) config (e.g MGMTBUS.config.redis_url)
2) os.environ (e.g. MGMTBUS_CONFIG_REDIS_URL)
3) the provided default value
This change set is for enabling MineMeld (minemeld-core and minemeld-webui to be debugged on the desktop using docker to run the required services, PyCharm for editing and debugging minemeld-core, and WebStorm for editing and debugging minemeld-webui. To accomplish this, changes are required to be able to configure remote connections to the services as they appear remote when running in the docker containers.
The minemeld/cli files are used for creating debug targets in PyCharm. These guarantee that GEvent monkey patching is performed before loading other files.
The collectd path can be prefixed with tcp://, in which case a remote connection to collectd will be created. Otherwise, a UNIX socket at the specified path is created.
The zmqredis file was modified to centralize the creation of the path to connect or bind to, reducing the number of times 'ipc:///var/run/minemeld/' is hardcoded into the file and standardizing the interpretation of '@' at the beginning of the path. It should also be possible to use TCP as the ZMQ transport using tcp:// as the configured path, though this has not been attempted.
Since minemeld-core is being run not as an installed package, it was necessary to introduce 'initialize_default_nodes_distribution()' to load nodes from the json file at startup so that the node prototypes can be found.
Configuration, such as the redis URL, is looked up from configuration using a 'get_config_value()' convenience function which loads from this path until the value is found: 1) config (e.g MGMTBUS.config.redis_url) 2) os.environ (e.g. MGMTBUS_CONFIG_REDIS_URL) 3) the provided default value
See https://github.com/sddj/minemeld-docker for the required base files and setup instructions.