code: def update_values(
      file_path,
      deploy_mode,
      hostname,
      server_tag,
      milvus_config,
      server_config=None,
  ):
      # bak values.yaml
      file_name = os.path.basename(file_path)
      bak_file_name = file_name + ".bak"
      file_parent_path = os.path.dirname(file_path)
      bak_file_path = file_parent_path + "/" + bak_file_name
      if os.path.exists(bak_file_path):
          os.system("cp %s %s" % (bak_file_path, file_path))
      else:
          os.system("cp %s %s" % (file_path, bak_file_path))
      with open(file_path) as f:
          values_dict = full_load(f)
          f.close()
      cluster = False
      if deploy_mode == "cluster":
          cluster = True
  
      # TODO: disable change config
      # cluster = False
      # if "cluster" in milvus_config and milvus_config["cluster"]:
      #     cluster = True
      # for k, v in milvus_config.items():
      #     if k.find("primary_path") != -1:
      #         suffix_path = milvus_config["suffix_path"] if "suffix_path" in milvus_config else None
      #         path_value = v
      #         if suffix_path:
      #             path_value = v + "_" + str(int(time.time()))
      #         values_dict["primaryPath"] = path_value
      #         values_dict['wal']['path'] = path_value + "/wal"
      #         values_dict['logs']['path'] = path_value + "/logs"
      #     # elif k.find("use_blas_threshold") != -1:
      #     #     values_dict['useBLASThreshold'] = int(v)
      #     elif k.find("gpu_search_threshold") != -1:
      #         values_dict['gpu']['gpuSearchThreshold'] = int(v)
      #         if cluster:
      #             values_dict['readonly']['gpu']['gpuSearchThreshold'] = int(v)
      #     elif k.find("cpu_cache_capacity") != -1:
      #         values_dict['cache']['cacheSize'] = v
      #         if cluster:
      #             values_dict['readonly']['cache']['cacheSize'] = v
      #     # elif k.find("cache_insert_data") != -1:
      #     #     values_dict['cache']['cacheInsertData'] = v
      #     elif k.find("insert_buffer_size") != -1:
      #         values_dict['cache']['insertBufferSize'] = v
      #         if cluster:
      #             values_dict['readonly']['cache']['insertBufferSize'] = v
      #     elif k.find("gpu_resource_config.enable") != -1:
      #         values_dict['gpu']['enabled'] = v
      #         if cluster:
      #             values_dict['readonly']['gpu']['enabled'] = v
      #     elif k.find("gpu_resource_config.cache_capacity") != -1:
      #         values_dict['gpu']['cacheSize'] = v
      #         if cluster:
      #             values_dict['readonly']['gpu']['cacheSize'] = v
      #     elif k.find("build_index_resources") != -1:
      #         values_dict['gpu']['buildIndexDevices'] = v
      #         if cluster:
      #             values_dict['readonly']['gpu']['buildIndexDevices'] = v
      #     elif k.find("search_resources") != -1:
      #         values_dict['gpu']['searchDevices'] = v
      #         if cluster:
      #             values_dict['readonly']['gpu']['searchDevices'] = v
      #     # wal
      #     elif k.find("auto_flush_interval") != -1:
      #         values_dict['storage']['autoFlushInterval'] = v
      #         if cluster:
      #             values_dict['readonly']['storage']['autoFlushInterval'] = v
      #     elif k.find("wal_enable") != -1:
      #         values_dict['wal']['enabled'] = v
  
      # # if values_dict['nodeSelector']:
      # #     logger.warning("nodeSelector has been set: %s" % str(values_dict['engine']['nodeSelector']))
      # #     return
      # values_dict["wal"]["recoveryErrorIgnore"] = True
      # # enable monitor
      # values_dict["metrics"]["enabled"] = True
      # values_dict["metrics"]["address"] = "192.168.1.237"
      # values_dict["metrics"]["port"] = 9091
      # # only test avx2
      # values_dict["extraConfiguration"].update({"engine": {"simd_type": "avx2"}})
      # # stat_optimizer_enable
      # values_dict["extraConfiguration"]["engine"].update({"stat_optimizer_enable": False})
  
      # # enable read-write mode
      # if cluster:
      #     values_dict["cluster"]["enabled"] = True
      #     # update readonly log path
      #     values_dict["readonly"]['logs']['path'] = values_dict['logs']['path'] + "/readonly"
      #     if "readonly" in milvus_config:
      #         if "replicas" in milvus_config["readonly"]:
      #             values_dict["readonly"]["replicas"] = milvus_config["readonly"]["replicas"]
  
      # # update values.yaml with the given host
      node_config = None
      perf_tolerations = [
          {
              "key": "worker",
              "operator": "Equal",
              "value": "performance",
              "effect": "NoSchedule",
          }
      ]
      if hostname:
          node_config = {"kubernetes.io/hostname": hostname}
      elif server_tag:
          # server tag
          node_config = {"instance-type": server_tag}
      cpus = server_config["cpus"]
      logger.debug(hostname)
      if cluster is False:
          if node_config:
              values_dict["standalone"]["nodeSelector"] = node_config
              values_dict["minio"]["nodeSelector"] = node_config
              values_dict["etcd"]["nodeSelector"] = node_config
              # TODO: disable
              # set limit/request cpus in resources
              values_dict["standalone"]["resources"] = {
                  "limits": {
                      # "cpu": str(int(cpus)) + ".0"
                      "cpu": str(int(cpus))
                      + ".0"
                  },
                  "requests": {
                      "cpu": str(int(cpus) // 2 + 1)
                      + ".0"
                      # "cpu": "4.0"
                  },
              }
              logger.debug("Add tolerations into standalone server")
              values_dict["standalone"][
                  "tolerations"
              ] = perf_tolerations
              values_dict["minio"]["tolerations"] = perf_tolerations
              values_dict["etcd"]["tolerations"] = perf_tolerations
      else:
          # values_dict['pulsar']["broker"]["configData"].update({"maxMessageSize": "52428800", "PULSAR_MEM": BOOKKEEPER_PULSAR_MEM})
          # values_dict['pulsar']["bookkeeper"]["configData"].update({"nettyMaxFrameSizeBytes": "52428800", "PULSAR_MEM": BROKER_PULSAR_MEM})
          values_dict["proxynode"]["nodeSelector"] = node_config
          values_dict["querynode"]["nodeSelector"] = node_config
          values_dict["indexnode"]["nodeSelector"] = node_config
          values_dict["datanode"]["nodeSelector"] = node_config
          values_dict["minio"]["nodeSelector"] = node_config
  
          # values_dict['pulsar']["enabled"] = True
          # values_dict['pulsar']['autoRecovery']['nodeSelector'] = node_config
          # values_dict['pulsar']['proxy']['nodeSelector'] = node_config
          # values_dict['pulsar']['broker']['nodeSelector'] = node_config
          # values_dict['pulsar']['bookkeeper']['nodeSelector'] = node_config
          # values_dict['pulsar']['zookeeper']['nodeSelector'] = node_config
          values_dict["pulsarStandalone"]["nodeSelector"] = node_config
          if hostname:
              logger.debug("Add tolerations into cluster server")
              values_dict["proxynode"]["tolerations"] = perf_tolerations
              values_dict["querynode"]["tolerations"] = perf_tolerations
              values_dict["indexnode"]["tolerations"] = perf_tolerations
              values_dict["datanode"]["tolerations"] = perf_tolerations
              values_dict["etcd"]["tolerations"] = perf_tolerations
              values_dict["minio"]["tolerations"] = perf_tolerations
              values_dict["pulsarStandalone"][
                  "tolerations"
              ] = perf_tolerations
              # values_dict['pulsar']['autoRecovery']['tolerations'] = perf_tolerations
              # values_dict['pulsar']['proxy']['tolerations'] = perf_tolerations
              # values_dict['pulsar']['broker']['tolerations'] = perf_tolerations
              # values_dict['pulsar']['bookkeeper']['tolerations'] = perf_tolerations
              # values_dict['pulsar']['zookeeper']['tolerations'] = perf_tolerations
  
      # add extra volumes
      values_dict["extraVolumes"] = [
          {
              "name": "test",
              "flexVolume": {
                  "driver": "fstab/cifs",
                  "fsType": "cifs",
                  "secretRef": {"name": "cifs-test-secret"},
                  "options": {
                      "networkPath": config.IDC_NAS_URL,
                      "mountOptions": "vers=1.0",
                  },
              },
          }
      ]
      values_dict["extraVolumeMounts"] = [
          {"name": "test", "mountPath": "/test"}
      ]
  
      with open(file_path, "w") as f:
          dump(values_dict, f, default_flow_style=False)
      f.close()
      # DEBUG
      with open(file_path) as f:
          for line in f.readlines():
              line = line.strip("\n")
              logger.debug(line)
  
file_path: milvus/tests/benchmark/milvus_benchmark/env/helm_utils.py
imports: import os
  import pdb
  import time
  import logging
  import hashlib
  import traceback
  from yaml import full_load, dump
  from milvus_benchmark import utils
  from milvus_benchmark import config
label_desc: Use image node_id 3 for calling a global function with example usage: update_values(file_path, deploy_mode, hostname, server_tag, milvus_config, server_config) without return types