def run_containers(command, parser, cl_args, unknown_args):
cluster, role, env = cl_args['<STR_LIT>'], cl_args['<STR_LIT>'], cl_args['<STR_LIT>']<EOL>topology = cl_args['<STR_LIT>']<EOL>container_id = cl_args['<STR_LIT:id>']<EOL>try:<EOL><INDENT>result = tracker_access.get_topology_info(cluster, env, topology, role)<EOL><DEDENT>except:<EOL><INDENT>Log.error("<STR_LIT>", cl_args["<STR_LIT>"])<EOL>return False<EOL><DEDENT>containers = result['<STR_LIT>']['<STR_LIT>']<EOL>all_bolts, all_spouts = set(), set()<EOL>for _, bolts in result['<STR_LIT>']['<STR_LIT>'].items():<EOL><INDENT>all_bolts = all_bolts | set(bolts)<EOL><DEDENT>for _, spouts in result['<STR_LIT>']['<STR_LIT>'].items():<EOL><INDENT>all_spouts = all_spouts | set(spouts)<EOL><DEDENT>stmgrs = containers.keys()<EOL>stmgrs.sort()<EOL>if container_id is not None:<EOL><INDENT>try:<EOL><INDENT>normalized_cid = container_id - <NUM_LIT:1><EOL>if normalized_cid < <NUM_LIT:0>:<EOL><INDENT>raise<EOL><DEDENT>stmgrs = [stmgrs[normalized_cid]]<EOL><DEDENT>except:<EOL><INDENT>Log.error('<STR_LIT>' % container_id)<EOL>return False<EOL><DEDENT><DEDENT>table = []<EOL>for sid, name in enumerate(stmgrs):<EOL><INDENT>cid = sid + <NUM_LIT:1><EOL>host = containers[name]["<STR_LIT:host>"]<EOL>port = containers[name]["<STR_LIT:port>"]<EOL>pid = containers[name]["<STR_LIT>"]<EOL>instances = containers[name]["<STR_LIT>"]<EOL>bolt_nums = len([instance for instance in instances if instance in all_bolts])<EOL>spout_nums = len([instance for instance in instances if instance in all_spouts])<EOL>table.append([cid, host, port, pid, bolt_nums, spout_nums, len(instances)])<EOL><DEDENT>headers = ["<STR_LIT>", "<STR_LIT:host>", "<STR_LIT:port>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>", "<STR_LIT>"]<EOL>sys.stdout.flush()<EOL>print(tabulate(table, headers=headers))<EOL>return True<EOL>
run containers subcommand