2024-08-28 10:39:16 +02:00
|
|
|
import logging
|
|
|
|
import sys
|
|
|
|
|
2024-08-28 22:20:36 +02:00
|
|
|
from core import config
|
|
|
|
from core.utils import check_for_build_essentials, load_service_from_string
|
|
|
|
from core.vars import logger, services, loaded_services
|
|
|
|
from ui.choices import update_choices
|
|
|
|
from ui.interface import run_interactive_cmd_ui
|
2024-08-28 20:05:46 +02:00
|
|
|
|
|
|
|
|
|
|
|
def setup_logger(level: logger.level = logging.INFO):
|
|
|
|
if not logger.hasHandlers():
|
|
|
|
logger.setLevel(level)
|
|
|
|
handler = logging.StreamHandler(sys.stdout)
|
|
|
|
handler.setFormatter(logging.Formatter('[%(levelname)s] : %(message)s'))
|
|
|
|
logger.addHandler(handler)
|
|
|
|
|
|
|
|
|
|
|
|
def setup_config():
|
2024-08-28 22:20:36 +02:00
|
|
|
config.create()
|
|
|
|
config.read()
|
2024-08-28 20:05:46 +02:00
|
|
|
|
|
|
|
|
2024-08-28 22:20:36 +02:00
|
|
|
def load_services():
|
|
|
|
for service in services:
|
|
|
|
loaded_services[service] = load_service_from_string(service)
|
2024-08-28 20:05:46 +02:00
|
|
|
|
|
|
|
|
2024-08-28 10:39:16 +02:00
|
|
|
if __name__ == '__main__':
|
2024-08-28 20:05:46 +02:00
|
|
|
setup_logger(logging.DEBUG)
|
2024-08-28 22:20:36 +02:00
|
|
|
logger.info("Starting AI Suite for ROCM")
|
|
|
|
|
2024-08-28 20:05:46 +02:00
|
|
|
setup_config()
|
2024-08-28 10:39:16 +02:00
|
|
|
|
2024-08-28 20:05:46 +02:00
|
|
|
check_for_build_essentials()
|
2024-08-28 10:39:16 +02:00
|
|
|
|
2024-08-28 22:20:36 +02:00
|
|
|
load_services()
|
|
|
|
|
|
|
|
update_choices()
|
2024-08-28 20:05:46 +02:00
|
|
|
run_interactive_cmd_ui()
|