Files
Athena-Deck/deploy/articulino/bootstrap.py
T

14 lines
707 B
Python

"""Install the same CPU recipe in native Debian or the existing Deck runtime."""
import argparse,json,sys,time
from pathlib import Path
sys.path.insert(0,str(Path(__file__).resolve().parents[2]))
from articulino_runtime import ArticulinoRuntime
if __name__=='__main__':
p=argparse.ArgumentParser();p.add_argument('--state',required=True,type=Path);a=p.parse_args()
runtime=ArticulinoRuntime(a.state/'articulino-runtime')
if runtime.status()['installed']:print(json.dumps(dict(installed=True,model_id=runtime.ensure_library())))
else:
runtime.start()
while runtime.worker.is_alive():runtime.worker.join(1)
status=runtime.status();print(json.dumps(status));sys.exit(0 if status['installed'] else 1)