Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

EMG can be installed using NPM from the public NPMjs.com repo but EMG plugins need to be installed manually. #95

Open
asnowfix opened this issue Feb 1, 2017 · 0 comments

Comments

@asnowfix
Copy link

asnowfix commented Feb 1, 2017

Problem Statement

Each EMG plugins needs to be installed (or linked to) <EDGEMICRO_HOME>/plugins. A plugin is made (at a minimum) of a package.json and an index.js, which makes it looking like a legitimate NPM module.

In order to integrate an EMG custom plugin as a real legitimate NPM module (from the public NPMjs.com or from a private NPM registry), one need to install it & then symlink it into the EMG plugins folder…

$ npm install -g my-npm-module
$ cd <EDGEMICRO_HOME>/plugins
$ ln -s <NPM-PATH>/my-npm-module my-emg-plugin

...and finally edit the ~/.edgemicro/<org>-<env>-config.yaml to insert it into the plugins: list.

  plugins:
    sequence:
      - oauth
      - my-emg-plugin

These are multiple operations, both at NPM, Shell & configuration level. They could be made simpler (and less OS-specific) using only NPM & EMG configuration.

Possible Solutions

  1. Use the NPM module resolver (load them using require(‘my-emg-plugin’) as a fallback for plugins not found into <EDGEMICRO_HOME>/plugins.
  2. Add a manual mapping between NPM modules and EMG plugin names in ~/.edgemicro/<org>-<env>-config.yaml, like (for example) the below.
  3. Download custom plugin & its configuration from Edge Cloud (much like Edge Cloud Call-Out policies)
  plugins:
    npm:
      - my-emg-plugin
        my-npm-module
      - my-other-emg-plugin
        my-other-npm-module
    sequence:
      - oauth
      - my-emg-plugin

Recommendation

Proposal (2) above adds more information in the configuration file, but gives complete control to the developer of the NPM module names (eg. can adopt a naming convention to differentiate them from other general purpose NPM modules like ‘edgemicro-plugin-my-logic’) and the EMG plugin name (eg. ‘my-logic’)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant