Files
dj/integration-work/connect_vdn_networks.py

14 lines
769 B
Python

import json,subprocess
def run(*a):return subprocess.check_output(a,text=True)
old=json.loads(run('docker','inspect','canvas-h3-prompt-normalizer-healthy-20261026'))[0]
new=json.loads(run('docker','inspect','huobao-vdn-normalizer'))[0]
network='zq-platform-network'
assert network in old['NetworkSettings']['Networks']
for worker in ('comfyui','h3-caption-gpu3-canary-8a5f'):
info=json.loads(run('docker','inspect',worker))[0]
assert network in info['NetworkSettings']['Networks']
if network not in new['NetworkSettings']['Networks']:
# Execute only after the user's pending, specific network approval arrives.
run('docker','network','connect',network,'huobao-vdn-normalizer')
print('VDN adapter connected only to the approved worker network:',network)