code: def launch():
    
    validate_flags()
    job_spec = configure_job()
    job_name = job_spec["jobId"]
    tf.logging.info("Launching job %s with ML Engine spec:\n%s", job_name,
                    pprint.pformat(job_spec))
    assert confirm()
    train_dir = FLAGS.output_dir
    t2t_tar = tar_and_copy_t2t(train_dir)
    configure_trainer_package(job_spec, t2t_tar)
    if FLAGS.t2t_usr_dir:
      usr_tar = tar_and_copy_usr_dir(FLAGS.t2t_usr_dir, train_dir)
      configure_usr_dir(job_spec, usr_tar)
    launch_job(job_spec)
    tf.logging.info("Launched %s. See console to track: %s.", job_name,
                    CONSOLE_URL)
    tf.logging.info("Interact with the training job from the command line:")
    tf.logging.info("Abort job: gcloud ml-engine jobs cancel %s", job_name)
    tf.logging.info("Stream logs: gcloud ml-engine jobs stream-logs %s", job_name)
    tf.logging.info("Open tensorboard: tensorboard --logdir %s", train_dir)
docs: Launch t2t_trainer on Cloud ML Engine.