-
Notifications
You must be signed in to change notification settings - Fork 290
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
Conversation
There was a problem hiding this 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(): |
There was a problem hiding this comment.
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.
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 & |
There was a problem hiding this comment.
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.
This makes it easier for users to spin up a metadata service after installing Mooncake, which should help with debugging.