Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Batch Data plane #10477

Merged
merged 3 commits into from
Mar 26, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions sdk/batch/azure-batch/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# Release History

## 9.0.0 (2020-03-24)

### Features
- Added ability to encrypt `ComputeNode` disk drives using the new `disk_encryption_configuration` property of `VirtualMachineConfiguration`.
- **[Breaking]** The `virtual_machine_id` property of `ImageReference` can now only refer to a Shared Image Gallery image.
- **[Breaking]** Pools can now be provisioned without a public IP using the new `public_ip_address_configuration` property of `NetworkConfiguration`.
- The `public_ips` property of `NetworkConfiguration` has moved in to `public_ip_address_configuration` as well. This property can only be specified if `ip_provisioning_type` is `UserManaged`.

### REST API version
This version of the Batch .NET client library targets version 2020-03-01.11.0 of the Azure Batch REST API.

## 8.0.0 (2019-8-5)

- Using REST API version 2019-08-01.10.0.
Expand Down
3 changes: 1 addition & 2 deletions sdk/batch/azure-batch/azure/batch/_batch_service_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
from . import models
from .custom.patch import patch_client


class BatchServiceClient(SDKClient):
"""A client for issuing REST requests to the Azure Batch service.

Expand Down Expand Up @@ -65,7 +64,7 @@ def __init__(
super(BatchServiceClient, self).__init__(self.config.credentials, self.config)

client_models = {k: v for k, v in models.__dict__.items() if isinstance(v, type)}
self.api_version = '2019-08-01.10.0'
self.api_version = '2020-03-01.11.0'
self._serialize = Serializer(client_models)
self._deserialize = Deserializer(client_models)

Expand Down
2 changes: 1 addition & 1 deletion sdk/batch/azure-batch/azure/batch/_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,5 @@
# regenerated.
# --------------------------------------------------------------------------

VERSION = "8.0.0"
VERSION = "9.0.0"

10 changes: 10 additions & 0 deletions sdk/batch/azure-batch/azure/batch/models/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
from ._models_py3 import ContainerRegistry
from ._models_py3 import DataDisk
from ._models_py3 import DeleteCertificateError
from ._models_py3 import DiskEncryptionConfiguration
from ._models_py3 import EnvironmentSetting
from ._models_py3 import ErrorMessage
from ._models_py3 import ExitCodeMapping
Expand Down Expand Up @@ -174,6 +175,7 @@
from ._models_py3 import PoolUpdatePropertiesOptions
from ._models_py3 import PoolUpdatePropertiesParameter
from ._models_py3 import PoolUsageMetrics
from ._models_py3 import PublicIPAddressConfiguration
from ._models_py3 import RecentJob
from ._models_py3 import ResizeError
from ._models_py3 import ResourceFile
Expand Down Expand Up @@ -269,6 +271,7 @@
from ._models import ContainerRegistry
from ._models import DataDisk
from ._models import DeleteCertificateError
from ._models import DiskEncryptionConfiguration
from ._models import EnvironmentSetting
from ._models import ErrorMessage
from ._models import ExitCodeMapping
Expand Down Expand Up @@ -380,6 +383,7 @@
from ._models import PoolUpdatePropertiesOptions
from ._models import PoolUpdatePropertiesParameter
from ._models import PoolUsageMetrics
from ._models import PublicIPAddressConfiguration
from ._models import RecentJob
from ._models import ResizeError
from ._models import ResourceFile
Expand Down Expand Up @@ -451,9 +455,11 @@
CertificateVisibility,
CachingType,
StorageAccountType,
DiskEncryptionTarget,
DynamicVNetAssignmentScope,
InboundEndpointProtocol,
NetworkSecurityGroupRuleAccess,
IPAddressProvisioningType,
PoolLifetimeOption,
OnAllTasksComplete,
OnTaskFailure,
Expand Down Expand Up @@ -532,6 +538,7 @@
'ContainerRegistry',
'DataDisk',
'DeleteCertificateError',
'DiskEncryptionConfiguration',
'EnvironmentSetting',
'ErrorMessage',
'ExitCodeMapping',
Expand Down Expand Up @@ -643,6 +650,7 @@
'PoolUpdatePropertiesOptions',
'PoolUpdatePropertiesParameter',
'PoolUsageMetrics',
'PublicIPAddressConfiguration',
'RecentJob',
'ResizeError',
'ResourceFile',
Expand Down Expand Up @@ -713,9 +721,11 @@
'CertificateVisibility',
'CachingType',
'StorageAccountType',
'DiskEncryptionTarget',
'DynamicVNetAssignmentScope',
'InboundEndpointProtocol',
'NetworkSecurityGroupRuleAccess',
'IPAddressProvisioningType',
'PoolLifetimeOption',
'OnAllTasksComplete',
'OnTaskFailure',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ class StorageAccountType(str, Enum):
premium_lrs = "premium_lrs" #: The data disk should use premium locally redundant storage.


class DiskEncryptionTarget(str, Enum):

os_disk = "osdisk" #: The OS Disk on the compute node is encrypted.
temporary_disk = "temporarydisk" #: The temporary disk on the compute node is encrypted. On Linux this encryption applies to other partitions (such as those on mounted data disks) when encryption occurs at boot time.


class DynamicVNetAssignmentScope(str, Enum):

none = "none" #: No dynamic VNet assignment is enabled.
Expand All @@ -136,6 +142,13 @@ class NetworkSecurityGroupRuleAccess(str, Enum):
deny = "deny" #: Deny access.


class IPAddressProvisioningType(str, Enum):

batch_managed = "batchmanaged" #: A public IP will be created and managed by Batch. There may be multiple public IPs depending on the size of the Pool.
user_managed = "usermanaged" #: Public IPs are provided by the user and will be used to provision the Compute Nodes.
no_public_ip_addresses = "nopublicipaddresses" #: No public IP Address will be created.


class PoolLifetimeOption(str, Enum):

job_schedule = "jobschedule" #: The Pool exists for the lifetime of the Job Schedule. The Batch Service creates the Pool when it creates the first Job on the schedule. You may apply this option only to Job Schedules, not to Jobs.
Expand Down
104 changes: 77 additions & 27 deletions sdk/batch/azure-batch/azure/batch/models/_models.py
Original file line number Diff line number Diff line change
Expand Up @@ -697,8 +697,7 @@ class CertificateAddParameter(Model):
values include: 'pfx', 'cer'
:type certificate_format: str or ~azure.batch.models.CertificateFormat
:param password: The password to access the Certificate's private key.
This is required if the Certificate format is pfx. It should be omitted if
the Certificate format is cer.
This must be omitted if the Certificate format is cer.
:type password: str
"""

Expand Down Expand Up @@ -2624,6 +2623,27 @@ def __init__(self, **kwargs):
self.values = kwargs.get('values', None)


class DiskEncryptionConfiguration(Model):
"""The disk encryption configuration applied on compute nodes in the pool.
Disk encryption configuration is not supported on Linux pool created with
Shared Image Gallery Image.

:param targets: The list of disk targets Batch Service will encrypt on the
compute node. If omitted, no disks on the compute nodes in the pool will
be encrypted. On Linux pool, only "TemporaryDisk" is supported; on Windows
pool, "OsDisk" and "TemporaryDisk" must be specified.
:type targets: list[str or ~azure.batch.models.DiskEncryptionTarget]
"""

_attribute_map = {
'targets': {'key': 'targets', 'type': '[DiskEncryptionTarget]'},
}

def __init__(self, **kwargs):
super(DiskEncryptionConfiguration, self).__init__(**kwargs)
self.targets = kwargs.get('targets', None)


class EnvironmentSetting(Model):
"""An environment variable to be set on a Task process.

Expand Down Expand Up @@ -3282,19 +3302,16 @@ class ImageReference(Model):
Image. A value of 'latest' can be specified to select the latest version
of an Image. If omitted, the default is 'latest'.
:type version: str
:param virtual_machine_image_id: The ARM resource identifier of the
Virtual Machine Image or Shared Image Gallery Image. Computes Compute
Nodes of the Pool will be created using this Image Id. This is of either
the form
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/images/{imageName}
for Virtual Machine Image or
/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionId}
for SIG image. This property is mutually exclusive with other
ImageReference properties. For Virtual Machine Image it must be in the
same region and subscription as the Azure Batch account. For SIG image it
must have replicas in the same region as the Azure Batch account. For
information about the firewall settings for the Batch Compute Node agent
to communicate with the Batch service see
:param virtual_machine_image_id: The ARM resource identifier of the Shared
Image Gallery Image. Compute Nodes in the Pool will be created using this
Image Id. This is of the
form/subscriptions/{subscriptionId}/resourceGroups/{resourceGroup}/providers/Microsoft.Compute/galleries/{galleryName}/images/{imageDefinitionName}/versions/{versionId}.
This property is mutually exclusive with other ImageReference properties.
For Virtual Machine Image it must be in the same region and subscription
as the Azure Batch account. The Shared Image Gallery Image must have
replicas in the same region as the Azure Batch account. For information
about the firewall settings for the Batch Compute Node agent to
communicate with the Batch service see
https://docs.microsoft.com/en-us/azure/batch/batch-api-basics#virtual-network-vnet-and-firewall-configuration.
:type virtual_machine_image_id: str
"""
Expand Down Expand Up @@ -6479,7 +6496,7 @@ class NetworkConfiguration(Model):
Azure Batch Account. The specified subnet should have enough free IP
addresses to accommodate the number of Compute Nodes in the Pool. If the
subnet doesn't have enough free IP addresses, the Pool will partially
allocate Nodes, and a resize error will occur. The 'MicrosoftAzureBatch'
allocate Nodes and a resize error will occur. The 'MicrosoftAzureBatch'
service principal must have the 'Classic Virtual Machine Contributor'
Role-Based Access Control (RBAC) role for the specified VNet. The
specified subnet must allow communication from the Azure Batch service to
Expand Down Expand Up @@ -6508,29 +6525,26 @@ class NetworkConfiguration(Model):
Pools with the virtualMachineConfiguration property.
:type endpoint_configuration:
~azure.batch.models.PoolEndpointConfiguration
:param public_ips: The list of public IPs which the Batch service will use
when provisioning Compute Nodes. The number of IPs specified here limits
the maximum size of the Pool - 50 dedicated nodes or 20 low-priority nodes
can be allocated for each public IP. For example, a pool needing 150
dedicated VMs would need at least 3 public IPs specified. Each element of
this collection is of the form:
/subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}.
:type public_ips: list[str]
:param public_ip_address_configuration: The Public IPAddress configuration
for Compute Nodes in the Batch Pool. Public IP configuration property is
only supported on Pools with the virtualMachineConfiguration property.
:type public_ip_address_configuration:
~azure.batch.models.PublicIPAddressConfiguration
"""

_attribute_map = {
'subnet_id': {'key': 'subnetId', 'type': 'str'},
'dynamic_vnet_assignment_scope': {'key': 'dynamicVNetAssignmentScope', 'type': 'DynamicVNetAssignmentScope'},
'endpoint_configuration': {'key': 'endpointConfiguration', 'type': 'PoolEndpointConfiguration'},
'public_ips': {'key': 'publicIPs', 'type': '[str]'},
'public_ip_address_configuration': {'key': 'publicIPAddressConfiguration', 'type': 'PublicIPAddressConfiguration'},
}

def __init__(self, **kwargs):
super(NetworkConfiguration, self).__init__(**kwargs)
self.subnet_id = kwargs.get('subnet_id', None)
self.dynamic_vnet_assignment_scope = kwargs.get('dynamic_vnet_assignment_scope', None)
self.endpoint_configuration = kwargs.get('endpoint_configuration', None)
self.public_ips = kwargs.get('public_ips', None)
self.public_ip_address_configuration = kwargs.get('public_ip_address_configuration', None)


class NetworkSecurityGroupRule(Model):
Expand All @@ -6543,7 +6557,7 @@ class NetworkSecurityGroupRule(Model):
number the higher the priority. For example, rules could be specified with
order numbers of 150, 250, and 350. The rule with the order number of 150
takes precedence over the rule that has an order of 250. Allowed
priorities are 150 to 3500. If any reserved or duplicate values are
priorities are 150 to 4096. If any reserved or duplicate values are
provided the request fails with HTTP status code 400.
:type priority: int
:param access: Required. The action that should be taken for a specified
Expand Down Expand Up @@ -8609,6 +8623,35 @@ def __init__(self, **kwargs):
self.total_core_hours = kwargs.get('total_core_hours', None)


class PublicIPAddressConfiguration(Model):
"""The public IP Address configuration of the networking configuration of a
Pool.

:param provision: The provisioning type for Public IP Addresses for the
Pool. The default value is BatchManaged. Possible values include:
'batchManaged', 'userManaged', 'noPublicIPAddresses'
:type provision: str or ~azure.batch.models.IPAddressProvisioningType
:param ip_address_ids: The list of public IPs which the Batch service will
use when provisioning Compute Nodes. The number of IPs specified here
limits the maximum size of the Pool - 50 dedicated nodes or 20
low-priority nodes can be allocated for each public IP. For example, a
pool needing 150 dedicated VMs would need at least 3 public IPs specified.
Each element of this collection is of the form:
/subscriptions/{subscription}/resourceGroups/{group}/providers/Microsoft.Network/publicIPAddresses/{ip}.
:type ip_address_ids: list[str]
"""

_attribute_map = {
'provision': {'key': 'provision', 'type': 'IPAddressProvisioningType'},
'ip_address_ids': {'key': 'ipAddressIds', 'type': '[str]'},
}

def __init__(self, **kwargs):
super(PublicIPAddressConfiguration, self).__init__(**kwargs)
self.provision = kwargs.get('provision', None)
self.ip_address_ids = kwargs.get('ip_address_ids', None)


class RecentJob(Model):
"""Information about the most recent Job to run under the Job Schedule.

Expand Down Expand Up @@ -10648,6 +10691,11 @@ class VirtualMachineConfiguration(Model):
this Pool must specify the containerSettings property, and all other Tasks
may specify it.
:type container_configuration: ~azure.batch.models.ContainerConfiguration
:param disk_encryption_configuration: The disk encryption configuration
for the pool. If specified, encryption is performed on each node in the
pool during node provisioning.
:type disk_encryption_configuration:
~azure.batch.models.DiskEncryptionConfiguration
"""

_validation = {
Expand All @@ -10662,6 +10710,7 @@ class VirtualMachineConfiguration(Model):
'data_disks': {'key': 'dataDisks', 'type': '[DataDisk]'},
'license_type': {'key': 'licenseType', 'type': 'str'},
'container_configuration': {'key': 'containerConfiguration', 'type': 'ContainerConfiguration'},
'disk_encryption_configuration': {'key': 'diskEncryptionConfiguration', 'type': 'DiskEncryptionConfiguration'},
}

def __init__(self, **kwargs):
Expand All @@ -10672,6 +10721,7 @@ def __init__(self, **kwargs):
self.data_disks = kwargs.get('data_disks', None)
self.license_type = kwargs.get('license_type', None)
self.container_configuration = kwargs.get('container_configuration', None)
self.disk_encryption_configuration = kwargs.get('disk_encryption_configuration', None)


class WindowsConfiguration(Model):
Expand Down
Loading