Files
dj/integration-work/inspect_interface_workflows.py

18 lines
1.5 KiB
Python

import json,subprocess,urllib.request
for port in (8188,8189,8191):
with urllib.request.urlopen(f'http://192.168.110.111:{port}/object_info',timeout=30) as r:obj=json.load(r)
with urllib.request.urlopen(f'http://192.168.110.111:{port}/queue',timeout=10) as r:q=json.load(r)
wanted=['ApplyVDNH3','H3ModelLoader','H3VideoSampler','QwenImage','LTX','Wan','MiniMax','H3']
names=[k for k in obj if any(w.lower() in k.lower() for w in wanted)]
print(json.dumps({'port':port,'node_count':len(obj),'relevant_nodes':names,'queue':{k:[x[1] for x in q.get(k,[])] for k in ('queue_running','queue_pending')}}))
for name in ('comfyui-manju','h3-gpu3-panel-8191-8a5f'):
d=json.loads(subprocess.check_output(['docker','inspect',name],text=True))[0]
print(json.dumps({'name':name,'mounts':[{'source':m['Source'],'dest':m['Destination'],'rw':m['RW']} for m in d['Mounts']],
'command':d['Config']['Cmd'],'user':d['Config']['User'],'readonly':d['HostConfig']['ReadonlyRootfs']}))
if 'panel' in name:
# Only proxy directives, never auth/password header values.
raw=subprocess.run(['docker','exec',name,'nginx','-T'],capture_output=True,text=True)
print('\n'.join(l for l in raw.stdout.splitlines() if any(x in l for x in ('listen ','upstream ','server comfy','proxy_pass','location ','proxy_read_timeout'))))
code="import app,inspect;print(inspect.getsource(app.provider_headers));print(inspect.getsource(app.providers))"
print(subprocess.check_output(['docker','exec','huobao-vdn-normalizer','python','-c',code],text=True))