def add_setup_parser_arguments()

in perfzero/lib/perfzero/perfzero_config.py [0:0]


def add_setup_parser_arguments(parser):
  """Add arguments to the parser used by the setup.py."""
  parser.add_argument(
      '--dockerfile_path',
      default='docker/Dockerfile_ubuntu_1804_tf_v1',
      type=str,
      help='''Build the docker image using docker file located at the ${pwd}/${dockerfile_path} if
      it exists, where ${pwd} is user's current work directory. Otherwise, build
      the docker image using the docker file located at path_to_perfzero/${dockerfile_path}.
      ''')
  parser.add_argument(
      '--workspace',
      default='workspace',
      type=str,
      help='''The gcloud key file will be downloaded under directory path_to_perfzero/${workspace}
      ''')
  parser.add_argument(
      '--gcloud_key_file_url',
      default='',
      type=str,
      help='''DEPRECATED: Use --gcloud_key_file_url of setup.py instead.
      The gcloud key file url. When specified, it will be downloaded to the
      directory specified by the flag --workspace. Each url can start with file://, gcs://, http:// or https://.
      ''')
  parser.add_argument(
      '--root_data_dir',
      default='/data',
      type=str,
      help='The directory which should contain the dataset required by the becnhmark method.'
      )
  parser.add_argument(
      '--gce_nvme_raid',
      default=None,
      type=str,
      help='If set to non-empty string, create raid 0 array with devices at the directory specified by the flag --root_data_dir'
      )
  parser.add_argument(
      '--tensorflow_pip_spec',
      default=None,
      type=str,
      help='''The tensorflow pip package specfication. The format can be either ${package_name}, or ${package_name}==${package_version}.
      Example values include tf-nightly-gpu, and tensorflow==1.12.0. If it is specified, the corresponding tensorflow pip package/version
      will be installed. Otherwise, the default tensorflow pip package specified in the docker file will be installed.
      ''')
  parser.add_argument(
      '--extra_pip_specs',
      default='',
      type=str,
      help='''Additional specifications to pass to `pip install`. (e.g. pinning certain dependencies)
      Specifications should be semicolon separated: e.g. `numpy==1.16.4;scipy==1.3.1`
      ''')
  parser.add_argument(
      '--docker_tag',
      default='perfzero/tensorflow',
      type=str,
      help='The docker tag to use if building a docker image.'
      )
  parser.add_argument(
      '--site_package_downloads',
      default='',
      type=str,
      help='''Comma separated list of dirs in the external vm to copy to the docker\'s site package dir.
      Format: <absolute-path>/src/dir:new_base_dir_name,<absolute-path>/src/dir2>:new_name,....
      This will copy <absolute-path>/src/dir to <site-packages>/new_base_dir_name.
      '''
      )
  parser.add_argument(
      '--extra_docker_build_args',
      nargs='*',
      default='',
      type=str,
      help='''Additional build-args to pass to `docker build`.
      Example: --extra_docker_build_args arg0 arg1=value1 "arg2=value with space" arg3=300.
      Each string will be passed directly as a build-arg to docker, so the above example will be passed as follows:
      --build-arg arg0 --build-arg arg1=value1 --build-arg "arg2=value with space" --build-arg arg3=300
      '''
      )