19 lines
1.2 KiB
Python
19 lines
1.2 KiB
Python
"""Disposable model/artifact exercise, NOT a live Gate1 approval or service completion."""
|
|
import datetime, json, pathlib, subprocess, time, uuid
|
|
from executor import execute, IMAGE, pinned_inference
|
|
|
|
def main():
|
|
image=subprocess.check_output(['docker','inspect','--format','{{.Image}}','canina-hermes'],text=True).strip()
|
|
if image!=IMAGE: raise RuntimeError('Pinned installed image mismatch')
|
|
infer=pinned_inference(IMAGE)
|
|
deadline=time.monotonic()+90
|
|
lease={k:str(uuid.uuid4()) for k in ('taskId','runId','leaseToken')}
|
|
lease.update(leaseUntil=(datetime.datetime.now(datetime.timezone.utc)+datetime.timedelta(seconds=30)).isoformat(),commitSha=subprocess.check_output(['git','rev-parse','HEAD'],text=True).strip(),environment='staging',maxCostCents=20,attempt=1)
|
|
def fixture_heartbeat(binding):
|
|
if time.monotonic()>deadline: raise TimeoutError('Fixture hard deadline')
|
|
root,report=execute(lease,'/opt/services/canina/validation/v4-real-pilot',infer,fixture_heartbeat)
|
|
report['executionContext']='DISPOSABLE_FIXTURE_NOT_LIVE_PREPARE_LEASE'
|
|
(root/'evidence.json').write_text(json.dumps(report,indent=2)+'\n')
|
|
print(json.dumps({'artifactDirectory':str(root),'report':report}))
|
|
if __name__=='__main__': main()
|