defaults ======== .. py:module:: defaults .. autoapi-nested-parse:: Default configurations for Azure resources. Attributes ---------- .. autoapisummary:: defaults.default_image_publisher defaults.default_image_offer defaults.default_image_sku defaults.default_node_agent_sku_id defaults.default_azure_batch_resource_url defaults.default_azure_batch_endpoint_subdomain defaults.default_azure_blob_storage_endpoint_subdomain defaults.default_azure_container_registry_domain defaults.default_image_reference defaults.default_container_configuration defaults.default_vm_configuration defaults.default_vm_size defaults.default_autoscale_evaluation_interval defaults.default_autoscale_formula defaults.default_network_config_dict defaults.default_pool_config_dict Functions --------- .. autoapisummary:: defaults.get_default_pool_identity defaults.get_default_pool_config defaults.assign_container_config Module Contents --------------- .. py:data:: default_image_publisher :value: 'microsoft-dsvm' .. py:data:: default_image_offer :value: 'ubuntu-hpc' .. py:data:: default_image_sku :value: '2204' .. py:data:: default_node_agent_sku_id :value: 'batch.node.ubuntu 22.04' .. py:data:: default_azure_batch_resource_url :value: 'https://batch.core.windows.net/' .. py:data:: default_azure_batch_endpoint_subdomain :value: 'batch.azure.com/' .. py:data:: default_azure_blob_storage_endpoint_subdomain :value: 'blob.core.windows.net/' .. py:data:: default_azure_container_registry_domain :value: 'azurecr.io' .. py:data:: default_image_reference .. py:data:: default_container_configuration .. py:data:: default_vm_configuration .. py:data:: default_vm_size :value: 'standard_d4s_v3' .. py:data:: default_autoscale_evaluation_interval :value: 'PT5M' .. py:data:: default_autoscale_formula :value: Multiline-String .. raw:: html
Show Value .. code-block:: python """ $tasks = max(0, $PendingTasks.GetSample(1)); // If number of tasks is not 0, set targetVM to pending tasks, otherwise 0. $targetVMs = $tasks > 0 ? $tasks : 0; // The pool size is capped at 10, if target VM value is more than that, set it to 10. cappedPoolSize = 10; $TargetDedicatedNodes = max(0, min($targetVMs, cappedPoolSize)); // Set node deallocation mode - keep nodes active only until tasks finish $NodeDeallocationOption = taskcompletion; """ .. raw:: html
.. py:data:: default_network_config_dict .. py:data:: default_pool_config_dict .. py:function:: get_default_pool_identity(user_assigned_identity: str) -> azure.mgmt.batch.models.BatchPoolIdentity Get the default :class:`models.BatchPoolIdentity` instance for azuretools (which associates a blank `class:`models.UserAssignedIdentities` instance to the provided ``user_assigned_identity`` string. Parameters ---------- user_assigned_identity User-assigned identity, as a string. Returns ------- models.BatchPoolIdentity Instantiated :class:`BatchPoolIdentity`` instance using the provided user-assigned identity. .. py:function:: get_default_pool_config(pool_name: str, subnet_id: str, user_assigned_identity: str, **kwargs) -> azure.mgmt.batch.models.Pool Instantiate a :class:`azure.mgmt.batch.models.Pool` instance with the given pool name and subnet id, the default pool identity given by :func:`get_default_pool_identity`, and other defaults specified in :obj:`default_pool_config_dict` and :obj:`default_network_config_dict`. Parameters ---------- pool_name Name for the pool. Passed as the ``display_name`` argument to the :class:`models.Pool` constructor. subnet_id Subnet id for the pool, as a string. Should typically be obtained from a configuration file or an environment variable, often via a :class:`CredentialHandler` instance. user_assigned_identity User-assigned identity for the pool, as a string. Passed to :func:`get_default_pool_identity`. **kwargs Additional keyword arguments passed to the :class:`models.Pool` constructor, potentially overriding settings from :obj:`default_pool_config_dict`. Returns ------- models.Pool The instantiated :class:`models.Pool` object. .. py:function:: assign_container_config(pool_config: azure.mgmt.batch.models.Pool, container_config: azure.mgmt.batch.models.ContainerConfiguration) -> azure.mgmt.batch.models.Pool Assign a container configuration to a models.Pool object (in place). Parameters ---------- pool_config :class:`models.Pool` configuration object to modify. container_config :class:`models.ContainerConfiguration` object to add to the :class:`models.Pool` configuration object. Returns ------- models.Pool The modified :class:`models.Pool` object.