Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add agent server management functions #239

Open
wants to merge 25 commits into
base: main
Choose a base branch
from

Conversation

pan-x-c
Copy link
Collaborator

@pan-x-c pan-x-c commented May 21, 2024

Description

In the old version, the rpc agent server only has a call_func method, and all agents' own methods and agent server management related methods need to be implemented through the call_func, making this method bloated.

This PR adds a series of agent server management functions (used to support agent server management modules), and extracts management related methods from the original call_func interface.

All agent server management functions are listed below:

  • is_alive: whether the server is alive
  • stop: stop the server
  • create_agent: create a new agent on the server
  • delete_agent: delete agents from the server
  • clone_agent: clone an agent with specific agent_id
  • get_agent_id_list: get agent_id of all agents on the server as a list
  • get_agent_info: get the agent information of the specific agent_id
  • get_server_info: get the resource utilization information of the server
  • set_model_configs: update the model configs of the server
  • get_agent_memory: get the memory of a specific agent on the server
  • download_file: download a file from the server

Each method above is implemented independently and doesn't use the original call_func method.

The original call_func is renamed to call_agent_func, and only handle method calls of the agent itself.
The placeholder update method is also extracted from the original call_func method as a separate update_placeholder method.

This PR makes the rpc messages used by each method more compact. Tests show that it can reduce the running time of large-scale simulation example by 5 - 10%.

Unittests and tutorials have been updated accordingly.

Checklist

Please check the following items before code is ready to be reviewed.

  • Code has passed all tests
  • Docstrings have been added/updated in Google Style
  • Documentation has been updated
  • Code is ready for review

@pan-x-c pan-x-c changed the title Add agent server management functions [WIP] Add agent server management functions May 21, 2024
@pan-x-c pan-x-c changed the title [WIP] Add agent server management functions Add agent server management functions May 21, 2024
@pan-x-c pan-x-c self-assigned this May 21, 2024
@pan-x-c pan-x-c added enhancement New feature or request ready for review labels May 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready for review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants