prefect.infrastructure.provisioners.container_instance
This module defines the ContainerInstancePushProvisioner class, which is responsible for provisioning
infrastructure using Azure Container Instances for Prefect work pools.
The ContainerInstancePushProvisioner class provides methods for provisioning infrastructure and
interacting with Azure Container Instances.
Classes:
AzureCLI: A class to handle Azure CLI commands.
ContainerInstancePushProvisioner: A class for provisioning infrastructure using Azure Container Instances.
Classes
AzureCLI
A class for executing Azure CLI commands and handling their output.
Args:
console
: A Rich console object for displaying messages.
run_command
command
: The Azure CLI command to execute.success_message
: Message to print on success.failure_message
: Message to print on failure.ignore_if_exists
: Whether to ignore errors if a resource already exists.return_json
: Whether to return the output as JSON.
- A tuple with two elements:
- str: Status, either ‘created’, ‘exists’, or ‘error’.
- str or dict or None: The command output or None if an error occurs (depends on return_json).
subprocess.CalledProcessError
: If the command execution fails.json.JSONDecodeError
: If output cannot be decoded as JSON when return_json is True.
ContainerInstancePushProvisioner
A class responsible for provisioning Azure resources and setting up a push work pool.
Methods:
console
console
provision
work_pool_name
: The name of the work pool.base_job_template
: The base template for job creation.client
: An instance of PrefectClient. If None, it will be injected.
- Dict[str, Any]: The updated job template with necessary references and configurations.
RuntimeError
: If client injection fails or the Azure CLI command execution fails.
set_location
RuntimeError
: If unable to execute the Azure CLI command.