Skip to content
This repository has been archived by the owner on Apr 26, 2024. It is now read-only.

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/checkout-4
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisguidry authored Oct 24, 2023
2 parents 50a6f50 + bd8aa49 commit 55bf3e9
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 16 deletions.
21 changes: 21 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 5 additions & 5 deletions prefect_azure/container_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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."):
Expand Down Expand Up @@ -235,7 +235,7 @@ class AzureContainerInstanceJob(Infrastructure):
)
image_registry: Optional[
Union[
prefect.infrastructure.docker.DockerRegistry,
prefect.infrastructure.container.DockerRegistry,
ACRManagedIdentity,
]
] = Field(
Expand Down Expand Up @@ -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,
]
Expand All @@ -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(
Expand Down
3 changes: 2 additions & 1 deletion prefect_azure/credentials.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."
Expand Down
2 changes: 1 addition & 1 deletion prefect_azure/deployments/steps.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
10 changes: 5 additions & 5 deletions prefect_azure/workers/container_instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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,
],
Expand All @@ -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"
Expand Down Expand Up @@ -431,7 +431,7 @@ class AzureContainerVariables(BaseVariables):
)
image_registry: Optional[
Union[
prefect.infrastructure.docker.DockerRegistry,
prefect.infrastructure.container.DockerRegistry,
ACRManagedIdentity,
]
] = Field(
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_aci_infrastructure.py
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions tests/test_aci_worker.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."):
Expand Down

0 comments on commit 55bf3e9

Please sign in to comment.