diff --git a/CHANGELOG.md b/CHANGELOG.md index 53625b2..c2aafa8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,27 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Security +## 0.3.1 + +Released October 10th, 2023. + +### Changed + +- Updated imports of deprecated Prefect Docker modules, bumping the minimum required Prefect version to 2.10.11 - [#118](https://github.com/PrefectHQ/prefect-azure/pull/118) + +### Fixed + +- Fixed errors when using deployment steps with `account_url` - [#121](https://github.com/PrefectHQ/prefect-azure/pull/121) + +## 0.3.0 + +Released October 5th, 2023. + +### Changed + +- Added conditional import to support operating with pydantic>2 installed - [#119](https://github.com/PrefectHQ/prefect-azure/pull/119) +- Updated subscription ID description to contain the expected format - [#120](https://github.com/PrefectHQ/prefect-azure/pull/120) + ## 0.2.12 Released August 21st, 2023. diff --git a/prefect_azure/container_instance.py b/prefect_azure/container_instance.py index 315255f..9c06f8d 100644 --- a/prefect_azure/container_instance.py +++ b/prefect_azure/container_instance.py @@ -74,7 +74,7 @@ import anyio import dateutil.parser -import prefect.infrastructure.docker +import prefect.infrastructure.container from anyio.abc import TaskStatus from azure.core.exceptions import HttpResponseError, ResourceNotFoundError from azure.core.polling import LROPoller @@ -95,10 +95,10 @@ ResourceRequirements, UserAssignedIdentities, ) -from prefect.docker import get_prefect_image_name from prefect.exceptions import InfrastructureNotAvailable, InfrastructureNotFound from prefect.infrastructure.base import Infrastructure, InfrastructureResult from prefect.utilities.asyncutils import run_sync_in_worker_thread, sync_compatible +from prefect.utilities.dockerutils import get_prefect_image_name from pydantic import VERSION as PYDANTIC_VERSION if PYDANTIC_VERSION.startswith("2."): @@ -235,7 +235,7 @@ class AzureContainerInstanceJob(Infrastructure): ) image_registry: Optional[ Union[ - prefect.infrastructure.docker.DockerRegistry, + prefect.infrastructure.container.DockerRegistry, ACRManagedIdentity, ] ] = Field( @@ -593,7 +593,7 @@ def _configure_container_group(self, container: Container) -> ContainerGroup: @staticmethod def _create_image_registry_credentials( image_registry: Union[ - prefect.infrastructure.docker.DockerRegistry, + prefect.infrastructure.container.DockerRegistry, ACRManagedIdentity, None, ] @@ -611,7 +611,7 @@ def _create_image_registry_credentials( input doesn't match any of the expected types. """ if image_registry and isinstance( - image_registry, prefect.infrastructure.docker.DockerRegistry + image_registry, prefect.infrastructure.container.DockerRegistry ): return [ ImageRegistryCredential( diff --git a/prefect_azure/credentials.py b/prefect_azure/credentials.py index 281439d..7f2c8ed 100644 --- a/prefect_azure/credentials.py +++ b/prefect_azure/credentials.py @@ -414,7 +414,8 @@ class AzureMlCredentials(Block): default=..., description="The service principal password/key." ) subscription_id: str = Field( - default=..., description="The Azure subscription ID containing the workspace." + default=..., + description="The Azure subscription ID containing the workspace, in format: '00000000-0000-0000-0000-000000000000'.", # noqa ) resource_group: str = Field( default=..., description="The resource group containing the workspace." diff --git a/prefect_azure/deployments/steps.py b/prefect_azure/deployments/steps.py index a33828c..697e86e 100644 --- a/prefect_azure/deployments/steps.py +++ b/prefect_azure/deployments/steps.py @@ -33,7 +33,7 @@ from pathlib import Path, PurePosixPath from typing import Dict, Optional -from azure.identity.aio import DefaultAzureCredential +from azure.identity import DefaultAzureCredential from azure.storage.blob import ContainerClient from prefect.utilities.filesystem import filter_files, relative_path_to_current_platform diff --git a/prefect_azure/workers/container_instance.py b/prefect_azure/workers/container_instance.py index 12fb210..5f569e0 100644 --- a/prefect_azure/workers/container_instance.py +++ b/prefect_azure/workers/container_instance.py @@ -90,11 +90,11 @@ ) from prefect import get_client from prefect.client.schemas import FlowRun -from prefect.docker import get_prefect_image_name from prefect.exceptions import InfrastructureNotAvailable, InfrastructureNotFound from prefect.server.schemas.core import Flow from prefect.server.schemas.responses import DeploymentResponse from prefect.utilities.asyncutils import run_sync_in_worker_thread +from prefect.utilities.dockerutils import get_prefect_image_name from prefect.workers.base import ( BaseJobConfiguration, BaseVariables, @@ -215,7 +215,7 @@ class AzureContainerJobConfiguration(BaseJobConfiguration): entrypoint: Optional[str] = Field(default=DEFAULT_CONTAINER_ENTRYPOINT) image_registry: Optional[ Union[ - prefect.infrastructure.docker.DockerRegistry, + prefect.infrastructure.container.DockerRegistry, ACRManagedIdentity, ] ] = Field(default=None) @@ -296,7 +296,7 @@ def _add_image(self): def _add_image_registry_credentials( self, image_registry: Union[ - prefect.infrastructure.docker.DockerRegistry, + prefect.infrastructure.container.DockerRegistry, ACRManagedIdentity, None, ], @@ -309,7 +309,7 @@ def _add_image_registry_credentials( ACRManagedIdentity object. """ if image_registry and isinstance( - image_registry, prefect.infrastructure.docker.DockerRegistry + image_registry, prefect.infrastructure.container.DockerRegistry ): self.arm_template["resources"][0]["properties"][ "imageRegistryCredentials" @@ -431,7 +431,7 @@ class AzureContainerVariables(BaseVariables): ) image_registry: Optional[ Union[ - prefect.infrastructure.docker.DockerRegistry, + prefect.infrastructure.container.DockerRegistry, ACRManagedIdentity, ] ] = Field( diff --git a/requirements.txt b/requirements.txt index a0f0240..8b66acc 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -prefect>=2.10.5 +prefect>=2.10.11 azure_mgmt_containerinstance>=10.0 azure_identity>=1.10 azure-mgmt-resource>=21.2 diff --git a/tests/test_aci_infrastructure.py b/tests/test_aci_infrastructure.py index 4c791ae..378edcd 100644 --- a/tests/test_aci_infrastructure.py +++ b/tests/test_aci_infrastructure.py @@ -15,7 +15,7 @@ ) from azure.mgmt.resource import ResourceManagementClient from prefect.exceptions import InfrastructureNotAvailable, InfrastructureNotFound -from prefect.infrastructure.docker import DockerRegistry +from prefect.infrastructure.container import DockerRegistry from prefect.settings import get_current_settings from pydantic import VERSION as PYDANTIC_VERSION diff --git a/tests/test_aci_worker.py b/tests/test_aci_worker.py index d9dbdf9..106fb7a 100644 --- a/tests/test_aci_worker.py +++ b/tests/test_aci_worker.py @@ -10,12 +10,12 @@ from azure.identity import ClientSecretCredential from azure.mgmt.resource import ResourceManagementClient from prefect.client.schemas import FlowRun -from prefect.docker import get_prefect_image_name from prefect.exceptions import InfrastructureNotFound -from prefect.infrastructure.docker import DockerRegistry +from prefect.infrastructure.container import DockerRegistry from prefect.server.schemas.core import Flow from prefect.settings import get_current_settings from prefect.testing.utilities import AsyncMock +from prefect.utilities.dockerutils import get_prefect_image_name from pydantic import VERSION as PYDANTIC_VERSION if PYDANTIC_VERSION.startswith("2."):