aboutsummaryrefslogtreecommitdiff
path: root/src/mlia/backend/application.py
diff options
context:
space:
mode:
authorBenjamin Klimczak <benjamin.klimczak@arm.com>2022-07-11 12:33:42 +0100
committerBenjamin Klimczak <benjamin.klimczak@arm.com>2022-07-26 14:08:21 +0100
commit5d81f37de09efe10f90512e50252be9c36925fcf (patch)
treeb4d7cdfd051da0a6e882bdfcf280fd7ca7b39e57 /src/mlia/backend/application.py
parent7899b908c1fe6d86b92a80f3827ddd0ac05b674b (diff)
downloadmlia-5d81f37de09efe10f90512e50252be9c36925fcf.tar.gz
MLIA-551 Rework remains of AIET architecture
Re-factoring the code base to further merge the old AIET code into MLIA. - Remove last traces of the backend type 'tool' - Controlled systems removed, including SSH protocol, controller, RunningCommand, locks etc. - Build command / build dir and deploy functionality removed from Applications and Systems - Moving working_dir() - Replace module 'output_parser' with new module 'output_consumer' and merge Base64 parsing into it - Change the output consumption to optionally remove (i.e. actually consume) lines - Use Base64 parsing in GenericInferenceOutputParser, replacing the regex-based parsing and remove the now unused regex parsing - Remove AIET reporting - Pre-install applications by moving them to src/mlia/resources/backends - Rename aiet-config.json to backend-config.json - Move tests from tests/mlia/ to tests/ - Adapt unit tests to code changes - Dependencies removed: paramiko, filelock, psutil - Fix bug in corstone.py: The wrong resource directory was used which broke the functionality to download backends. - Use f-string formatting. - Use logging instead of print. Change-Id: I768bc3bb6b2eda57d219ad01be4a8e0a74167d76
Diffstat (limited to 'src/mlia/backend/application.py')
-rw-r--r--src/mlia/backend/application.py23
1 files changed, 3 insertions, 20 deletions
diff --git a/src/mlia/backend/application.py b/src/mlia/backend/application.py
index eb85212..4b04324 100644
--- a/src/mlia/backend/application.py
+++ b/src/mlia/backend/application.py
@@ -11,10 +11,9 @@ from typing import Optional
from mlia.backend.common import Backend
from mlia.backend.common import ConfigurationException
-from mlia.backend.common import DataPaths
from mlia.backend.common import get_backend_configs
from mlia.backend.common import get_backend_directories
-from mlia.backend.common import load_application_or_tool_configs
+from mlia.backend.common import load_application_configs
from mlia.backend.common import load_config
from mlia.backend.common import remove_backend
from mlia.backend.config import ApplicationConfig
@@ -75,7 +74,7 @@ def install_application(source_path: Path) -> None:
if already_installed:
names = {application.name for application in already_installed}
raise ConfigurationException(
- "Applications [{}] are already installed".format(",".join(names))
+ f"Applications [{','.join(names)}] are already installed."
)
create_destination_and_install(source, get_backends_path("applications"))
@@ -105,7 +104,6 @@ class Application(Backend):
super().__init__(config)
self.supported_systems = config.get("supported_systems", [])
- self.deploy_data = config.get("deploy_data", [])
def __eq__(self, other: object) -> bool:
"""Overload operator ==."""
@@ -122,21 +120,6 @@ class Application(Backend):
"""Check if the application can run on the system passed as argument."""
return system_name in self.supported_systems
- def get_deploy_data(self) -> List[DataPaths]:
- """Validate and return data specified in the config file."""
- if self.config_location is None:
- raise ConfigurationException(
- "Unable to get application {} config location".format(self.name)
- )
-
- deploy_data = []
- for item in self.deploy_data:
- src, dst = item
- src_full_path = self.config_location / src
- assert src_full_path.exists(), "{} does not exists".format(src_full_path)
- deploy_data.append(DataPaths(src_full_path, dst))
- return deploy_data
-
def get_details(self) -> Dict[str, Any]:
"""Return dictionary with information about the Application instance."""
output = {
@@ -180,7 +163,7 @@ def load_applications(config: ExtendedApplicationConfig) -> List[Application]:
supported systems. For each supported system this function will return separate
Application instance with appropriate configuration.
"""
- configs = load_application_or_tool_configs(config, ApplicationConfig)
+ configs = load_application_configs(config, ApplicationConfig)
applications = [Application(cfg) for cfg in configs]
for application in applications:
application.remove_unused_params()