15 lines
793 B
Python
15 lines
793 B
Python
import subprocess,json
|
|
code='''import asyncio,httpx,json,app
|
|
from dataclasses import replace
|
|
async def main():
|
|
async with httpx.AsyncClient(timeout=15) as client:
|
|
for key,port in [('default',8188),('gpu1_8189',8189),('gpu3',8191)]:
|
|
p=replace(app.providers()[key],base_url=f'http://192.168.110.111:{port}')
|
|
r=await client.post(p.base_url+'/prompt',json={'prompt':{}},headers=app.provider_headers(p))
|
|
d=r.json()
|
|
assert r.status_code==400 and not d.get('prompt_id'),(port,r.status_code)
|
|
print(json.dumps({'worker':key,'port':port,'post_reaches_comfyui':True,'empty_workflow_rejected_without_gpu_job':True,'error_type':d.get('error',{}).get('type')}))
|
|
asyncio.run(main())
|
|
'''
|
|
print(subprocess.check_output(['docker','exec','huobao-vdn-normalizer','python','-c',code],text=True))
|