17 lines
2.2 KiB
Python
17 lines
2.2 KiB
Python
"""Athena host read-only final verification; no secrets in result."""
|
|
import importlib.util,json,subprocess,hashlib
|
|
from pathlib import Path
|
|
P=Path('/opt/athena-deck-dev/cache-activation-tools-17e7017/activate_host.py');spec=importlib.util.spec_from_file_location('activation',P);m=importlib.util.module_from_spec(spec);spec.loader.exec_module(m)
|
|
a=m.load();d=m.info();assert d['Image']==a['image_after'] and d['State']['Health']['Status']=='healthy' and d['State']['OOMKilled'] is False
|
|
assert m.sandbox(d)==a['sandbox'];assert all(m.sha(m.S/n)==a['settings'][n] for n in m.SETTINGS)
|
|
assert all(m.sha(m.C/n)==a['source_after'][n] for n in m.FILES)
|
|
for n in m.FILES:assert hashlib.sha256(subprocess.check_output(['docker','exec','athena-deck-dev','cat','/app/'+n])).hexdigest()==a['source_after'][n]
|
|
p=m.RT/'source/serve/config.py';assert p.read_bytes()==(m.RT/'source/serve/config.py.bak-20261122-claude').read_bytes()
|
|
assert p.read_bytes()==subprocess.check_output(['git','-c','safe.directory='+str(m.RT/'source'),'-C',str(m.RT/'source'),'show','HEAD:serve/config.py'])
|
|
assert all(not (m.RT/n).exists() for n in ('engine-overrides.json','engine-overrides.README.txt'))
|
|
w=json.loads((m.S/'basalt-worker/worker.json').read_text());assert w['engine']['conversation-cache-mib']==0 and w['engine']['conversation-cache-disk-mib']==16384
|
|
lines=[x for x in (m.S/'basalt-worker/server.log').read_text().splitlines() if 'ram-cache=' in x];line=lines[-1];assert all(x in line for x in ('ctx=262144','kv=int8','ram-cache=0MiB','disk-cache=16384MiB','batch=2'))
|
|
old=json.loads(subprocess.check_output(['docker','inspect',m.OLD]))[0];assert old['Image']==a['image_before'] and old['State']['Status']=='exited'
|
|
r=dict(image=d['Image'],tag=d['Config']['Image'],base_image=a['image_before'],commit='17e7017e83c24e33b2fa45d2300788c1a718b6ba',basalt_pin=a['pin'],startup=line,health=d['State']['Health']['Status'],oom=False,restart_count=d['RestartCount'],memory=d['HostConfig']['Memory'],sandbox_unchanged=True,settings_unchanged=True,source_image_match=True,unhooked=True,backup_matches_pin=True,rollback_image_retained=True,worker_engine=w['engine'],parallel=w['models'][0]['parallel'])
|
|
(m.R/'final-verification.json').write_text(json.dumps(r,indent=2));print(json.dumps(r))
|