idol-commons / backend /runtime_setup.py
fffiloni's picture
Deploy tested IDOL Commons private development build
26fa2b2 verified
Raw History Blame Contribute Delete
757 Bytes
"""Operator build bootstrap, never called with user-provided commands or URLs."""
import os,subprocess
from .settings import ROOT
def ensure_renderer():
if not (ROOT/'frontend/dist/render.html').is_file():raise RuntimeError('Build the frontend before enabling IDOL.')
if not (ROOT/'frontend/node_modules/playwright/package.json').is_file():
subprocess.run(['npm','ci','--ignore-scripts','--prefix',str(ROOT/'frontend')],check=True,timeout=180)
browser=os.getenv('CHROMIUM_EXECUTABLE','')
if not browser or not os.path.isfile(browser):raise RuntimeError('Configure an installed Chromium before enabling IDOL.')
if not os.path.isdir('/proc'):raise RuntimeError('The preview runtime must support process-group memory accounting.')