def _Args(parser):
    """Add flags for create command."""
    flags.AddRegionResourceArg(parser,
                               'to create model deployment monitoring job')
    flags.GetDisplayNameArg('model deployment monitoring job').AddToParser(
        parser)
    flags.GetEndpointIdArg(required=True).AddToParser(parser)
    flags.GetEmailsArg(required=True).AddToParser(parser)
    flags.GetPredictionSamplingRateArg(required=True).AddToParser(parser)
    flags.GetMonitoringFrequencyArg(required=False).AddToParser(parser)
    flags.GetPredictInstanceSchemaArg(required=False).AddToParser(parser)
    flags.GetAnalysisInstanceSchemaArg(required=False).AddToParser(parser)
    flags.GetSamplingPredictRequestArg(required=False).AddToParser(parser)
    flags.GetMonitoringLogTtlArg(required=False).AddToParser(parser)
    flags.AddObjectiveConfigGroupForCreate(parser, required=False)
    flags.AddKmsKeyResourceArg(parser, 'model deployment monitoring job')
    flags.GetAnomalyCloudLoggingArg(required=False).AddToParser(parser)
    labels_util.AddCreateLabelsFlags(parser)
예제 #2
0
def AddCreateCustomJobFlags(parser, version=constants.BETA_VERSION):
    """Adds flags related to create a custom job."""
    shared_flags.AddRegionResourceArg(parser, 'to create a custom job')
    shared_flags.TRAINING_SERVICE_ACCOUNT.AddToParser(parser)
    shared_flags.NETWORK.AddToParser(parser)
    shared_flags.AddKmsKeyResourceArg(parser, 'custom job')

    _DISPLAY_NAME.AddToParser(parser)
    _PYTHON_PACKAGE_URIS.AddToParser(parser)
    _CUSTOM_JOB_ARGS.AddToParser(parser)
    _CUSTOM_JOB_COMMAND.AddToParser(parser)
    worker_pool_spec_group = base.ArgumentGroup(
        help='Worker pool specification.', required=True)
    worker_pool_spec_group.AddArgument(_CUSTOM_JOB_CONFIG)
    if version == constants.GA_VERSION:
        worker_pool_spec_group.AddArgument(_WORKER_POOL_SPEC_GA)
    else:
        worker_pool_spec_group.AddArgument(_WORKER_POOL_SPEC_BETA)
    worker_pool_spec_group.AddToParser(parser)
예제 #3
0
def AddCreateHpTuningJobFlags(parser, algorithm_enum):
    """Adds arguments for creating hp tuning job."""
    _HPTUNING_JOB_DISPLAY_NAME.AddToParser(parser)
    _HPTUNING_JOB_CONFIG.AddToParser(parser)
    _HPTUNING_MAX_TRIAL_COUNT.AddToParser(parser)
    _HPTUNING_PARALLEL_TRIAL_COUNT.AddToParser(parser)

    labels_util.AddCreateLabelsFlags(parser)

    flags.AddRegionResourceArg(parser,
                               'to create a hyperparameter tuning job',
                               prompt_func=region_util.GetPromptForRegionFunc(
                                   constants.SUPPORTED_TRAINING_REGIONS))
    flags.TRAINING_SERVICE_ACCOUNT.AddToParser(parser)
    flags.NETWORK.AddToParser(parser)
    flags.ENABLE_WEB_ACCESS.AddToParser(parser)
    flags.AddKmsKeyResourceArg(parser, 'hyperparameter tuning job')

    arg_utils.ChoiceEnumMapper(
        '--algorithm',
        algorithm_enum,
        help_str='Search algorithm specified for the given study. '
    ).choice_arg.AddToParser(parser)
def AddCreateCustomJobFlags(parser):
  """Adds flags related to create a custom job."""
  shared_flags.AddRegionResourceArg(
      parser,
      'to create a custom job',
      prompt_func=region_util.GetPromptForRegionFunc(
          constants.SUPPORTED_TRAINING_REGIONS))
  shared_flags.TRAINING_SERVICE_ACCOUNT.AddToParser(parser)
  shared_flags.NETWORK.AddToParser(parser)
  shared_flags.ENABLE_WEB_ACCESS.AddToParser(parser)
  shared_flags.AddKmsKeyResourceArg(parser, 'custom job')

  labels_util.AddCreateLabelsFlags(parser)

  _DISPLAY_NAME.AddToParser(parser)
  _PYTHON_PACKAGE_URIS.AddToParser(parser)
  _CUSTOM_JOB_ARGS.AddToParser(parser)
  _CUSTOM_JOB_COMMAND.AddToParser(parser)

  worker_pool_spec_group = base.ArgumentGroup(
      help='Worker pool specification.', required=True)
  worker_pool_spec_group.AddArgument(_CUSTOM_JOB_CONFIG)
  worker_pool_spec_group.AddArgument(_WORKER_POOL_SPEC)
  worker_pool_spec_group.AddToParser(parser)
예제 #5
0
def _AddArgs(parser):
    flags.AddRegionResourceArg(parser, 'to create a Tensorboard')
    flags.GetDisplayNameArg('tensorboard').AddToParser(parser)
    flags.GetDescriptionArg('tensorboard').AddToParser(parser)
    flags.AddKmsKeyResourceArg(parser, 'tensorboard')
    labels_util.AddCreateLabelsFlags(parser)