Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 6 additions & 30 deletions das-cli/src/commands/context_broker/context_broker_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,18 +94,6 @@ class ContextBrokerStart(Command):
name = "start"

params = [
CommandOption(
["--peer-hostname"],
help="The address of the node to connect to.",
prompt="Enter peer hostname (e.g., 192.168.1.100)",
type=str,
),
CommandOption(
["--peer-port"],
help="The port of the node to connect to.",
prompt="Enter peer port (e.g., 40002)",
type=int,
),
CommandOption(
["--port-range"],
help="The lower and upper bounds of the port range to be used by the command proxy.",
Expand Down Expand Up @@ -133,14 +121,14 @@ def __init__(
def _get_container(self):
return self._context_broker_bus_node_manager.get_container()

def _context_broker(self, port_range: str, **kwargs) -> None:
def _context_broker(self, port_range: str) -> None:
self.stdout("Starting Context Broker service...")

container = self._get_container()
context_broker_port = container.port

try:
self._context_broker_bus_node_manager.start_container(port_range, **kwargs)
self._context_broker_bus_node_manager.start_container(port_range)

success_message = f"Context Broker started on port {context_broker_port}"
self.stdout(
Expand Down Expand Up @@ -193,27 +181,15 @@ def _context_broker(self, port_range: str, **kwargs) -> None:
"Run 'query-agent start' to start the Query Agent.",
verbose=False,
)
def run(self, port_range: str, **kwargs) -> None:
def run(self, port_range: str) -> None:
self._settings.validate_configuration_file()
self._context_broker(port_range, **kwargs)
self._context_broker(port_range)


class ContextBrokerRestart(Command):
name = "restart"

params = [
CommandOption(
["--peer-hostname"],
help="The address of the peer to connect to.",
prompt="Enter peer hostname (e.g., 192.168.1.100)",
type=str,
),
CommandOption(
["--peer-port"],
help="The port of the peer to connect to.",
prompt="Enter peer port (e.g., 40002)",
type=int,
),
CommandOption(
["--port-range"],
help="The lower and upper bounds of the port range to be used by the command proxy.",
Expand All @@ -236,9 +212,9 @@ def __init__(
self._context_broker_start = context_broker_start
self._context_broker_stop = context_broker_stop

def run(self, port_range: str, **kwargs) -> None:
def run(self, port_range: str) -> None:
self._context_broker_stop.run()
self._context_broker_start.run(port_range, **kwargs)
self._context_broker_start.run(port_range)


class ContextBrokerCli(CommandGroup):
Expand Down
32 changes: 10 additions & 22 deletions das-cli/src/commands/context_broker/context_broker_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,17 +27,18 @@

SYNOPSIS

das-cli context-broker start [--port-range <start:end>] [--peer-hostname <hostname>] [--peer-port <port>]
das-cli context-broker start [--port-range <start:end>]

DESCRIPTION

Initializes and runs the Context Broker service.
Connects to the query engine using agents.query.endpoint from the config file.

EXAMPLES

To start the Context Broker service:

$ das-cli context-broker start --port-range 46000:46999 --peer-hostname localhost --peer-port 42000
$ das-cli context-broker start --port-range 46000:46999
"""

SHORT_HELP_START = "Start the Context Broker service."
Expand All @@ -49,20 +50,17 @@

SYNOPSIS

das-cli context-broker restart [--peer-hostname <hostname>] [--peer-port <port>] [--port-range <start:end>]
das-cli context-broker restart [--port-range <start:end>]

DESCRIPTION

Stops and then starts the Context Broker service.

This command ensures a instance of the Context Broker is running.

EXAMPLES

To restart the Context Broker service:

$ das-cli context-broker restart --port-range 46000:46999 --peer-hostname localhost --peer-port 42000

$ das-cli context-broker restart --port-range 46000:46999
"""

SHORT_HELP_RESTART = "Restart the Context Broker service."
Expand All @@ -80,35 +78,25 @@

Provides commands to control the Context Broker service.

Use this command group to start, stop, or restart the service.

COMMANDS

start

Start the Context Broker service.

stop

Stop the Context Broker service.

restart

Restart the Context Broker service.
start Start the Context Broker service.
stop Stop the Context Broker service.
restart Restart the Context Broker service.

EXAMPLES

Start the Context Broker service:

$ das-cli context-broker start --port-range 46000:46999 --peer-hostname localhost --peer-port 42000
$ das-cli context-broker start --port-range 46000:46999

Stop the Context Broker service:

$ das-cli context-broker stop

Restart the Context Broker service:

$ das-cli context-broker restart --port-range 46000:46999 --peer-hostname localhost --peer-port 42000
$ das-cli context-broker restart --port-range 46000:46999
"""

SHORT_HELP_CONTEXT_BROKER = "Manage the Context Broker service."
36 changes: 6 additions & 30 deletions das-cli/src/commands/evolution_agent/evolution_agent_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,18 +96,6 @@ class EvolutionAgentStart(Command):
name = "start"

params = [
CommandOption(
["--peer-hostname"],
help="The address of the node to connect to.",
prompt="Enter peer hostname (e.g., 192.168.1.100)",
type=str,
),
CommandOption(
["--peer-port"],
help="The port of the node to connect to.",
prompt="Enter peer port (e.g., 40002)",
type=int,
),
CommandOption(
["--port-range"],
help="The lower and upper bounds of the port range to be used by the node.",
Expand Down Expand Up @@ -135,14 +123,14 @@ def __init__(
def _get_container(self):
return self._evolution_agent_bus_node_manager.get_container()

def _evolution_agent(self, port_range: str, **kwargs) -> None:
def _evolution_agent(self, port_range: str) -> None:
self.stdout("Starting Evolution Agent service...")

container = self._get_container()
port = container.port

try:
self._evolution_agent_bus_node_manager.start_container(port_range, **kwargs)
self._evolution_agent_bus_node_manager.start_container(port_range)

success_message = f"Evolution Agent started on port {port}"

Expand Down Expand Up @@ -191,28 +179,16 @@ def _evolution_agent(self, port_range: str, **kwargs) -> None:
"Run 'query-agent start' to start the Query Agent.",
verbose=False,
)
def run(self, port_range: str, **kwargs):
def run(self, port_range: str):
self._settings.validate_configuration_file()

self._evolution_agent(port_range, **kwargs)
self._evolution_agent(port_range)


class EvolutionAgentRestart(Command):
name = "restart"

params = [
CommandOption(
["--peer-hostname"],
help="The address of the peer to connect to.",
prompt="Enter peer hostname (e.g., 192.168.1.100)",
type=str,
),
CommandOption(
["--peer-port"],
help="The port of the peer to connect to.",
prompt="Enter peer port (e.g., 40002)",
type=int,
),
CommandOption(
["--port-range"],
help="The lower and upper bounds of the port range to be used by the command proxy.",
Expand All @@ -235,9 +211,9 @@ def __init__(
self._evolution_agent_start = evolution_agent_start
self._evolution_agent_stop = evolution_agent_stop

def run(self, port_range: str, **kwargs):
def run(self, port_range: str):
self._evolution_agent_stop.run()
self._evolution_agent_start.run(port_range, **kwargs)
self._evolution_agent_start.run(port_range)


class EvolutionAgentCli(CommandGroup):
Expand Down
42 changes: 15 additions & 27 deletions das-cli/src/commands/evolution_agent/evolution_agent_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@

DESCRIPTION

Stops the currently running Evolution Agent container. This halts the processing of messages
and deactivates the agent until it is explicitly started again.

If the service is already stopped, a warning message is displayed.
Stops the currently running Evolution Agent container.

EXAMPLES

Expand All @@ -30,20 +27,18 @@

SYNOPSIS

das-cli evolution-agent start [--port-range <start:end>] [--peer-hostname <hostname>] [--peer-port <port>]
das-cli evolution-agent start [--port-range <start:end>]

DESCRIPTION

Starts the Evolution Agent service in a Docker container. If the service is already running,
a warning will be shown.

The agent begins listening on the configured port and processes messages accordingly.
Starts the Evolution Agent service in a Docker container.
Connects to the query engine using agents.query.endpoint from the config file.

EXAMPLES

Start the Evolution Agent service:

$ das-cli evolution-agent start --port-range 45000:45999 --peer-hostname localhost --peer-port 40002
$ das-cli evolution-agent start --port-range 45000:45999
"""

SHORT_HELP_START = "Start the Evolution Agent service."
Expand All @@ -55,20 +50,17 @@

SYNOPSIS

das-cli evolution-agent restart [--peer-hostname <hostname>] [--peer-port <port>] [--port-range <start:end>]
das-cli evolution-agent restart [--port-range <start:end>]

DESCRIPTION

This command combines a stop and a start operation to ensure that the
Evolution Agent is restarted cleanly.

Useful for refreshing configurations or recovering from faults.
Stops and then starts the Evolution Agent service.

EXAMPLES

Restart the Evolution Agent service:

$ das-cli evolution-agent restart --port-range 45000:45999 --peer-hostname localhost --peer-port 40002
$ das-cli evolution-agent restart --port-range 45000:45999
"""

SHORT_HELP_RESTART = "Restart the Evolution Agent service."
Expand All @@ -84,31 +76,27 @@

DESCRIPTION

This command group allows you to manage the lifecycle of the Evolution Agent service,
which is responsible for tracks atom importance values in different contexts and updates those values based on user queries using context-specific Hebbian networks.
Manage the lifecycle of the Evolution Agent service.

COMMANDS
start
Start the Evolution Agent service and begin message processing.

stop
Stop the currently running Evolution Agent container.

restart
Restart the Evolution Agent container (stop followed by start).
start Start the Evolution Agent service.
stop Stop the Evolution Agent service.
restart Restart the Evolution Agent service.

EXAMPLES

Start the agent:

$ das-cli evolution-agent start [--port-range <start:end>] [--peer-hostname <hostname>] [--peer-port <port>]
$ das-cli evolution-agent start --port-range 45000:45999

Stop the agent:

$ das-cli evolution-agent stop

Restart the agent:

$ das-cli evolution-agent restart [--port-range <start:end>] [--peer-hostname <hostname>] [--peer-port <port>]
$ das-cli evolution-agent restart --port-range 45000:45999
"""

SHORT_HELP_EVOLUTION_AGENT = "Control the lifecycle of the Evolution Agent service."
Loading
Loading