From 3e253a9b07c7949a2a95f03acb4a0a6ab4b785c9 Mon Sep 17 00:00:00 2001 From: Jonathan Innis Date: Thu, 27 May 2021 22:39:42 -0700 Subject: [PATCH] [k8s-extension] HotFix Broken calls to ServiceBus for Track2 models (#3439) * Create pull.yml * Update pull.yml * Update azure-pipelines.yml * Initial commit of k8s-extension * Update pipelines file * Update CODEOWNERS * Update private preview pipelines * Remove open service mesh from public release * Update pipeline files * Update public extension pipeline * Change condition variable * Add version to public preview/private preview * Update pipelines * Add different testing based on private branch * Add annotations to extension model * Update k8s-custom-pipelines.yml * Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13) * Update sdks with updated swagger spec * Update version and history rst * Reorder release history timeline * Fix ExtensionInstanceForCreate for import * remove py2 bdist support * Add custom table formatting * Remove unnecessary files * Fix style issues * Fix branch based on comments * Update identity piece manually * Don't handle defaults at the CLI level * Remove defaults from CLI client * Check null target namespace with namespace scope * Update style * Add cassandra operator and location to model * Stage Public Version of k8s-extension 0.2.0 for official release (#15) * Create pull.yml * Update pull.yml * Update azure-pipelines.yml * Initial commit of k8s-extension * Update pipelines file * Update CODEOWNERS * Update private preview pipelines * Remove open service mesh from public release * Update pipeline files * Update public extension pipeline * Change condition variable * Add version to public preview/private preview * Update pipelines * Add different testing based on private branch * Add annotations to extension model * Update k8s-custom-pipelines.yml * Update SDKs with Updated Swagger Spec for 2020-07-01-preview (#13) * Update sdks with updated swagger spec * Update version and history rst * Reorder release history timeline * Fix ExtensionInstanceForCreate for import * remove py2 bdist support * Add custom table formatting * Remove unnecessary files * Fix style issues * Fix branch based on comments * Update identity piece manually * Don't handle defaults at the CLI level * Remove defaults from CLI client * Check null target namespace with namespace scope * Update style * Add cassandra operator and location to model Co-authored-by: action@github.com * Remove custom pipelines file * Update extension description, remove private const * Update pipeline file * Disable refs docs * Update to include better create warning logs and remove update context (#20) * Update to include better create warning logs and remove update context * Remove help text for update * Fix spelling error * Update message * Fix k8s-extension conflict with private version * Fix style errors * Fix filename * add customization for microsoft.azureml.kubernetes (#23) * add customization for microsoft.azureml.kubernetes * Update release history Co-authored-by: Yue Yu Co-authored-by: jonathan-innis * Add E2E Testing from Separate branch into internal code (#26) * Add internal e2e testing * Change to testing folder * Inference CLI validation for Scoring FE (#24) * cli validation starter * added the call to the fe validation function * nodeport validation not required * test fix Co-authored-by: Jonathan Innis * legal warning added (#27) * Remove deprecated method logger.warn * Update k8s-custom-pipelines.yml for Azure Pipelines * Update k8s-custom-pipelines.yml for Azure Pipelines * Add Azure Defender to E2E testing (#28) * Add azure defender testing to e2e * Remove the debug flag * Add configuration testing * Fix pipeline failures * Make test script more intuitive * Remove parameter from testing * Fix wrong location for k8s config whl * Fix pip upgrade issue * Fix pip install upgrade issue * Fix pip install issue * delete resurce in testcase (#29) Co-authored-by: Yue Yu Co-authored-by: Jonathan Innis * Check Provider is Registered with Subscription Before Making Requests (#18) * Add check for KubernetesConfiguration * Disable pylint and rename * Update provider registration link * Update version * Remove extra blank line * Fix bug in import * only validate scoring fe when inference is enabled (#31) * only validate scoring fe when inference is enabled * Fix versioning Co-authored-by: Yue Yu Co-authored-by: jonathan-innis * Provider registration case insensitive * do not validate against scoring fe if inference is not enabled. (#33) * do not validate against scoring fe if inference is not enabled. * add inference enabled scenario * refine * increase sleeping time * fix Co-authored-by: Yue Yu Co-authored-by: Jonathan Innis * Add OSM as Public Preview Extension (#34) * Add OSM as public preview extension * Add osm testing * Add release train to tests * Fix failing osm test * Upgrade pip in integration testing * Remove ununsed import * Fix release train check in update * Parallelize E2E Testing (#36) * Add OSM as public preview extension * Add osm testing * Update test logic to parallelize * Fix test success checking * Parallelize extension testing * Better error checking logic * Fix azureml deletion * Fix private build (#40) * change amlk8s to amlarc (#42) Co-authored-by: Yue Yu * Servicebus client model changes (#44) * Servicebus client model changes * Fix testing script * Update history file and pipeline * Update min cli core version for track 2 updates * remove unneeded files for staging Co-authored-by: action@github.com Co-authored-by: yuyue9284 <15863499+yuyue9284@users.noreply.github.com> Co-authored-by: Yue Yu Co-authored-by: Lia Kazakova <58274127+liakaz@users.noreply.github.com> --- src/k8s-extension/HISTORY.rst | 6 ++++++ src/k8s-extension/azext_k8s_extension/_validators.py | 2 +- src/k8s-extension/azext_k8s_extension/azext_metadata.json | 2 +- src/k8s-extension/azext_k8s_extension/custom.py | 6 ++---- .../partner_extensions/AzureMLKubernetes.py | 8 ++++---- src/k8s-extension/setup.py | 2 +- 6 files changed, 15 insertions(+), 11 deletions(-) diff --git a/src/k8s-extension/HISTORY.rst b/src/k8s-extension/HISTORY.rst index d0e19128855..2fe8a591fb9 100644 --- a/src/k8s-extension/HISTORY.rst +++ b/src/k8s-extension/HISTORY.rst @@ -3,6 +3,12 @@ Release History =============== +0.4.2 +++++++++++++++++++ + +* Hotfix servicebus namespace creation for Track 2 changes +* Change resource tag from 'amlk8s' to 'Azure Arc-enabled ML' in microsoft.azureml.kubernetes + 0.4.1 ++++++++++++++++++ diff --git a/src/k8s-extension/azext_k8s_extension/_validators.py b/src/k8s-extension/azext_k8s_extension/_validators.py index 9941c4a117b..31078a4ddbb 100644 --- a/src/k8s-extension/azext_k8s_extension/_validators.py +++ b/src/k8s-extension/azext_k8s_extension/_validators.py @@ -4,7 +4,7 @@ # -------------------------------------------------------------------------------------------- from knack.log import get_logger -from azext_k8s_extension._client_factory import _resource_providers_client +from ._client_factory import _resource_providers_client from . import consts diff --git a/src/k8s-extension/azext_k8s_extension/azext_metadata.json b/src/k8s-extension/azext_k8s_extension/azext_metadata.json index cf7b8927a07..f5fcee1c14a 100644 --- a/src/k8s-extension/azext_k8s_extension/azext_metadata.json +++ b/src/k8s-extension/azext_k8s_extension/azext_metadata.json @@ -1,4 +1,4 @@ { "azext.isPreview": true, - "azext.minCliCoreVersion": "2.15.0" + "azext.minCliCoreVersion": "2.24.0" } diff --git a/src/k8s-extension/azext_k8s_extension/custom.py b/src/k8s-extension/azext_k8s_extension/custom.py index f2fae3f54d4..d07c0015792 100644 --- a/src/k8s-extension/azext_k8s_extension/custom.py +++ b/src/k8s-extension/azext_k8s_extension/custom.py @@ -13,10 +13,8 @@ from azure.cli.core.azclierror import ResourceNotFoundError, MutuallyExclusiveArgumentError, \ InvalidArgumentValueError, CommandNotFoundError, RequiredArgumentMissingError from azure.cli.core.commands.client_factory import get_subscription_id -from azext_k8s_extension.vendored_sdks.models import ConfigurationIdentity -from azext_k8s_extension.vendored_sdks.models import ErrorResponseException -from azext_k8s_extension.vendored_sdks.models import Scope -from azext_k8s_extension._validators import validate_cc_registration +from .vendored_sdks.models import ConfigurationIdentity, ErrorResponseException, Scope +from ._validators import validate_cc_registration from .partner_extensions.ContainerInsights import ContainerInsights from .partner_extensions.AzureDefender import AzureDefender diff --git a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py index d907e7d3c63..3a2544a4e3b 100644 --- a/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py +++ b/src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py @@ -30,7 +30,7 @@ logger = get_logger(__name__) -resource_tag = {'created_by': 'amlk8s-extension'} +resource_tag = {'created_by': 'Azure Arc-enabled ML'} class AzureMLKubernetes(PartnerExtensionModel): @@ -271,10 +271,10 @@ def _lock_resource(cmd, lock_scope, lock_level='CanNotDelete'): lock_client: azure.mgmt.resource.locks.ManagementLockClient = get_mgmt_service_client( cmd.cli_ctx, azure.mgmt.resource.locks.ManagementLockClient) # put lock on relay resource - lock_object = ManagementLockObject(level=lock_level, notes='locked by amlk8s.') + lock_object = ManagementLockObject(level=lock_level, notes='locked by amlarc.') try: lock_client.management_locks.create_or_update_by_scope( - scope=lock_scope, lock_name='amlk8s-resource-lock', parameters=lock_object) + scope=lock_scope, lock_name='amlarc-resource-lock', parameters=lock_object) except: # try to lock the resource if user has the owner privilege pass @@ -337,7 +337,7 @@ def _get_service_bus_connection_string(cmd, subscription_id, resource_group_name location=cluster_location, sku=service_bus_sku, tags=resource_tag) - async_poller = service_bus_client.namespaces.create_or_update( + async_poller = service_bus_client.namespaces.begin_create_or_update( resource_group_name, service_bus_namespace_name, service_bus_namespace) while True: async_poller.result(15) diff --git a/src/k8s-extension/setup.py b/src/k8s-extension/setup.py index 4cc69f2cbef..908ecc53009 100644 --- a/src/k8s-extension/setup.py +++ b/src/k8s-extension/setup.py @@ -32,7 +32,7 @@ # TODO: Add any additional SDK dependencies here DEPENDENCIES = [] -VERSION = "0.4.1" +VERSION = "0.4.2" with open('README.rst', 'r', encoding='utf-8') as f: README = f.read()