Development

Development setup

This data source plugin consists of both frontend and backend components.

Front-end Development

LTS version of Node.js is recommended. If you’re new to the Node.js ecosystem, Node Version Manager is a good place to start for managing different Node.js installations and environments.

Grafana’s plugin tools is used to develop the plugin. Please refer the documentation for more information.

  1. Begin by installing Yarn (https://yarnpkg.com/)

    npm install -g yarn
    
  2. Install dependencies

    yarn install
    
  3. Build plugin in development mode or run in watch mode

    yarn dev
    

    or

    yarn watch
    
  4. Build plugin in production mode

    yarn build
    

Back-end Development

If the Mage build tool is not already installed, you may install it using the installation instructions on the Mage homepage

  1. Update Grafana plugin SDK for Go dependency to the latest minor version:

    go get -u github.com/grafana/grafana-plugin-sdk-go
    
  2. Build backend plugin binaries for Linux, Windows and Darwin:

    mage -v
    
  3. List all available Mage targets for additional commands:

    mage -l
    

Build documentation

This documentation is build by Sphinx. Follow below steps to build documentation.

python -m venv env
source env/bin/activate
pip install sphinx myst-parser sphinx_rtd_theme
cd docs
make html

Development Environment

Development Containers is available for development. You can launch a development container directly from Visual Studio Code.

The repository also includes a docker-compose.yaml file for the test environment. The compose file defines the following four containers:

  • grafana

  • mariadb

  • archappl

  • ioc

The ioc container automatically runs softIoc.

The Archiver Appliance also starts automatically in the archappl container. However, no PVs are registered by default. You need to register PVs manually for archiving.

The Grafana server runs in the grafana container. To retrieve data from archappl, you need to add a new data source using this plugin. Use the following URL to access data from archappl: http://archappl:8080/retrieval