-
Notifications
You must be signed in to change notification settings - Fork 1
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
refactor drastically edge_orchestrator using Pydantic #66
base: main
Are you sure you want to change the base?
Conversation
b8822aa
to
7bb81a8
Compare
edge_orchestrator/pyproject.toml
Outdated
[tool.black] | ||
line-length = 120 | ||
target-version = ["py38", "py39", "py310", "py311"] | ||
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"] |
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.
remove before py312 ?
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.
to be green -> https://devguide.python.org/versions/ ?
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.
Then remove 3.8
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.
Apply comments
edge_orchestrator/.python-version
Outdated
3.12 |
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.
voir la compatibilité sur raspberry
edge_orchestrator/Dockerfile
Outdated
|
||
COPY pyproject.toml ./pyproject.toml | ||
COPY edge_orchestrator ./edge_orchestrator | ||
FROM python:3.12-slim |
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.
Dockerfile pour raspberry
context: . | ||
dockerfile: Dockerfile | ||
volumes: | ||
- ./data:/edge_orchestrator/data |
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.
par défaut c'est data_storage
- ./data:/edge_orchestrator/data | |
- ./data_storage:/edge_orchestrator/data_storage |
ports: | ||
- 8000:8000 | ||
environment: | ||
EDGE_NAME: vio-edge-1 |
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.
n'existe plus mais on a station_name
dans la StationConfig
maintenant -> utile ?
|
||
def test_max_nb_objects_rule(self): | ||
# Given | ||
max_nb_objects_rule = MaxNbObjectsRule( |
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.
idem, valider la config : MaxNbObjectsRule
avec autre chose que ModelType.object_detection
on raise
|
||
class TestMinNbObjectsRule: | ||
|
||
def test_min_nb_objects_rule(self): |
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.
parametrize OK, KO, NO_DECISION
|
||
class TestUnexpectedLabelRule: | ||
|
||
def test_unexpected_label_rule(self): |
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.
idem parametrize
|
||
class TestMinThresholdRatioRule: | ||
|
||
def test_min_threshold_ratio_rule( |
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.
parametrize pour KO et NO_DECISION
|
||
class TestMinThresholdRule: | ||
|
||
def test_min_threshold_rule( |
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.
parametrize pour OK et NO_DECISION
e56139d
to
6ac1570
Compare
689f424
to
0db49de
Compare
384f27a
to
5ae2b10
Compare
jobs: | ||
lint_and_test_on_edge_model_serving: | ||
name: Run Python linter and tests (unit > integration > functional) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.8", "3.9" ] # TODO: add 3.10 and 3.11 | ||
python-version: [ "3.9", "3.10", "3.11" ] |
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.
3.12 ?
jobs: | ||
lint_and_test_on_edge_orchestrator: | ||
name: Run Python linter and tests (unit > integration > functional) | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.8", "3.9" ] # TODO: add 3.10 and 3.11 | ||
python-version: [ "3.9", "3.10", "3.11" ] |
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.
3.12 ?
- ./edge_orchestrator/emissions:/edge_orchestrator/emissions | ||
- ./data_storage:/edge_orchestrator/data_storage | ||
- /run/udev:/run/udev:ro | ||
devices: |
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.
why four devices ?
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.
Still thinking that we need to merge streamlit and vue asap
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.
why removing all of this readme ?
self._storage_config: StorageConfig = storage_config | ||
self._logger = logging.getLogger(__name__) | ||
|
||
def save_item_binaries(self, item: Item): |
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.
Oui, mais c'était pas existant avant ça ?
self._storage_config: StorageConfig = storage_config | ||
self._logger = logging.getLogger(__name__) | ||
|
||
def save_item_binaries(self, item: Item): |
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.
Du coup pas mergable en l'état ?
from edge_orchestrator.domain.ports.camera.i_camera_manager import ICameraManager | ||
|
||
|
||
class NoCameraAvailableError(Exception): |
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.
Is it useful is pass ?
def __init__(self, camera_config: CameraConfig): | ||
self._camera_config = camera_config | ||
self._logger = logging.getLogger(__name__) | ||
self._supported_image_extensions: List = ["*.jpg", "*.png"] |
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.
mettre un enum ?
self._camera_config = camera_config | ||
self._logger = logging.getLogger(__name__) | ||
|
||
# TODO: implement me |
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.
to remove ?
No description provided.