eclipse-volttron / volttron-platform-driver

Apache License 2.0
0 stars 5 forks source link

New Platform Driver Agent #2

Closed craig8 closed 2 years ago

craig8 commented 2 years ago

volttron running

pip install volttron-platform-driver
pip install volttron-platform-driver[bacnet]
pip install volttron-platform-driver[modbus]
pip install volttron-platform-driver[blah]

All drivers would have a prefix of volttron.drivers
and things that the platform-driver could reference would be loaded from
that path.

Just like the services are loaded in the base volttron-core repository.

volttron-drivers repository

volttron-platform-driver depends on volttron-drivers

path/volttron.drivers
    bacnet/
        __init__.py
        somefile.py
    modbus/
    blah/
bonicim commented 2 years ago

See examples at https://github.com/VOLTTRON/volttron-core/tree/main/volttron/services for guide on how to organize the PlatformDriverAgent and drivers as standalone repos.

bonicim commented 2 years ago

Below is a UML diagram of the current DriverFramework.

driver_framework_uml__current.txt DriverFramework_UML_current

Online PlantUML version

Also, below is a more high-level UML of the current DriverFramework:

image

PlantUML server link

schandrika commented 2 years ago

Since platform.driver is the only agent we will install with a agent vip identity and the rest of the driver specific packages are only libraries that don't get its only agent dir under $VOLTTRON_HOME, I propose the following steps to setup drivers

vctl install volttron-platform-driver --vip-identity=platform.driver --config platform_agent_config.json
vctl install bacnet_proxy_agent (pip install volttron-bacnet-driver)
pip install volttron-modbus-driver
vctl config store platform.driver registry.config /path/to/registry.config --csv
vctl config store platform.driver devices/campus1/building1/bacnet_device1 bacnet_device_config.json
vctl config store platform.driver registry.config /path/to/registry2.config --csv
vctl config store platform.driver devices/campus1/building1/modbus_device1 modbus_device_config.json

All code can be in the same repository - or some combination of drivers in one repo and all unsupported drivers in its own individual repository - as long as we push different wheels - one for base platform.driver (with all the base classes, interfaces etc), and one for each driver type

Possible option - vctl install <package_name/local whl/local dir> --vip-identity platform.driver --config platform_agent_config.json --dependency volttron-bacnetproxy, volttron-modbus-driver,

schandrika commented 2 years ago

For developer working on say, volttron-modbus-driver:

vctl install volttron-platform-driver --vip-identity=platform.driver --config platform_agent_config.json git clone https://github.com/volttron/volttron-modbus-driver make changes to code poetry install (this will generate a whl and install it in your current python environment) vctl config store platform.driver registry.config /path/to/registry2.config --csv vctl config store platform.driver devices/campus1/building1/modbus_device1 modbus_device_config.json vctl start platform.driver

bonicim commented 2 years ago

Based on yesterday's meeting with @schandrika and the team, below is a proposed diagram of breaking apart the Driver Framework into modular components:

image

PlantUML server link

image

PlantUML server link

shwethanidd commented 2 years ago

@bonicim I don't think 2030.5 will be part of driver framework. It's a separate agent.

bonicim commented 2 years ago

@bonicim I don't think 2030.5 will be part of driver framework. It's a separate agent.

Ah, ok. I'll pick a different driver to highlight the use of the "Revert" class.

craig8 commented 2 years ago

The packages should all be from volttron.drivers That will be the dynamic package that is loaded by the framework.

bonicim commented 2 years ago

Completed by #8