code: def start_container(image, name, nnimanager_os):
      """Start docker container, generate a port in /tmp/nnitest/{name}/port file"""
      port = find_port()
      source_dir = "/tmp/nnitest/" + name
      run_cmds = [
          "docker",
          "run",
          "-d",
          "-t",
          "-p",
          str(port) + ":22",
          "--name",
          name,
          "--mount",
          "type=bind,source=" + source_dir + ",target=/tmp/nni",
          image,
      ]
      output = check_output(run_cmds)
      commit_id = output.decode("utf-8")
  
      if nnimanager_os == "windows":
          wheel_name = find_wheel_package(
              os.path.join(
                  source_dir, "nni-remote/deployment/pypi/dist"
              )
          )
      else:
          wheel_name = find_wheel_package(
              os.path.join(source_dir, "dist")
          )
  
      if not wheel_name:
          print(
              "Error: could not find wheel package in {0}".format(
                  source_dir
              )
          )
          exit(1)
  
      def get_dist(wheel_name):
          """get the wheel package path"""
          if nnimanager_os == "windows":
              return (
                  "/tmp/nni/nni-remote/deployment/pypi/dist/{0}".format(
                      wheel_name
                  )
              )
          else:
              return "/tmp/nni/dist/{0}".format(wheel_name)
  
      pip_cmds = [
          "docker",
          "exec",
          name,
          "python3",
          "-m",
          "pip",
          "install",
          "--upgrade",
          "pip",
          "setuptools==41.0.0",
      ]
      check_call(pip_cmds)
      sdk_cmds = [
          "docker",
          "exec",
          name,
          "python3",
          "-m",
          "pip",
          "install",
          get_dist(wheel_name),
      ]
      check_call(sdk_cmds)
      with open(source_dir + "/port", "w") as file:
          file.write(str(port))
  
file_path: nni/test/training_service/nnitest/remote_docker.py
imports: import os
  import argparse
  from subprocess import check_output, check_call
  import socket
  import random
  import re
label_desc: Use image node_id 4 for calling a global function with example usage: start_container(image, name, nnimanager_os) and returns: str, str