code: def run_benchmark(bm_config):
      files = os.listdir(bm_config["model_config_path"])
      files.sort()
      for model_json_config in files:
          if model_json_config.endswith(".json"):
              # call benchmark-ab.py
              shutil.rmtree(TS_LOGS_PATH, ignore_errors=True)
              shutil.rmtree(BENCHMARK_TMP_PATH, ignore_errors=True)
              cmd = (
                  "python ./benchmarks/benchmark-ab.py --tmp_dir /tmp --report_location /tmp --config_properties "
                  "./benchmarks/config.properties --config {}/{}".format(
                      bm_config["model_config_path"], model_json_config
                  )
              )
              execute(cmd, wait=True)
  
              # generate stats metrics from ab_report.csv
              bm_model = model_json_config[0 : -len(".json")]
  
              gen_metrics_json.gen_metric(
                  "{}/ab_report.csv".format(BENCHMARK_TMP_PATH),
                  "{}/logs/stats_metrics.json".format(
                      BENCHMARK_TMP_PATH
                  ),
              )
  
              # load stats metrics to remote metrics storage
              if "metrics_cmd" in bm_config:
                  execute(bm_config["metrics_cmd"], wait=True)
  
              # cp benchmark logs to local
              bm_model_log_path = "{}/{}".format(
                  BENCHMARK_REPORT_PATH, bm_model
              )
              os.makedirs(bm_model_log_path, exist_ok=True)
              csv_file = "{}/ab_report.csv".format(BENCHMARK_TMP_PATH)
              if os.path.exists(csv_file):
                  shutil.move(csv_file, bm_model_log_path)
              cmd = "tar -cvzf {}/benchmark.tar.gz {}".format(
                  bm_model_log_path, BENCHMARK_TMP_PATH
              )
              execute(cmd, wait=True)
  
              cmd = "tar -cvzf {}/logs.tar.gz {}".format(
                  bm_model_log_path, TS_LOGS_PATH
              )
              execute(cmd, wait=True)
              print("finish benchmark {}".format(bm_model))
  
      # generate final report
      gen_md_report.iterate_subdir(
          BENCHMARK_REPORT_PATH,
          "{}/report.md".format(BENCHMARK_REPORT_PATH),
          bm_config["hardware"],
          bm_config["version"],
      )
      print("report.md is generated")
  
      # load logs to remote storage
      if "report_cmd" in bm_config:
          execute(bm_config["report_cmd"], wait=True)
  
imports: import argparse
  import datetime
  import os
  import shutil
  from subprocess import Popen
  import ruamel.yaml
  from utils import gen_md_report, gen_metrics_json, gen_model_config_json
label_desc: Use image node_id 7 for calling a global function with example usage: run_benchmark(bm_config) without return types