10000 feat(py): integrate python http metadata server by xiaguan · Pull Request #367 · kvcache-ai/Mooncake · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

feat(py): integrate python http metadata server #367

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

Merged
merged 2 commits into from
May 19, 2025

Conversation

xiaguan
Copy link
Collaborator
@xiaguan xiaguan commented May 15, 2025

This makes it easier for users to spin up a metadata service after installing Mooncake, which should help with debugging.

@xiaguan xiaguan requested a review from Copilot May 15, 2025 11:28
Copy link
Contributor
@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR integrates a new HTTP metadata server for Mooncake to simplify metadata management and debugging.

  • Adds required dependencies and a new script entry for the metadata server in pyproject.toml.
  • Introduces a new Python module for the HTTP metadata server.
  • Updates the CI workflow to start the server using its command-line interface.

Reviewed Changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
mooncake-wheel/pyproject.toml Adds dependencies and new CLI mapping for the metadata server.
mooncake-wheel/mooncake/http_metadata_server.py Implements the new HTTP metadata server using aiohttp.
.github/workflows/ci.yml Updates the CI command to launch the metadata server.
Comments suppressed due to low confidence (1)

mooncake-wheel/mooncake/http_metadata_server.py:72

  • Consider returning a JSON-formatted error message (e.g., using json.dumps) to align with the 'application/json' content type for 405 responses.
return web.Response(text='Method not allowed', status=405, content_type='application/json')


def close(self):
"""Shutdown the server."""
if self._loop is not None and self._loop.is_running():
Copy link
Preview
Copilot AI May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Consider cancelling all pending tasks and cleaning up resources before closing the event loop for a smoother shutdown process.

Suggested change
if self._loop is not None and self._loop.is_running():
if self._loop is not None and self._loop.is_running():
# Cancel all pending tasks
pending = asyncio.all_tasks(self._loop)
for task in pending:
task.cancel()
self._loop.run_until_complete(asyncio.gather(*pending, return_exceptions=True))
# Cleanup resources
if self._runner is not None:
self._loop.run_until_complete(self._runner.cleanup())
# Stop the loop

Copilot uses AI. Check for mistakes.

pip install aiohttp
python ./bootstrap_server.py &
source test_env/bin/activate
mooncake_http_metadata_server --port 8080 &
Copy link
Preview
Copilot AI May 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nitpick] Add a comment explaining that this command starts the metadata server in the background to improve clarity during CI runs.

Copilot uses AI. Check for mistakes.

@stmatengss stmatengss merged commit e59bf6c into kvcache-ai:main May 19, 2025
26 checks passed
maobaolong pushed a commit to maobaolong/Mooncake that referenced this pull request May 26, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0