Skip to content
This repository was archived by the owner on May 13, 2025. It is now read-only.

Commit 19c1598

Browse files
zetiaatgithubUbuntubavneetsingh16
authored
Always show TSG link for AzureMLKubernetes extension at the head (#161)
* Always show TSG link for AzureMLKubernetes extension at the head * refine tsg message * refine tsg message * move to 1.3.1 release * remove space Co-authored-by: Ubuntu <zetia@DevBox-zetia.1jltvvkrfgyuhl3llhmbyldkog.bx.internal.cloudapp.net> Co-authored-by: Bavneet Singh <[email protected]>
1 parent 486979c commit 19c1598

File tree

2 files changed

+25
-11
lines changed

2 files changed

+25
-11
lines changed

src/k8s-extension/HISTORY.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,10 @@
33
Release History
44
===============
55

6+
1.3.1
7+
++++++++++++++++++
8+
* microsoft.azureml.kubernetes: Always show TSG link for AzureMLKubernetes extension at the head.
9+
610
1.3.0
711
++++++++++++++++++
812
* Add support for provisionedClusters

src/k8s-extension/azext_k8s_extension/partner_extensions/AzureMLKubernetes.py

Lines changed: 21 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,9 @@
4646
# pylint: disable=too-many-instance-attributes
4747
class AzureMLKubernetes(DefaultExtension):
4848
def __init__(self):
49+
# tsg link
50+
self.TSG_LINK = 'https://aka.ms/arcmltsg'
51+
4952
# constants for configuration settings.
5053
self.DEFAULT_RELEASE_NAMESPACE = 'azureml'
5154
self.RELAY_CONNECTION_STRING_KEY = 'relayserver.relayConnectionString'
@@ -112,10 +115,13 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
112115
extension_type, scope, auto_upgrade_minor_version, release_train, version, target_namespace,
113116
release_namespace, configuration_settings, configuration_protected_settings,
114117
configuration_settings_file, configuration_protected_settings_file):
118+
119+
logger.warning("Troubleshooting: {}".format(self.TSG_LINK))
120+
115121
if scope == 'namespace':
116122
raise InvalidArgumentValueError("Invalid scope '{}'. This extension can't be installed "
117123
"only at 'cluster' scope. "
118-
"Check https://aka.ms/arcmltsg for more information.".format(scope))
124+
"Check {} for more information.".format(scope, self.TSG_LINK))
119125
# set release name explicitly to azureml
120126
release_namespace = self.DEFAULT_RELEASE_NAMESPACE
121127
scope_cluster = ScopeCluster(release_namespace=release_namespace)
@@ -217,10 +223,14 @@ def Create(self, cmd, client, resource_group_name, cluster_name, name, cluster_t
217223
return extension, name, create_identity
218224

219225
def Delete(self, cmd, client, resource_group_name, cluster_name, name, cluster_type, cluster_rp, yes):
226+
logger.warning("Troubleshooting: {}".format(self.TSG_LINK))
220227
user_confirmation_factory(cmd, yes)
221228

222229
def Update(self, cmd, resource_group_name, cluster_name, auto_upgrade_minor_version, release_train, version, configuration_settings,
223230
configuration_protected_settings, original_extension, yes=False):
231+
232+
logger.warning("Troubleshooting: {}".format(self.TSG_LINK))
233+
224234
input_configuration_settings = copy.deepcopy(configuration_settings)
225235
input_configuration_protected_settings = copy.deepcopy(configuration_protected_settings)
226236
# configuration_settings and configuration_protected_settings can be none, so need to set them to empty dict
@@ -335,9 +345,9 @@ def Update(self, cmd, resource_group_name, cluster_name, auto_upgrade_minor_vers
335345
except azure.mgmt.relay.models.ErrorResponseException as ex:
336346
if ex.response.status_code == 404:
337347
raise ResourceNotFoundError("Relay server not found. "
338-
"Check https://aka.ms/arcmltsg for more information.") from ex
348+
"Check {} for more information.".format(self.TSG_LINK)) from ex
339349
raise AzureResponseError("Failed to get relay connection string."
340-
"Check https://aka.ms/arcmltsg for more information.") from ex
350+
"Check {} for more information.".format(self.TSG_LINK)) from ex
341351

