Refactor environment and configuration management

- Updated the project structure to store configuration files (.env, models.yaml, extensions.yaml) in the project root instead of the user's home directory.
- Enhanced the setup process to automatically copy example files to the project root on first run.
- Implemented a migration function to transfer legacy configuration files from the user's home directory to the new project structure.
- Revised documentation to reflect changes in file locations and setup instructions.
- Improved code readability and maintainability by refactoring path management functions.
This commit is contained in:
Leonid Pershin
2026-08-21 03:20:18 +03:00
parent c2ca39a4a7
commit 343f741baa
22 changed files with 202 additions and 90 deletions
+2 -2
View File
@@ -27,7 +27,7 @@ from gpu_rent.os_client import (
volume_quotas,
)
from gpu_rent.payload import folder_bytes as _folder_bytes, has_payload as _has_payload
from gpu_rent.paths import env_path, home_dir
from gpu_rent.paths import env_path, runtime_dir
from gpu_rent.ssh_keys import key_ready
from gpu_rent.state import load_state
@@ -42,7 +42,7 @@ class Check:
def run_doctor() -> list[Check]:
checks: list[Check] = []
home_dir().mkdir(parents=True, exist_ok=True)
runtime_dir().mkdir(parents=True, exist_ok=True)
env_file = env_path()
if env_file.is_file():