From 88ed0a20262b46dbaa4f5e2db2eb839e81b64ec5 Mon Sep 17 00:00:00 2001 From: "C. Allwardt" <3979063+craig8@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:05:00 -0700 Subject: [PATCH 1/6] Update client and server for testing and functionality. --- src/volttron/client/__init__.py | 4 +- src/volttron/client/commands/__init__.py | 6 -- src/volttron/client/commands/control.py | 16 ++--- src/volttron/client/decorators.py | 29 +++------ src/volttron/client/vip/agent/__init__.py | 78 ++--------------------- src/volttron/server/__main__.py | 2 +- src/volttron/server/run_server.py | 25 ++++++-- src/volttron/server/server_options.py | 2 +- src/volttron/types/__init__.py | 46 +++++++++++++ 9 files changed, 93 insertions(+), 115 deletions(-) diff --git a/src/volttron/client/__init__.py b/src/volttron/client/__init__.py index 2c74803b5..5519ef9a3 100644 --- a/src/volttron/client/__init__.py +++ b/src/volttron/client/__init__.py @@ -60,8 +60,8 @@ from volttron.client.logs import setup_logging __all__: List[str] = [ - "AbstractAgent", "Core", "RPC", "Hello", "PeerList", "Ping", "PubSub", "Heartbeat", "Health", "ConfigStore", "Auth", - "Query", "setup_logging" + "Agent", "AbstractAgent", "Core", "RPC", "Hello", "PeerList", "Ping", "PubSub", "Heartbeat", "Health", + "ConfigStore", "Auth", "Query", "setup_logging" ] _log = get_logger() diff --git a/src/volttron/client/commands/__init__.py b/src/volttron/client/commands/__init__.py index e1a1281a3..d702c2ee6 100644 --- a/src/volttron/client/commands/__init__.py +++ b/src/volttron/client/commands/__init__.py @@ -26,14 +26,8 @@ monkey.patch_all() -import logging - from volttron.utils import get_version -from volttron.client.logs import get_logger - -_log = get_logger() - __version__ = get_version() # def get_volttron_root(): diff --git a/src/volttron/client/commands/control.py b/src/volttron/client/commands/control.py index 433db9573..7e44c0e18 100644 --- a/src/volttron/client/commands/control.py +++ b/src/volttron/client/commands/control.py @@ -1447,7 +1447,7 @@ def _show_filtered_agents_status(opts, status_callback, health_callback, priorit agent.uuid[:n], agent.name, name_width, - agent.vip_identity, + agent.identity, identity_width, agent.tag or "", tag_width, @@ -1490,17 +1490,17 @@ def _show_filtered_agents_status(opts, status_callback, health_callback, priorit else: json_obj = {} for agent in agents: - json_obj[agent.vip_identity] = { + json_obj[agent.identity] = { "agent_uuid": agent.uuid, "name": agent.name, - "identity": agent.vip_identity, + "identity": agent.identity, "agent_tag": agent.tag or "", "status": status_callback(agent), "health": health_callback(agent), } if cc.is_secure_mode(): - json_obj[agent.vip_identity]["agent_user"] = ( - agent.agent_user if json_obj[agent.vip_identity]["status"].startswith("running") else "") + json_obj[agent.identity]["agent_user"] = ( + agent.agent_user if json_obj[agent.identity]["status"].startswith("running") else "") _stdout.write(f"{jsonapi.dumps(json_obj, indent=2)}\n") @@ -2417,9 +2417,9 @@ def add_parser(*args, **kwargs) -> argparse.ArgumentParser: # with gevent.Timeout(opts.timeout): # return opts.func(opts) - with gevent.Timeout(opts.timeout): - return opts.func(opts) - sys.exit(0) + # with gevent.Timeout(opts.timeout): + # return opts.func(opts) + # sys.exit(0) try: with gevent.Timeout(opts.timeout): return opts.func(opts) diff --git a/src/volttron/client/decorators.py b/src/volttron/client/decorators.py index 0dd6c6b65..ef4d81343 100644 --- a/src/volttron/client/decorators.py +++ b/src/volttron/client/decorators.py @@ -14,10 +14,7 @@ T = TypeVar('T') -def factory_registration(registy_name: str, - protocol: T = None, - singleton: bool = True, - allow_many: bool = False): +def factory_registration(registry_name: str, protocol: T = None, singleton: bool = True, allow_many: bool = False): """ Create a factory registration function. @@ -46,13 +43,11 @@ def register(cls, **kwargs): lookup_key = cls.__name__ if lookup_key is None: - raise ValueError( - f"{cls.__name__} does not have an internal Meta class with identity or name.") + raise ValueError(f"{cls.__name__} does not have an internal Meta class with identity or name.") # args = typing.get_args(protocol) # if - if protocol is not None and not protocol in cls.__bases__ and not isinstance( - cls, protocol): + if protocol is not None and not protocol in cls.__bases__ and not isinstance(cls, protocol): raise ValueError(f"{cls.__name__} doesn't implement {protocol}") # if singleton: @@ -67,19 +62,18 @@ def register(cls, **kwargs): _log.warning("Lookup key is none!") _log.debug(f"Registering {cls.__name__} as a {lookup_key}") if lookup_key in register.registry: - raise ValueError(f"{lookup_key} already in register for {register.name}.") + _log.warning(f"{lookup_key} already in register for {register.registry_name}.") + #raise ValueError(f"{lookup_key} already in register for {register.registry_name}.") register.registry[lookup_key] = cls return cls - register.registy_name = registy_name + register.registry_name = registry_name register.registry = {} return register core_builder = factory_registration("core_builder", protocol=CoreBuilder, singleton=True) -connection_builder = factory_registration("connection_bulider", - protocol=ConnectionBuilder, - singleton=True) +connection_builder = factory_registration("connection_bulider", protocol=ConnectionBuilder, singleton=True) vctl_subparser = factory_registration("vctl_subparser", protocol=ControlParser) @@ -118,8 +112,7 @@ def get_core_builder(name: Optional[str] = None, **kwargs) -> CoreBuilder: zmq_core_builder_class = "ZmqCoreBuilder" module = importlib.import_module(zmq_core_module) __core_builder__ = __get_class_from_factory__( - registration=core_builder, - name=name) # __core_builder__ = getattr(module, zmq_core_builder_class) + registration=core_builder, name=name) # __core_builder__ = getattr(module, zmq_core_builder_class) # __core_builder__ = importlib.import_module(new_package) @@ -143,8 +136,7 @@ def get_server_credentials(address: Optional[str] = None) -> Credentials: import os from pathlib import Path - from volttron.types.auth import (Credentials, PKICredentials, PublicCredentials, - VolttronCredentials) + from volttron.types.auth import (Credentials, PKICredentials, PublicCredentials, VolttronCredentials) from volttron.types.known_host import KnownHostProperties as known_host_properties from volttron.client.known_identities import PLATFORM from volttron.utils import jsonapi @@ -153,8 +145,7 @@ def get_server_credentials(address: Optional[str] = None) -> Credentials: if address is None or address.startswith('ipc'): address = "@" - cred_path = Path( - os.environ['VOLTTRON_HOME']).expanduser() / f"credentials_store/{PLATFORM}.json" + cred_path = Path(os.environ['VOLTTRON_HOME']).expanduser() / f"credentials_store/{PLATFORM}.json" return VolttronCredentials.load_from_file(cred_path) new_path = Path(os.environ['VOLTTRON_HOME']) / "known_hosts.json" diff --git a/src/volttron/client/vip/agent/__init__.py b/src/volttron/client/vip/agent/__init__.py index 65088e7d1..7274bbac7 100644 --- a/src/volttron/client/vip/agent/__init__.py +++ b/src/volttron/client/vip/agent/__init__.py @@ -29,12 +29,15 @@ from volttron.types.auth.auth_credentials import Credentials from volttron.types.agent_context import AgentContext, AgentOptions from volttron.types import AbstractAgent +from volttron.utils import get_logger from .core import * from .decorators import * from .errors import * from .subsystems import * +_log = get_logger() + class Agent(AbstractAgent): @@ -65,69 +68,12 @@ def __init__(self, *, owner: Agent, core: Core, options: AgentOptions): self.auth = Auth(owner, core, self.rpc) - def __init__(self, - *, - credentials: Credentials = None, - options: AgentOptions = None, - address: str = None, - **kwargs): - # TODO: Try to create them if possible - # if credentials is None: - # if 'vip_identity' in kwargs: - # pass - # elif "identity" in kwargs: - # pass - # else: - # raise ValueError("Credentials or identity must be passed to the agent.") - - # if options is None: - # options = AgentOptions() - # for fld in options.__dataclass_fields__: - # if fld in kwargs: - # setattr(options, fld, kwargs.pop(fld)) - - # raise ValueError("Either credentials or options must be provided.") - - # identity=None, - # address=None, - # context=None, - # publickey=None, - # secretkey=None, - # serverkey=None, - # # Since heartbeat is now 100% tied to status on the vctl change the defaults - # # to auto start the heartbeat. - # heartbeat_autostart=True, - # heartbeat_period=60, - # volttron_home=None, - # agent_uuid=None, - # enable_store=True, - # enable_web=False, - # enable_channel=False, - # reconnect_interval=None, - # version="0.1", - # _instance_name=None, - # message_bus=None, - # volttron_central_address=None, - # volttron_central_instance_name=None, - # tag_vip_id=None, - # tag_refresh_interval=-1 - # ): - - # if volttron_home is None: - # volttron_home = cc.get_volttron_home() + def __init__(self, *, credentials: Credentials = None, options: AgentOptions = None, address: str = None, **kwargs): + from volttron.client.decorators import (get_connection_builder, get_core_builder) factory = get_core_builder(**kwargs) - # if credentials.identity is None: - # raise ValueError("Agent identity is required.") - - # identity = credentials.identity - # if identity is not None and not is_valid_identity(identity): - # _log.warning("Deprecation warning") - # _log.warning( - # "All characters in {identity} are not in the valid set.".format(identity=identity)) - if options is None: options = AgentOptions() @@ -140,19 +86,9 @@ def __init__(self, # TODO: We need to be able to get the address from environment probably here. context = AgentContext(credentials=credentials, options=options, address=address) + # Build the core based upon what was loaded in the factory above. self.core = factory.build(owner=self, context=context) - # self.core = get_core_instance(credentials=credentials) - # self.core = core_cls(address=address, credentials=credentials, options=options) - - # if not tag_vip_id: - # # no value was sent, use what is configured in server config or default returned by cc - # tag_vip_id = cc.get_tag_vip_id() - # if tag_refresh_interval == -1: - # # no value was sent, use what is configured in server config or default returned by cc - # tag_refresh_interval = cc.get_tag_refresh_interval() - - # self.vip = Agent.Subsystems(self, self.core, heartbeat_autostart, heartbeat_period, enable_store, - # enable_web, enable_channel, message_bus, tag_vip_id, tag_refresh_interval) + self.vip = Agent.Subsystems(owner=self, core=self.core, options=options) self.core.setup() self.vip.rpc.export(self.core.version, "agent.version") diff --git a/src/volttron/server/__main__.py b/src/volttron/server/__main__.py index 436ec2dc8..7d25d3255 100644 --- a/src/volttron/server/__main__.py +++ b/src/volttron/server/__main__.py @@ -76,7 +76,7 @@ # Finally set the logging parameter to the absolute path sys.argv[index + 1] = logging_config.absolute().as_posix() - total_count += vcount + total_count += vcount logging.config.dictConfig(get_default_logging_config(level=total_count)) diff --git a/src/volttron/server/run_server.py b/src/volttron/server/run_server.py index 605e2fd6c..571eb379a 100644 --- a/src/volttron/server/run_server.py +++ b/src/volttron/server/run_server.py @@ -107,8 +107,12 @@ def run_server(): # create poetry project and poetry lock file in VOLTTRON_HOME if dev_mode: - if not os.path.isfile(server_options.poetry_project_path / "pyproject.toml"): - raise ValueError("VOLTTRON is run with --dev but unable to fund pyproject.toml is current directory - " + # Allow an environmental variable to be passed for the location of the POETRY PROJECT Path. + if 'POETRY_PROJECT_PATH' in os.environ: + server_options.poetry_project_path = Path(os.environ['POETRY_PROJECT_PATH']).expanduser() + + if not (server_options.poetry_project_path / "pyproject.toml").exists(): + raise ValueError("VOLTTRON is run with --dev but unable to find pyproject.toml is current directory - " f"{server_options.poetry_project_path}") else: setup_poetry_project(server_options.poetry_project_path) @@ -116,15 +120,22 @@ def run_server(): start_volttron_process(server_options) -def setup_poetry_project(volttron_home): +def setup_poetry_project(volttron_home: Path): toml = os.path.join(volttron_home, "pyproject.toml") + if os.path.isfile(toml): + return + if not os.path.isfile(toml): cmd = [ "poetry", "init", "--directory", volttron_home.as_posix(), "--name", "volttron", "--author", "volttron ", "--quiet" ] execute_command(cmd) - cmd = ["poetry", "--directory", volttron_home.as_posix(), "source", "add", "--priority=supplemental", "test-pypi", "https://test.pypi.org/simple/"] + cmd = [ + "poetry", "--directory", + volttron_home.as_posix(), "source", "add", "--priority=supplemental", "test-pypi", + "https://test.pypi.org/simple/" + ] execute_command(cmd) # now do multiple piped commands @@ -134,7 +145,7 @@ def setup_poetry_project(volttron_home): # Third command poetry_cmd = ["xargs", "poetry", "add", "--directory", volttron_home.as_posix()] - err_msg = "" + err_msg = "" # Execute the first command p1 = subprocess.Popen(pip_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE) p1_stdout, p1_stderr = p1.communicate() @@ -144,7 +155,7 @@ def setup_poetry_project(volttron_home): else: # Execute the second command, with stdin from the first command's stdout p2 = subprocess.Popen(grep_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - p2_stdout, p2_stderr = p2.communicate(input=p1_stdout) # Use p1's output directly + p2_stdout, p2_stderr = p2.communicate(input=p1_stdout) # Use p1's output directly # Check and print the output of the second command if p2.returncode != 0: err_msg = "Error from grep command:", p2_stderr.decode() @@ -155,7 +166,7 @@ def setup_poetry_project(volttron_home): else: # Execute the third command, with stdin from the second command's stdout p3 = subprocess.Popen(poetry_cmd, stdin=subprocess.PIPE, stdout=subprocess.PIPE, stderr=subprocess.PIPE) - p3_stdout, p3_stderr = p3.communicate(input=p2_stdout) # Use p2's output directly + p3_stdout, p3_stderr = p3.communicate(input=p2_stdout) # Use p2's output directly if p3.returncode != 0: err_msg = "Error from poetry command:", p3_stderr.decode() diff --git a/src/volttron/server/server_options.py b/src/volttron/server/server_options.py index 47a9994ce..2542ec42f 100644 --- a/src/volttron/server/server_options.py +++ b/src/volttron/server/server_options.py @@ -153,7 +153,7 @@ def store(self, file: Path = None): try: # Don't save volttron_home within the config file. if field.name not in ('volttron_home', 'services', 'config_file', 'initialized', 'service_address', - "poetry_project_path"): + "poetry_project_path", "local_address"): # More than one address can be present, so we must be careful # with it. if field.name == 'address': diff --git a/src/volttron/types/__init__.py b/src/volttron/types/__init__.py index aa1a2b851..97283ec89 100644 --- a/src/volttron/types/__init__.py +++ b/src/volttron/types/__init__.py @@ -44,6 +44,8 @@ Identity = str Tag = str +AgentUUID = str +PathStr = Path | str class AbstractAgent(ABC): @@ -82,10 +84,54 @@ def send_vip(self, message: Message): class CoreLoop(ABC): + @abstractmethod + def setup(self): + ... + + @property + @abstractmethod + def configuration(self): + ... + + @property + @abstractmethod + def onsetup(self): + ... + + @property + @abstractmethod + def onstart(self): + ... + + @property + @abstractmethod + def ondisconnected(self): + ... + + @property + @abstractmethod + def onconnected(self): + ... + + @property + @abstractmethod + def identity(self) -> str: + ... + + @property + @abstractmethod + def connection(self) -> Connection: + ... + @abstractmethod def loop(self, running_event): ... + @property + @abstractmethod + def register(self, subsystem: str, handle_subsystem: Callable, handle_error: Callable): + ... + class AgentBuilder(ABC): From f4e59ddfcb7d037d06899d0f79707791b408fb3b Mon Sep 17 00:00:00 2001 From: "C. Allwardt" <3979063+craig8@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:05:53 -0700 Subject: [PATCH 2/6] Cleanup and adding todos for code operations. --- src/volttron/client/commands/auth_parser.py | 58 +++------------------ 1 file changed, 7 insertions(+), 51 deletions(-) diff --git a/src/volttron/client/commands/auth_parser.py b/src/volttron/client/commands/auth_parser.py index c79e64ae6..f1ed71bfb 100644 --- a/src/volttron/client/commands/auth_parser.py +++ b/src/volttron/client/commands/auth_parser.py @@ -27,16 +27,10 @@ import sys import collections -#from volttron.platform import get_home, jsonapi from volttron.utils import jsonapi from volttron.client.known_identities import AUTH from volttron.types.auth import AuthException -# from volttron.platform.agent.known_identities import AUTH -# from volttron.platform.auth import AuthEntry, AuthException -#from volttron.platform.control.control_utils import _ask_yes_no, _print_two_columns, _show_filtered_agents -#from volttron.platform.keystore import KeyStore, KnownHostsStore - # TODO Look and see what query subsystem is going to work #from volttron.platform.vip.agent.subsystems.query import Query @@ -45,52 +39,8 @@ _stdout = sys.stdout _stderr = sys.stderr -# def gen_keypair(opts): -# keypair = KeyStore.generate_keypair_dict() -# _stdout.write("{}\n".format(jsonapi.dumps(keypair, indent=2))) -# -# -# def add_server_key(opts): -# store = KnownHostsStore() -# store.add(opts.host, opts.serverkey) -# _stdout.write("server key written to {}\n".format(store.filename)) -# -# -# def list_known_hosts(opts): -# store = KnownHostsStore() -# entries = store.load() -# if entries: -# _print_two_columns(entries, "HOST", "CURVE KEY") -# else: -# _stdout.write("No entries in {}\n".format(store.filename)) -# -# -# def remove_known_host(opts): -# store = KnownHostsStore() -# store.remove(opts.host) -# _stdout.write('host "{}" removed from {}\n'.format(opts.host, store.filename)) - -# def show_serverkey(opts): -# """ -# write serverkey to standard out. -# -# return 0 if success, 1 if false -# """ -# conn = opts.connection -# if not conn: -# _stderr.write("VOLTTRON is not running. This command " -# "requires VOLTTRON platform to be running\n") -# return 1 -# q = Query(conn.server.core) -# pk = q.query("serverkey").get(timeout=2) -# del q -# if pk is not None: -# _stdout.write("%s\n" % pk) -# return 0 -# -# return 1 - +# TODO: Re-evaluate for usage def list_remotes(opts): """Lists remote certs and credentials. Can be filters using the '--status' option, specifying @@ -101,6 +51,7 @@ def list_remotes(opts): status of the credential or cert (either APPROVED, DENIED, or PENDING) """ + conn = opts.connection if not conn: _stderr.write("VOLTTRON is not running. This command " @@ -189,6 +140,7 @@ def list_remotes(opts): )) +# TODO: Re-evaluate for usage def approve_remote(opts): """Approves either a pending CSR or ZMQ credential. The platform must be running for this command to succeed. @@ -203,6 +155,7 @@ def approve_remote(opts): conn.server.vip.rpc.call(AUTH, "approve_authorization", opts.user_id).get(timeout=4) +# TODO: Re-evaluate for usage def deny_remote(opts): """Denies either a pending CSR or ZMQ credential. The platform must be running for this command to succeed. @@ -217,6 +170,7 @@ def deny_remote(opts): conn.server.vip.rpc.call(AUTH, "deny_authorization", opts.user_id).get(timeout=4) +# TODO: Re-evaluate for usage def delete_remote(opts): """Deletes either a pending CSR or ZMQ credential. The platform must be running for this command to succeed. @@ -239,6 +193,7 @@ def delete_remote(opts): # _show_filtered_agents(opts, "PUBLICKEY", get_key) +# TODO: Re-evaluate for usage def list_auth(opts, indices=None): _stdout.write("This method is under development\n") return @@ -260,6 +215,7 @@ def list_auth(opts, indices=None): # _stdout.write("No entries in {}\n".format(os.path.join(get_home(), "auth.json"))) +# TODO: Re-evaluate for usage def _ask_for_auth_fields( domain=None, address=None, From 9a0b769947f3ca407886c1fae4e91bb58d4e0f68 Mon Sep 17 00:00:00 2001 From: "C. Allwardt" <3979063+craig8@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:06:43 -0700 Subject: [PATCH 3/6] Update log handler to be more consistent based upon default levels. --- src/volttron/client/logs.py | 7 ++++-- src/volttron/server/logs.py | 46 ++++++++++++++++++------------------- 2 files changed, 28 insertions(+), 25 deletions(-) diff --git a/src/volttron/client/logs.py b/src/volttron/client/logs.py index d58ed9cd8..3ef0cb9c9 100644 --- a/src/volttron/client/logs.py +++ b/src/volttron/client/logs.py @@ -1,14 +1,17 @@ +import inspect import logging import warnings from logging import Logger import sys import os + import volttron.utils.jsonapi as jsonapi -import volttron.utils as utils def get_logger() -> Logger: - return utils.get_logger() + frame = inspect.stack()[1] + module = inspect.getmodule(frame[0]) + return logging.getLogger(module.__name__) def get_default_client_log_config(level=logging.DEBUG) -> dict: diff --git a/src/volttron/server/logs.py b/src/volttron/server/logs.py index 4126337aa..9e8f32d24 100644 --- a/src/volttron/server/logs.py +++ b/src/volttron/server/logs.py @@ -86,37 +86,38 @@ def format(self, record): return "<{}>".format(level) + super(SyslogFormatter, self).format(record) -def get_default_loggers_config() -> dict: +def get_default_loggers_config(level: int) -> dict: + level_server = logging.ERROR + level_client = logging.WARNING + match level: + case 1: + level_server = logging.WARNING + level_client = logging.INFO + case 2: + level_server = logging.INFO + level_client = logging.DEBUG + case 3: + level_client = logging.DEBUG + level_server = logging.DEBUG + return { + "volttron.messagebus": { + "level": logging.getLevelName(level_server) + }, "volttron.server": { - "level": "WARNING" + "level": logging.getLevelName(level_server) }, "volttron.services": { - "level": "INFO" + "level": logging.getLevelName(level_server) }, "volttron.client": { - "level": "INFO" + "level": logging.getLevelName(level_client) } - # "volttron.server.decorators": { - # "level": "WARNING" - # }, - - # "volttron.server.containers": { - # "level": "WARNING" - # }, - # "volttron.loader": { - # "level": "WARNING" - # }, - # "volttron.server.run_server": { - # "level": "WARNING" - # }, - # "volttron.client.decorators": { - # "level": "WARNING" - # } } def get_default_logging_config(level: int = logging.WARNING) -> dict: + print(f"Getting default_logging_config level: {level}") return { "version": 1, "disable_existing_loggers": False, @@ -141,7 +142,7 @@ def get_default_logging_config(level: int = logging.WARNING) -> dict: "mode": "a" } }, - "loggers": get_default_loggers_config(), + "loggers": get_default_loggers_config(level), "root": { "level": level, "handlers": ["console"] @@ -231,8 +232,7 @@ def log_to_file(file, level=logging.WARNING, handler_class=logging.StreamHandler """Direct log output to a file (or something like one).""" handler = handler_class(file) handler.setLevel(level) - handler.setFormatter( - AgentFormatter("%(asctime)s %(composite_name)s %(levelname)s: %(message)s")) + handler.setFormatter(AgentFormatter("%(asctime)s %(composite_name)s %(levelname)s: %(message)s")) root = logging.getLogger() root.setLevel(level) root.addHandler(handler) From 5fc97ea1acb84eacafdde2ac707ec9284a12c3e5 Mon Sep 17 00:00:00 2001 From: "C. Allwardt" <3979063+craig8@users.noreply.github.com> Date: Wed, 23 Oct 2024 13:16:06 -0700 Subject: [PATCH 4/6] Bump Version Number --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 843317f2d..95a370a4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "volttron-core" -version = "2.0.0rc1" +version = "2.0.0rc2" 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 "] license = "Apache-2.0" From 5568221fffef59dfed098a761cc61090ec5a79ca Mon Sep 17 00:00:00 2001 From: Chandrika Date: Wed, 23 Oct 2024 13:47:24 -0700 Subject: [PATCH 5/6] removed print stmt --- src/volttron/server/logs.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/volttron/server/logs.py b/src/volttron/server/logs.py index 9e8f32d24..7952b2930 100644 --- a/src/volttron/server/logs.py +++ b/src/volttron/server/logs.py @@ -117,7 +117,6 @@ def get_default_loggers_config(level: int) -> dict: def get_default_logging_config(level: int = logging.WARNING) -> dict: - print(f"Getting default_logging_config level: {level}") return { "version": 1, "disable_existing_loggers": False, From 1f417e76ad726a72980a07df5083ec02d5ed7ba5 Mon Sep 17 00:00:00 2001 From: Chandrika Date: Wed, 23 Oct 2024 13:52:14 -0700 Subject: [PATCH 6/6] removed POETRY_PROJECT_PATH env var --- src/volttron/server/run_server.py | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/volttron/server/run_server.py b/src/volttron/server/run_server.py index 571eb379a..4ef5d92c7 100644 --- a/src/volttron/server/run_server.py +++ b/src/volttron/server/run_server.py @@ -107,10 +107,6 @@ def run_server(): # create poetry project and poetry lock file in VOLTTRON_HOME if dev_mode: - # Allow an environmental variable to be passed for the location of the POETRY PROJECT Path. - if 'POETRY_PROJECT_PATH' in os.environ: - server_options.poetry_project_path = Path(os.environ['POETRY_PROJECT_PATH']).expanduser() - if not (server_options.poetry_project_path / "pyproject.toml").exists(): raise ValueError("VOLTTRON is run with --dev but unable to find pyproject.toml is current directory - " f"{server_options.poetry_project_path}")