Files
nest/uvm/app.py
T
kstyagi 4a46685a4c feat: implement resource resizing for VMs with storage management
- Added KnownHostsManager to handle cleanup of SSH known_hosts entries upon VM deletion.
- Introduced disk_size_bytes method in ImageStore to read logical disk capacity.
- Enhanced LifecycleService to manage VM resource resizing, including CPU, RAM, and storage.
- Updated application configuration to support known_hosts_files for SSH management.
- Modified dashboard to include resource resizing options in the UI.
- Improved error handling and validation for resource inputs in the dashboard.
- Removed obsolete .pyc files from the repository.
2026-09-21 20:37:52 +05:30

45 lines
1.4 KiB
Python

"""Application composition root for the uvm command-line executable."""
from __future__ import annotations
from collections.abc import Callable
from dataclasses import dataclass
from .config import Settings
from .firecracker.process import FirecrackerProcessManager
from .images import ImageStore
from .install import Installer
from .known_hosts import KnownHostsManager
from .lifecycle import LifecycleService
from .network import NetworkManager
from .state import StateStore
from .system import CommandRunner
@dataclass(slots=True)
class Application:
"""Concrete host services used by the CLI; this is not a public SDK."""
settings: Settings
state_store: StateStore
installer: Installer
lifecycle: LifecycleService
def build_application(emit: Callable[[str], None] | None = print) -> Application:
settings = Settings.from_environment()
runner = CommandRunner(emit=emit)
state_store = StateStore(settings)
images = ImageStore(settings, runner)
network = NetworkManager(settings, runner)
process = FirecrackerProcessManager(settings)
known_hosts = KnownHostsManager(settings)
lifecycle = LifecycleService(settings, state_store, images, network, process, known_hosts=known_hosts)
installer = Installer(settings, runner, state_store, emit=emit)
return Application(
settings=settings,
state_store=state_store,
installer=installer,
lifecycle=lifecycle,
)