-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into pdr_telemetry
- Loading branch information
Showing
78 changed files
with
6,857 additions
and
147 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
name: Ufm log analyzer CI Workflow | ||
|
||
on: | ||
push: | ||
paths: | ||
- 'plugins/ufm_log_analyzer_plugin/**' | ||
jobs: | ||
pylint: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@main | ||
|
||
- name: Set up Python | ||
uses: actions/setup-python@main | ||
with: | ||
python-version: 3.9 # Specify the Python version you want to use | ||
|
||
- name: Install dependencies | ||
run: | | ||
pip install -r plugins/ufm_log_analyzer_plugin/src/loganalyze/requirements.txt | ||
pip install pylint | ||
- name: Run PyLint | ||
run: pylint --rcfile=plugins/ufm_log_analyzer_plugin/src/loganalyze/.pylintrc plugins/ufm_log_analyzer_plugin/src/loganalyze |
Empty file modified
0
plugins/pdr_deterministic_plugin/.pytest/run_pdr_standalone_pytest.sh
100644 → 100755
Empty file.
Empty file modified
0
plugins/pdr_deterministic_plugin/.pytest/terminate_pdr_standalone_pytest.sh
100644 → 100755
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,7 @@ | ||
flask<=3.0.3 | ||
numpy<=1.26.4 | ||
pandas<=2.2.2 | ||
pytest<=8.2.0 | ||
requests<=2.31.0 | ||
twisted<=22.1.0 | ||
flask_restful<=0.3.10 | ||
tzlocal<=4.2 | ||
jsonschema<=4.5.1 | ||
aiohttp<=3.9.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
81 changes: 81 additions & 0 deletions
81
plugins/pdr_deterministic_plugin/ufm_sim_web_service/api/base_aiohttp_api.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
# | ||
# Copyright © 2013-2024 NVIDIA CORPORATION & AFFILIATES. ALL RIGHTS RESERVED. | ||
# | ||
# This software product is a proprietary product of Nvidia Corporation and its affiliates | ||
# (the "Company") and all right, title, and interest in and to the software | ||
# product, including all associated intellectual property rights, are and | ||
# shall remain exclusively with the Company. | ||
# | ||
# This software product is governed by the End User License Agreement | ||
# provided with the software product. | ||
# | ||
|
||
import asyncio | ||
from aiohttp import web | ||
|
||
class BaseAiohttpAPI: | ||
""" | ||
Base class for API implemented with aiohttp | ||
""" | ||
def __init__(self): | ||
""" | ||
Initialize a new instance of the BaseAiohttpAPI class. | ||
""" | ||
self.app = web.Application() | ||
|
||
@property | ||
def application(self): | ||
""" | ||
Read-only property for the application instance. | ||
""" | ||
return self.app | ||
|
||
def add_route(self, method, path, handler): | ||
""" | ||
Add route to API. | ||
""" | ||
self.app.router.add_route(method, path, handler) | ||
|
||
def web_response(self, text, status): | ||
""" | ||
Create response object. | ||
""" | ||
return web.json_response(text=text, status=status) | ||
|
||
|
||
class BaseAiohttpServer: | ||
""" | ||
Base class for HTTP server implemented with aiohttp | ||
""" | ||
def __init__(self, logger): | ||
""" | ||
Initialize a new instance of the BaseAiohttpAPI class. | ||
""" | ||
self.logger = logger | ||
|
||
def run(self, app, host, port): | ||
""" | ||
Run the server on the specified host and port. | ||
""" | ||
loop = asyncio.get_event_loop() | ||
loop.run_until_complete(self._run_server(app, host, port)) | ||
|
||
async def _run_server(self, app, host, port): | ||
""" | ||
Asynchronously run the server and handle shutdown. | ||
""" | ||
# Run server | ||
runner = web.AppRunner(app) | ||
await runner.setup() | ||
site = web.TCPSite(runner, host, port) | ||
await site.start() | ||
self.logger.info(f"Server started at {host}:{port}") | ||
|
||
# Wait for shutdown signal | ||
shutdown_event = asyncio.Event() | ||
try: | ||
await shutdown_event.wait() | ||
except KeyboardInterrupt: | ||
self.logger.info(f"Shutting down server {host}:{port}...") | ||
finally: | ||
await runner.cleanup() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.