Skip to content
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

Open
wants to merge 30 commits into
base: main
Choose a base branch
from

Conversation

bojeanson
Copy link
Collaborator

No description provided.

edge_orchestrator/pyproject.toml Show resolved Hide resolved
[tool.black]
line-length = 120
target-version = ["py38", "py39", "py310", "py311"]
target-version = ["py38", "py39", "py310", "py311", "py312", "py313"]
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove before py312 ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then remove 3.8

edge_orchestrator/Dockerfile Outdated Show resolved Hide resolved
edge_orchestrator/edge_orchestrator.yml Show resolved Hide resolved
Copy link
Collaborator Author

@bojeanson bojeanson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Apply comments

3.12
Copy link
Collaborator Author

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


COPY pyproject.toml ./pyproject.toml
COPY edge_orchestrator ./edge_orchestrator
FROM python:3.12-slim
Copy link
Collaborator Author

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
Copy link
Collaborator Author

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

Suggested change
- ./data:/edge_orchestrator/data
- ./data_storage:/edge_orchestrator/data_storage

ports:
- 8000:8000
environment:
EDGE_NAME: vio-edge-1
Copy link
Collaborator Author

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 ?

edge_orchestrator/pyproject.toml Show resolved Hide resolved

def test_max_nb_objects_rule(self):
# Given
max_nb_objects_rule = MaxNbObjectsRule(
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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):
Copy link
Collaborator Author

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(
Copy link
Collaborator Author

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(
Copy link
Collaborator Author

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

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" ]
Copy link
Collaborator

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" ]
Copy link
Collaborator

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:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why four devices ?

Copy link
Collaborator

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

Copy link
Collaborator

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):
Copy link
Collaborator

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):
Copy link
Collaborator

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):
Copy link
Collaborator

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"]
Copy link
Collaborator

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
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to remove ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants