Class: Google::Cloud::Batch::V1::AllocationPolicy

Inherits:
Object
  • Object
show all
Extended by:
Protobuf::MessageExts::ClassMethods
Includes:
Protobuf::MessageExts
Defined in:
proto_docs/google/cloud/batch/v1/job.rb

Overview

A Job's resource allocation policy describes when, where, and how compute resources should be allocated for the Job.

Defined Under Namespace

Modules: ProvisioningModel Classes: Accelerator, AttachedDisk, Disk, InstancePolicy, InstancePolicyOrTemplate, LabelsEntry, LocationPolicy, NetworkInterface, NetworkPolicy, PlacementPolicy

Instance Attribute Summary collapse

Instance Attribute Details

#instances::Array<::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicyOrTemplate>

Returns Describe instances that can be created by this AllocationPolicy. Only instances[0] is supported now.

Returns:



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 281

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * "batch-debian": use Batch Debian images.
  #     * "batch-centos": use Batch CentOS images.
  #     * "batch-cos": use Batch Container-Optimized images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     For persistent disk, this field is ignored if `data_source` is `image` or
  #     `snapshot`.
  #     For local SSD, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  #     For boot disk, Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the boot_disk_mib field in task spec's
  #     compute_resource are defined, Batch will only honor this field.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#labels::Google::Protobuf::Map{::String => ::String}

Returns Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided or system generated. You can assign up to 64 labels. Google Compute Engine label restrictions apply. Label names that start with "goog-" or "google-" are reserved.

Returns:

  • (::Google::Protobuf::Map{::String => ::String})

    Labels applied to all VM instances and other resources created by AllocationPolicy. Labels could be user provided or system generated. You can assign up to 64 labels. Google Compute Engine label restrictions apply. Label names that start with "goog-" or "google-" are reserved.



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 281

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * "batch-debian": use Batch Debian images.
  #     * "batch-centos": use Batch CentOS images.
  #     * "batch-cos": use Batch Container-Optimized images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     For persistent disk, this field is ignored if `data_source` is `image` or
  #     `snapshot`.
  #     For local SSD, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  #     For boot disk, Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the boot_disk_mib field in task spec's
  #     compute_resource are defined, Batch will only honor this field.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#location::Google::Cloud::Batch::V1::AllocationPolicy::LocationPolicy

Returns Location where compute resources should be allocated for the Job.

Returns:



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 281

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * "batch-debian": use Batch Debian images.
  #     * "batch-centos": use Batch CentOS images.
  #     * "batch-cos": use Batch Container-Optimized images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     For persistent disk, this field is ignored if `data_source` is `image` or
  #     `snapshot`.
  #     For local SSD, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  #     For boot disk, Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the boot_disk_mib field in task spec's
  #     compute_resource are defined, Batch will only honor this field.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#network::Google::Cloud::Batch::V1::AllocationPolicy::NetworkPolicy

Returns The network policy.



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 281

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * "batch-debian": use Batch Debian images.
  #     * "batch-centos": use Batch CentOS images.
  #     * "batch-cos": use Batch Container-Optimized images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     For persistent disk, this field is ignored if `data_source` is `image` or
  #     `snapshot`.
  #     For local SSD, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  #     For boot disk, Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the boot_disk_mib field in task spec's
  #     compute_resource are defined, Batch will only honor this field.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#placement::Google::Cloud::Batch::V1::AllocationPolicy::PlacementPolicy

Returns The placement policy.



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 281

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * "batch-debian": use Batch Debian images.
  #     * "batch-centos": use Batch CentOS images.
  #     * "batch-cos": use Batch Container-Optimized images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     For persistent disk, this field is ignored if `data_source` is `image` or
  #     `snapshot`.
  #     For local SSD, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  #     For boot disk, Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the boot_disk_mib field in task spec's
  #     compute_resource are defined, Batch will only honor this field.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end

#service_account::Google::Cloud::Batch::V1::ServiceAccount

Returns Service account that VMs will run as.

Returns:



281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
# File 'proto_docs/google/cloud/batch/v1/job.rb', line 281

class AllocationPolicy
  include ::Google::Protobuf::MessageExts
  extend ::Google::Protobuf::MessageExts::ClassMethods

  # @!attribute [rw] allowed_locations
  #   @return [::Array<::String>]
  #     A list of allowed location names represented by internal URLs.
  #
  #     Each location can be a region or a zone.
  #     Only one region or multiple zones in one region is supported now.
  #     For example,
  #     ["regions/us-central1"] allow VMs in any zones in region us-central1.
  #     ["zones/us-central1-a", "zones/us-central1-c"] only allow VMs
  #     in zones us-central1-a and us-central1-c.
  #
  #     All locations end up in different regions would cause errors.
  #     For example,
  #     ["regions/us-central1", "zones/us-central1-a", "zones/us-central1-b",
  #     "zones/us-west1-a"] contains 2 regions "us-central1" and
  #     "us-west1". An error is expected in this case.
  class LocationPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new persistent disk or a local ssd.
  # A VM can only have one local SSD setting but multiple local SSD partitions.
  # See https://cloud.google.com/compute/docs/disks#pdspecs and
  # https://cloud.google.com/compute/docs/disks#localssds.
  # @!attribute [rw] image
  #   @return [::String]
  #     Name of a public or custom image used as the data source.
  #     For example, the following are all valid URLs:
  #
  #     * Specify the image by its family name:
  #     projects/\\{project}/global/images/family/\\{image_family}
  #     * Specify the image version:
  #     projects/\\{project}/global/images/\\{image_version}
  #
  #     You can also use Batch customized image in short names.
  #     The following image values are supported for a boot disk:
  #
  #     * "batch-debian": use Batch Debian images.
  #     * "batch-centos": use Batch CentOS images.
  #     * "batch-cos": use Batch Container-Optimized images.
  # @!attribute [rw] snapshot
  #   @return [::String]
  #     Name of a snapshot used as the data source.
  #     Snapshot is not supported as boot disk now.
  # @!attribute [rw] type
  #   @return [::String]
  #     Disk type as shown in `gcloud compute disk-types list`.
  #     For example, local SSD uses type "local-ssd".
  #     Persistent disks and boot disks use "pd-balanced", "pd-extreme", "pd-ssd"
  #     or "pd-standard".
  # @!attribute [rw] size_gb
  #   @return [::Integer]
  #     Disk size in GB.
  #
  #     For persistent disk, this field is ignored if `data_source` is `image` or
  #     `snapshot`.
  #     For local SSD, size_gb should be a multiple of 375GB,
  #     otherwise, the final size will be the next greater multiple of 375 GB.
  #     For boot disk, Batch will calculate the boot disk size based on source
  #     image and task requirements if you do not speicify the size.
  #     If both this field and the boot_disk_mib field in task spec's
  #     compute_resource are defined, Batch will only honor this field.
  # @!attribute [rw] disk_interface
  #   @return [::String]
  #     Local SSDs are available through both "SCSI" and "NVMe" interfaces.
  #     If not indicated, "NVMe" will be the default one for local ssds.
  #     We only support "SCSI" for persistent disks now.
  class Disk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A new or an existing persistent disk (PD) or a local ssd attached to a VM
  # instance.
  # @!attribute [rw] new_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  # @!attribute [rw] existing_disk
  #   @return [::String]
  #     Name of an existing PD.
  # @!attribute [rw] device_name
  #   @return [::String]
  #     Device name that the guest operating system will see.
  #     It is used by Runnable.volumes field to mount disks. So please specify
  #     the device_name if you want Batch to help mount the disk, and it should
  #     match the device_name field in volumes.
  class AttachedDisk
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Accelerator describes Compute Engine accelerators to be attached to the VM.
  # @!attribute [rw] type
  #   @return [::String]
  #     The accelerator type. For example, "nvidia-tesla-t4".
  #     See `gcloud compute accelerator-types list`.
  # @!attribute [rw] count
  #   @return [::Integer]
  #     The number of accelerators of this type.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Deprecated: please use instances[0].install_gpu_drivers instead.
  class Accelerator
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # InstancePolicy describes an instance type and resources attached to each VM
  # created by this InstancePolicy.
  # @!attribute [rw] machine_type
  #   @return [::String]
  #     The Compute Engine machine type.
  # @!attribute [rw] min_cpu_platform
  #   @return [::String]
  #     The minimum CPU platform.
  #     See
  #     https://cloud.google.com/compute/docs/instances/specify-min-cpu-platform.
  #     Not yet implemented.
  # @!attribute [rw] provisioning_model
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::ProvisioningModel]
  #     The provisioning model.
  # @!attribute [rw] accelerators
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::Accelerator>]
  #     The accelerators attached to each VM instance.
  # @!attribute [rw] boot_disk
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::Disk]
  #     Boot disk to be created and attached to each VM by this InstancePolicy.
  #     Boot disk will be deleted when the VM is deleted.
  #     Batch API now only supports booting from image.
  # @!attribute [rw] disks
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::AttachedDisk>]
  #     Non-boot disks to be attached for each VM created by this InstancePolicy.
  #     New disks will be deleted when the VM is deleted.
  class InstancePolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Either an InstancePolicy or an instance template.
  # @!attribute [rw] policy
  #   @return [::Google::Cloud::Batch::V1::AllocationPolicy::InstancePolicy]
  #     InstancePolicy.
  # @!attribute [rw] instance_template
  #   @return [::String]
  #     Name of an instance template used to create VMs.
  #     Named the field as 'instance_template' instead of 'template' to avoid
  #     c++ keyword conflict.
  # @!attribute [rw] install_gpu_drivers
  #   @return [::Boolean]
  #     Set this field true if users want Batch to help fetch drivers from a
  #     third party location and install them for GPUs specified in
  #     policy.accelerators or instance_template on their behalf. Default is
  #     false.
  class InstancePolicyOrTemplate
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # A network interface.
  # @!attribute [rw] network
  #   @return [::String]
  #     The URL of an existing network resource.
  #     You can specify the network as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/global/networks/\\{network}
  #     * projects/\\{project}/global/networks/\\{network}
  #     * global/networks/\\{network}
  # @!attribute [rw] subnetwork
  #   @return [::String]
  #     The URL of an existing subnetwork resource in the network.
  #     You can specify the subnetwork as a full or partial URL.
  #
  #     For example, the following are all valid URLs:
  #
  #     * https://www.googleapis.com/compute/v1/projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * projects/\\{project}/regions/\\{region}/subnetworks/\\{subnetwork}
  #     * regions/\\{region}/subnetworks/\\{subnetwork}
  # @!attribute [rw] no_external_ip_address
  #   @return [::Boolean]
  #     Default is false (with an external IP address). Required if
  #     no external public IP address is attached to the VM. If no external
  #     public IP address, additional configuration is required to allow the VM
  #     to access Google Services. See
  #     https://cloud.google.com/vpc/docs/configure-private-google-access and
  #     https://cloud.google.com/nat/docs/gce-example#create-nat for more
  #     information.
  class NetworkInterface
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # NetworkPolicy describes VM instance network configurations.
  # @!attribute [rw] network_interfaces
  #   @return [::Array<::Google::Cloud::Batch::V1::AllocationPolicy::NetworkInterface>]
  #     Network configurations.
  class NetworkPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # PlacementPolicy describes a group placement policy for the VMs controlled
  # by this AllocationPolicy.
  # @!attribute [rw] collocation
  #   @return [::String]
  #     UNSPECIFIED vs. COLLOCATED (default UNSPECIFIED). Use COLLOCATED when you
  #     want VMs to be located close to each other for low network latency
  #     between the VMs. No placement policy will be generated when collocation
  #     is UNSPECIFIED.
  # @!attribute [rw] max_distance
  #   @return [::Integer]
  #     When specified, causes the job to fail if more than max_distance logical
  #     switches are required between VMs. Batch uses the most compact possible
  #     placement of VMs even when max_distance is not specified. An explicit
  #     max_distance makes that level of compactness a strict requirement.
  #     Not yet implemented
  class PlacementPolicy
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # @!attribute [rw] key
  #   @return [::String]
  # @!attribute [rw] value
  #   @return [::String]
  class LabelsEntry
    include ::Google::Protobuf::MessageExts
    extend ::Google::Protobuf::MessageExts::ClassMethods
  end

  # Compute Engine VM instance provisioning model.
  module ProvisioningModel
    # Unspecified.
    PROVISIONING_MODEL_UNSPECIFIED = 0

    # Standard VM.
    STANDARD = 1

    # SPOT VM.
    SPOT = 2

    # Preemptible VM (PVM).
    #
    # Above SPOT VM is the preferable model for preemptible VM instances: the
    # old preemptible VM model (indicated by this field) is the older model,
    # and has been migrated to use the SPOT model as the underlying technology.
    # This old model will still be supported.
    PREEMPTIBLE = 3
  end
end