Skip to content

Commit

Permalink
Integrates service loader into modular framework. (#93)
Browse files Browse the repository at this point in the history
* Integrates service loader into modular framework.
Updated known identities for services to be volttron.platform.service_name
Added ServerConfig object.

* update identities.

* Fix client context so it will load main platform config properly.
  • Loading branch information
craig8 authored Nov 15, 2022
1 parent 4faf4f2 commit de918f6
Show file tree
Hide file tree
Showing 19 changed files with 226 additions and 374 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "volttron"
version = "0.5.1a0"
version = "0.6.1a0"
description = "VOLTTRON™ is an open source platform for distributed sensing and control. The platform provides services for collecting and storing data from buildings and devices and provides an environment for developing applications which interact with that data."
authors = ["volttron <[email protected]>"]
license = "Apache-2.0"
Expand Down
1 change: 1 addition & 0 deletions src/volttron/client/commands/connection.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ class ControlConnection(object):

def __init__(self, address, peer=CONTROL):
self.address = address
_log.debug(f"Address is: {address}")
self.peer = peer
message_bus = cc.get_messagebus()
self._server = BaseAgent(
Expand Down
14 changes: 8 additions & 6 deletions src/volttron/client/commands/control.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,11 @@
# under Contract DE-AC05-76RL01830
# }}}

from gevent import monkey
monkey.patch_all()
import gevent
import gevent.event

import argparse
import collections
import logging
Expand All @@ -51,8 +56,6 @@
from typing import List
from datetime import timedelta, datetime

import gevent
import gevent.event

# TODO Requests dependency
# import requests
Expand Down Expand Up @@ -80,6 +83,7 @@
# from volttron.utils.rmq_setup import check_rabbit_status
# from volttron.platform.agent.utils import is_secure_mode, wait_for_volttron_shutdown
from volttron.client.commands.install_agents import add_install_agent_parser
from volttron.client.commands.connection import ControlConnection

from volttron.utils import ClientContext as cc, get_address
from volttron.utils import jsonapi
Expand All @@ -101,8 +105,6 @@
from volttron.client.vip.agent.subsystems.query import Query
from volttron.client.vip.agent.errors import Unreachable, VIPError

from .connection import ControlConnection

_stdout = sys.stdout
_stderr = sys.stderr

Expand Down Expand Up @@ -2941,8 +2943,8 @@ def add_parser(*args, **kwargs) -> argparse.ArgumentParser:
# if is_volttron_running(volttron_home):
# opts.connection = ControlConnection(opts.vip_address)

with gevent.Timeout(opts.timeout):
return opts.func(opts)
# with gevent.Timeout(opts.timeout):
# return opts.func(opts)

try:
with gevent.Timeout(opts.timeout):
Expand Down
3 changes: 1 addition & 2 deletions src/volttron/client/vip/agent/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -630,8 +630,7 @@ def hello():
self.connection.send_vip_object(message)

def hello_response(sender, version="", router="", identity=""):
_log.info("Connected to platform: "
"router: {} version: {} identity: {}".format(router, version, identity))
_log.info(f"Connected to platform: identity: {identity} version: {version}")
_log.debug("Running onstart methods.")
hello_response_event.set()
self.onstart.sendby(self.link_receiver, self)
Expand Down
Loading

0 comments on commit de918f6

Please sign in to comment.