aws-solutions-library-samples / osml-model-runner

MIT No Attribution
7 stars 1 forks source link

refactor: break out RegionRequestHandler class from app.py #100

Closed drduhe closed 1 month ago

drduhe commented 1 month ago

Issue #, if available: n/a

Notes

This PR introduces refactoring of the RegionRequestHandler class to decouple region processing logic from ModelRunner. The RegionRequestHandler now makes it the region processing logic self-contained, modular, and easier to test. Additionally, changes to the ModelRunner class were made to initialize this handler with the appropriate dependencies.

Unit tests were also updated to split out region processing testing associated with the new class.

Key Changes:

  1. Decoupled RegionRequestHandler from ModelRunner:
    • RegionRequestHandler now takes in its own initialization parameters:
      • region_request_table, job_table, region_status_monitor, endpoint_statistics_table
      • tiling_strategy, region_request_queue, endpoint_utils, config
    • This similarly decouples it from ModelRunner, allowing for cleaner design and unit testing.

Checklist

Before you submit a pull request, please make sure you have the following:

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.