This guide provides technical details for contributors and maintainers of PANTHER. Learn about the codebase, design principles, and guidelines for extending the system.
PANTHER is built with modularity and extensibility in mind. Key directories:
core/
: Contains core logic for experiment execution and management.config/
: Handles experiment configurations and schema validation.plugins/
: Houses plugins for protocols, services, and environments.outputs/
: Stores logs and results.
-
Modularity:
- Each component has a specific responsibility, making the system easier to extend and maintain.
-
Dynamic Loading:
- Plugins and configurations are dynamically loaded to support extensibility.
-
Error Handling:
- Comprehensive logging and exception management ensure robustness.
- Orchestrates the execution of experiments.
- Responsible for initializing test cases, deploying services, and managing results.
- Represents individual tests within an experiment.
- Encapsulates service deployment, step execution, and assertion validation.
- Dynamically loads and validates plugins (e.g., protocols, environments).
- Handles Docker integration for plugins requiring containerized environments.
-
Define Requirements:
- Clearly define the feature's purpose and scope.
-
Modify Core Components (if necessary):
- Update
ExperimentManager
orTestCase
for new test types.
- Update
-
Develop Plugins:
- Create new plugins in
plugins/
if extending protocols or services.
- Create new plugins in
-
Update Configuration Schema:
- Modify
config_schema.py
to support new configuration options.
- Modify
-
Write Unit Tests:
- Add tests in
tests/
to ensure feature reliability.
- Add tests in
-
Follow DRY:
- Avoid duplicating code; extract common functionality into reusable functions.
-
Preserve Backward Compatibility:
- Ensure existing experiments and configurations remain functional.
-
Write Comprehensive Tests:
- Validate changes using unit and integration tests.
- All components use Python’s
logging
module for structured logging. - Logs are saved in
outputs/logs
for debugging.
- Raise meaningful exceptions with descriptive messages.
- Catch and log exceptions in critical areas (e.g.,
ExperimentManager
).
- Fork the repository and create a new branch for your feature or bug fix.
- Run the tests to ensure stability:
pytest tests/
- Submit a pull request with detailed explanations of your changes.
For additional guidance, consult the Main README or contact the development team.