Skip to content
This repository has been archived by the owner on Mar 16, 2023. It is now read-only.

Allow desktop development using docker services #345

Open
wants to merge 2 commits into
base: develop
Choose a base branch
from

Conversation

sddj
Copy link
Contributor

@sddj sddj commented Aug 21, 2019

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.

sddj added 2 commits August 21, 2019 09:23
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.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant