Conversation
…loat in press_by_percentage method Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
… and session handling
…reation and initialization methods Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
…lements method Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
…cess command Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
There was a problem hiding this comment.
Pull Request Overview
This PR adds a supervisor tool that provides vertical scaling for the Optics Framework API by spawning multiple worker processes and routing requests based on session affinity. The supervisor manages workers, distributes sessions across them, and handles worker failures while maintaining session consistency.
- Implements a supervisor API that manages multiple worker processes running the Optics API
- Routes requests based on session IDs to ensure session affinity (same session always goes to same worker)
- Adds comprehensive test coverage including unit tests and integration tests
Reviewed Changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 7 comments.
Show a summary per file
| File | Description |
|---|---|
| tools/supervisor_app/supervisor_tool.py | Main supervisor implementation with worker management, session routing, and health monitoring |
| tools/supervisor_app/test_supervisor_tool.py | Unit tests for supervisor components including config, worker management, and API endpoints |
| tools/supervisor_app/test_supervisor_integration.py | Integration tests for end-to-end supervisor functionality with real worker processes |
| tools/supervisor_app/Dockerfile | Docker configuration for containerized supervisor deployment |
| tools/mock_site/index.html | API URL corrections for session endpoints consistency |
| pyproject.toml | Version bump to 1.6.1 |
| optics_framework/optics.py | Added session_id parameter to setup() method for session reuse |
| optics_framework/helper/version.py | Version update to 1.6.1 |
| optics_framework/engines/drivers/appium_UI_helper.py | Enabled non-text interactive elements in UI parsing |
| optics_framework/common/session_manager.py | Enhanced session creation to support reusing existing sessions |
| optics_framework/api/action_keyword.py | Fixed percentage coordinate handling to use float instead of int |
| Docker/prod/Dockerfile | Added service account JSON file for Google Vision integration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| import pytest | ||
|
|
||
| # Add the tools directory to path | ||
| sys.path.insert(0, '/Users/dhruvmenon/Documents/optics-framework-1/tools') |
There was a problem hiding this comment.
This hardcoded absolute path will break the tests on other systems. Use relative paths or environment variables to make the tests portable across different development environments.
| # Start supervisor | ||
| supervisor_cmd = [ | ||
| sys.executable, | ||
| "/Users/dhruvmenon/Documents/optics-framework-1/tools/supervisor_tool.py", |
There was a problem hiding this comment.
This hardcoded absolute path will break the tests on other systems. Use relative paths or environment variables to make the tests portable across different development environments.
|
|
||
| def setup_method(self): | ||
| """Reset global state before each test.""" | ||
| global workers, session_map, worker_index |
There was a problem hiding this comment.
The variable worker_index is referenced but not imported from the module. This will cause a NameError when the test runs.
| global workers, session_map, worker_index | ||
| workers.clear() | ||
| session_map.clear() | ||
| worker_index = 0 |
There was a problem hiding this comment.
The variable worker_index is referenced but not imported from the module. This will cause a NameError when the test runs.
Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
… format Signed-off-by: Dhruv Menon <dhruvmenon1104@gmail.com>
|




No description provided.