342352
if original_extension_config_settings.get(self.SERVICE_BUS_ENABLED).lower() != 'false' \
343353
and self.SERVICE_BUS_CONNECTION_STRING not in configuration_protected_settings:
@@ -349,9 +359,9 @@ def Update(self, cmd, resource_group_name, cluster_name, auto_upgrade_minor_vers
349359
except azure.core.exceptions.HttpResponseError as ex:
350360
if ex.response.status_code == 404:
351361
raise ResourceNotFoundError("Service bus not found."
352-
"Check https://aka.ms/arcmltsg for more information.") from ex
362+
"Check {} for more information.".format(self.TSG_LINK)) from ex
353363
raise AzureResponseError("Failed to get service bus connection string."
354-
"Check https://aka.ms/arcmltsg for more information.") from ex
364+
"Check {} for more information.".format(self.TSG_LINK)) from ex
355365

356366
configuration_protected_settings = _dereference(self.reference_mapping, configuration_protected_settings)
357367

@@ -384,7 +394,7 @@ def __normalize_config(self, configuration_settings, configuration_protected_set
384394
if not _is_valid_service_type(inferenceRouterServiceType):
385395
raise InvalidArgumentValueError(
386396
"inferenceRouterServiceType only supports NodePort or LoadBalancer or ClusterIP."
387-
"Check https://aka.ms/arcmltsg for more information.")
397+
"Check {} for more information.".format(self.TSG_LINK))
388398

389399
feIsNodePort = str(inferenceRouterServiceType).lower() == 'nodeport'
390400
configuration_settings['scoringFe.serviceType.nodePort'] = feIsNodePort
@@ -407,7 +417,7 @@ def __validate_config(self, configuration_settings, configuration_protected_sett
407417
logger.warning(
408418
'Duplicate keys found in both configuration settings and configuration protected setttings: %s', key)
409419
raise InvalidArgumentValueError("Duplicate keys found."
410-
"Check https://aka.ms/arcmltsg for more information.")
420+
"Check {} for more information.".format(self.TSG_LINK))
411421

412422
enable_training = _get_value_from_config_protected_config(
413423
self.ENABLE_TRAINING, configuration_settings, configuration_protected_settings)
@@ -425,7 +435,7 @@ def __validate_config(self, configuration_settings, configuration_protected_sett
425435
"To create Microsoft.AzureML.Kubernetes extension, either "
426436
"enable Machine Learning training or inference by specifying "
427437
f"'--configuration-settings {self.ENABLE_TRAINING}=true' or '--configuration-settings {self.ENABLE_INFERENCE}=true'."
428-
"Please check https://aka.ms/arcmltsg for more information.")
438+
"Please check {} for more information.".format(self.TSG_LINK))
429439

430440
configuration_settings[self.ENABLE_TRAINING] = configuration_settings.get(self.ENABLE_TRAINING, enable_training)
431441
configuration_settings[self.ENABLE_INFERENCE] = configuration_settings.get(
@@ -461,15 +471,15 @@ def __validate_scoring_fe_settings(self, configuration_settings, configuration_p
461471
if not sslCname:
462472
raise InvalidArgumentValueError(
463473
"To enable HTTPs endpoint, "
464-
"please specify sslCname parameter in --configuration-settings. Check https://aka.ms/arcmltsg for more information.")
474+
"please specify sslCname parameter in --configuration-settings. Check {} for more information.".format(self.TSG_LINK))
465475

466476
inferenceRouterServiceType = _get_value_from_config_protected_config(
467477
self.inferenceRouterServiceType, configuration_settings, configuration_protected_settings)
468478
if not _is_valid_service_type(inferenceRouterServiceType):
469479
raise InvalidArgumentValueError(
470480
"To use inference, "
471481
"please specify inferenceRouterServiceType=ClusterIP or inferenceRouterServiceType=NodePort or inferenceRouterServiceType=LoadBalancer in --configuration-settings and also set internalLoadBalancerProvider=azure if your aks only supports internal load balancer."
472-
"Check https://aka.ms/arcmltsg for more information.")
482+
"Check {} for more information.".format(self.TSG_LINK))
473483

474484
feIsNodePort = str(inferenceRouterServiceType).lower() == 'nodeport'
475485
internalLoadBalancerProvider = _get_value_from_config_protected_config(
@@ -479,7 +489,7 @@ def __validate_scoring_fe_settings(self, configuration_settings, configuration_p
479489
if feIsNodePort and feIsInternalLoadBalancer:
480490
raise MutuallyExclusiveArgumentError(
481491
"When using nodePort as inferenceRouterServiceType, no need to specify internalLoadBalancerProvider."
482-
"Check https://aka.ms/arcmltsg for more information.")
492+
"Check {} for more information.".format(self.TSG_LINK))
483493
if feIsNodePort:
484494
configuration_settings['scoringFe.serviceType.nodePort'] = feIsNodePort
485495
elif feIsInternalLoadBalancer:

0 commit comments

Comments
 (0)