Example #1
0
def _AddSubmitTrainingArgs(parser):
    """Add arguments for `jobs submit training` command."""
    flags.JOB_NAME.AddToParser(parser)
    flags.PACKAGE_PATH.AddToParser(parser)
    flags.PACKAGES.AddToParser(parser)
    flags.MODULE_NAME.AddToParser(parser)
    compute_flags.AddRegionFlag(parser, 'machine learning training job',
                                'submit')
    flags.CONFIG.AddToParser(parser)
    flags.STAGING_BUCKET.AddToParser(parser)
    flags.GetJobDirFlag(upload_help=True).AddToParser(parser)
    flags.GetUserArgs(local=False).AddToParser(parser)
    flags.SCALE_TIER.AddToParser(parser)
    flags.RUNTIME_VERSION.AddToParser(parser)

    sync_group = parser.add_mutually_exclusive_group()
    # TODO(b/36195821): Use the flag deprecation machinery when it supports the
    # store_true action
    sync_group.add_argument(
        '--async',
        action='store_true',
        help=(
            '(DEPRECATED) Display information about the operation in progress '
            'without waiting for the operation to complete. '
            'Enabled by default and can be omitted; use `--stream-logs` to run '
            'synchronously.'))
    sync_group.add_argument(
        '--stream-logs',
        action='store_true',
        help=
        ('Block until job completion and stream the logs while the job runs.'
         '\n\n'
         'Note that even if command execution is halted, the job will still '
         'run until cancelled with\n\n'
         '    $ gcloud ml-engine jobs cancel JOB_ID'))
Example #2
0
    def Args(parser):
        """Register flags for this command."""
        flags.JOB_NAME.AddToParser(parser)
        flags.PACKAGE_PATH.AddToParser(parser)
        flags.PACKAGES.AddToParser(parser)
        flags.MODULE_NAME.AddToParser(parser)
        compute_flags.AddRegionFlag(parser, 'machine learning training job',
                                    'submit')
        flags.CONFIG.AddToParser(parser)
        flags.STAGING_BUCKET.AddToParser(parser)
        parser.add_argument('--job-dir',
                            type=storage_util.ObjectReference.FromUrl,
                            help="""\
            A Google Cloud Storage path in which to store training outputs and
            other data needed for training.

            This path will be passed to your TensorFlow program as `--job_dir`
            command-line arg. The benefit of specifying this field is that Cloud
            ML will validate the path for use in training.

            If packages must be uploaded and `--staging-bucket` is not provided,
            this path will be used instead.
        """)
        flags.GetUserArgs(local=False).AddToParser(parser)
        flags.SCALE_TIER.AddToParser(parser)
        flags.RUNTIME_VERSION.AddToParser(parser)
        base.ASYNC_FLAG.AddToParser(parser)
Example #3
0
 def Args(parser):
     """Register flags for this command."""
     flags.PACKAGE_PATH.AddToParser(parser)
     flags.MODULE_NAME.AddToParser(parser)
     flags.DISTRIBUTED.AddToParser(parser)
     flags.PARAM_SERVERS.AddToParser(parser)
     flags.WORKERS.AddToParser(parser)
     flags.START_PORT.AddToParser(parser)
     flags.GetUserArgs(local=True).AddToParser(parser)
Example #4
0
 def Args(parser):
   """Register flags for this command."""
   flags.JOB_NAME.AddToParser(parser)
   flags.PACKAGE_PATH.AddToParser(parser)
   flags.PACKAGES.AddToParser(parser)
   flags.MODULE_NAME.AddToParser(parser)
   compute_flags.AddRegionFlag(parser, 'machine learning training job',
                               'submit')
   flags.CONFIG.AddToParser(parser)
   flags.GetStagingBucket(required=True).AddToParser(parser)
   flags.GetUserArgs(local=False).AddToParser(parser)
   flags.SCALE_TIER.AddToParser(parser)
   flags.RUNTIME_VERSION.AddToParser(parser)
   base.ASYNC_FLAG.AddToParser(parser)