Skip to content

Commit

Permalink
docs: clarify options for logs
Browse files Browse the repository at this point in the history
docs: clarify the custom instance template needs to be in the same project

PiperOrigin-RevId: 703266926
  • Loading branch information
Google APIs authored and copybara-github committed Dec 5, 2024
1 parent 82d07c3 commit 3735100
Showing 1 changed file with 22 additions and 13 deletions.
35 changes: 22 additions & 13 deletions google/cloud/batch/v1/job.proto
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,15 @@ message Job {
repeated JobNotification notifications = 14;
}

// LogsPolicy describes how outputs from a Job's Tasks (stdout/stderr) will be
// preserved.
// LogsPolicy describes if and how a job's logs are preserved. Logs include
// information that is automatically written by the Batch service agent and any
// information that you configured the job's runnables to write to the `stdout`
// or `stderr` streams.
message LogsPolicy {
// `CloudLoggingOption` contains additional settings for Cloud Logging logs
// generated by Batch job.
message CloudLoggingOption {
// Optional. Set this flag to true to change the [monitored resource
// Optional. Set this field to `true` to change the [monitored resource
// type](https://cloud.google.com/monitoring/api/resources) for
// Cloud Logging logs generated by this Batch job from
// the
Expand All @@ -110,26 +112,32 @@ message LogsPolicy {

// The destination (if any) for logs.
enum Destination {
// Logs are not preserved.
// (Default) Logs are not preserved.
DESTINATION_UNSPECIFIED = 0;

// Logs are streamed to Cloud Logging.
// Logs are streamed to Cloud Logging. Optionally, you can configure
// additional settings in the `cloudLoggingOption` field.
CLOUD_LOGGING = 1;

// Logs are saved to a file path.
// Logs are saved to the file path specified in the `logsPath` field.
PATH = 2;
}

// Where logs should be saved.
// If and where logs should be saved.
Destination destination = 1;

// The path to which logs are saved when the destination = PATH. This can be a
// local file path on the VM, or under the mount point of a Persistent Disk or
// Filestore, or a Cloud Storage path.
// When `destination` is set to `PATH`, you must set this field to the path
// where you want logs to be saved. This path can point to a local directory
// on the VM or (if congifured) a directory under the mount path of any
// Cloud Storage bucket, network file system (NFS), or writable persistent
// disk that is mounted to the job. For example, if the job has a bucket with
// `mountPath` set to `/mnt/disks/my-bucket`, you can write logs to the
// root directory of the `remotePath` of that bucket by setting this field to
// `/mnt/disks/my-bucket/`.
string logs_path = 2;

// Optional. Additional settings for Cloud Logging. It will only take effect
// when the destination of `LogsPolicy` is set to `CLOUD_LOGGING`.
// Optional. When `destination` is set to `CLOUD_LOGGING`, you can optionally
// set this field to configure additional settings for Cloud Logging.
CloudLoggingOption cloud_logging_option = 3
[(google.api.field_behavior) = OPTIONAL];
}
Expand Down Expand Up @@ -429,7 +437,8 @@ message AllocationPolicy {
// Named the field as 'instance_template' instead of 'template' to avoid
// C++ keyword conflict.
//
// Batch only supports global instance templates.
// Batch only supports global instance templates from the same project as
// the job.
// You can specify the global instance template as a full or partial URL.
string instance_template = 2;
}
Expand Down

0 comments on commit 3735100

Please sign in to comment.