energytrackr.config packageΒΆ
SubmodulesΒΆ
energytrackr.config.config_model moduleΒΆ
This module defines the configuration model for the pipeline.
- class energytrackr.config.config_model.ExecutionPlanDefinition(*, mode: ~energytrackr.config.config_model.ModeEnum = ModeEnum.TESTS, compile_commands: list[str] | None = None, granularity: ~energytrackr.config.config_model.GranularityEnum = GranularityEnum.COMMITS, pre_command: str | None = None, pre_command_condition_files: set[str] = <factory>, test_command: str, test_command_path: str = '', ignore_failures: bool = True, post_command: str | None = None, num_commits: int | None = None, num_runs: int = 1, num_repeats: int = 1, batch_size: int = 100, randomize_tasks: bool = False, oldest_commit: str | None = None, newest_commit: str | None = None, execute_common_tests: bool = False)[source]ΒΆ
Bases:
BaseModelExecution plan for the pipeline.
- batch_size: intΒΆ
- check_compile_commands_for_benchmarks() Self[source]ΒΆ
Ensure that compile_commands is provided when benchmarks mode is selected.
- Returns:
The instance of the class.
- Return type:
Self
- Raises:
ValueError β If compile_commands is not provided in benchmarks mode.
- execute_common_tests: boolΒΆ
- granularity: GranularityEnumΒΆ
- ignore_failures: boolΒΆ
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- num_repeats: intΒΆ
- num_runs: intΒΆ
- pre_command_condition_files: set[str]ΒΆ
- randomize_tasks: boolΒΆ
- test_command: strΒΆ
- test_command_path: strΒΆ
- class energytrackr.config.config_model.GranularityEnum(*values)[source]ΒΆ
Bases:
StrEnumGranularity of execution for the pipeline.
βcommitsβ: Run tests for each commit.
βbranchesβ: Run tests for each branch.
βtagsβ: Run tests for each tag.
- BRANCHES = 'branches'ΒΆ
- COMMITS = 'commits'ΒΆ
- TAGS = 'tags'ΒΆ
- class energytrackr.config.config_model.LimitsDefinition(*, temperature_safe_limit: int)[source]ΒΆ
Bases:
BaseModelLimits for the pipeline execution.
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- temperature_safe_limit: intΒΆ
- class energytrackr.config.config_model.ModeEnum(*values)[source]ΒΆ
Bases:
StrEnumMode of execution for the pipeline.
βtestsβ: Run tests only.
βbenchmarksβ: Run benchmarks only.
- BENCHMARKS = 'benchmarks'ΒΆ
- TESTS = 'tests'ΒΆ
- class energytrackr.config.config_model.PipelineConfig(*, config_version: str = '1.0.0', repo: ~energytrackr.config.config_model.RepositoryDefinition, execution_plan: ~energytrackr.config.config_model.ExecutionPlanDefinition, limits: ~energytrackr.config.config_model.LimitsDefinition, tracked_file_extensions: set[str], ignored_directories: set[str] = <factory>, cpu_thermal_file: str, setup_commands: list[str] | None = None, regression_detection: ~energytrackr.config.config_model.RegressionDetectionDefinition = <factory>, timeout: int = 120)[source]ΒΆ
Bases:
BaseModelConfiguration model for the entire pipeline.
- config_version: strΒΆ
- cpu_thermal_file: strΒΆ
- execution_plan: ExecutionPlanDefinitionΒΆ
- ignored_directories: set[str]ΒΆ
- limits: LimitsDefinitionΒΆ
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- regression_detection: RegressionDetectionDefinitionΒΆ
- repo: RepositoryDefinitionΒΆ
- timeout: intΒΆ
- tracked_file_extensions: set[str]ΒΆ
- class energytrackr.config.config_model.RegressionDetectionDefinition(*, min_commits_before: int = 1, min_commits_after: int = 0)[source]ΒΆ
Bases:
BaseModelConfiguration for regression detection context in the pipeline.
This model specifies the minimum number of commits to include before and/or after a candidate commit.
- min_commits_after: intΒΆ
- min_commits_before: intΒΆ
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- class energytrackr.config.config_model.RepositoryDefinition(*, url: str, branch: str | None = None, clone_options: list[str] | None = None)[source]ΒΆ
Bases:
BaseModelDefinition of the repository to be tested.
- model_config: ClassVar[ConfigDict] = {}ΒΆ
Configuration for the model, should be a dictionary conforming to [ConfigDict][pydantic.config.ConfigDict].
- url: strΒΆ
energytrackr.config.config_store moduleΒΆ
Module to store the pipeline configuration.
- class energytrackr.config.config_store.Config[source]ΒΆ
Bases:
objectClass to retrieve the unique configuration of the pipeline.
- classmethod get_config() PipelineConfig[source]ΒΆ
Gets the pipeline configuration.
- Returns:
The pipeline configuration.
- Return type:
- Raises:
ConfigurationSingletonNotSetError β If the configuration has not been set.
- classmethod set_config(new_config: PipelineConfig) None[source]ΒΆ
Sets the pipeline configuration.
- Parameters:
new_config (PipelineConfig) β The new pipeline configuration to set.
- Raises:
ConfigurationSingletonAlreadySetError β If the configuration has already been set.
energytrackr.config.loader moduleΒΆ
This module provides a function to load the pipeline configuration from a YAML file.
Module contentsΒΆ
Configuration module for the project.