Skip to content

Commit

Permalink
[k8s-extension] Update extension CLI to v1.2.1 (#4773)
Browse files Browse the repository at this point in the history
  • Loading branch information
jonathan-innis authored May 7, 2022
1 parent 5b3b5bb commit d76b9ce
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 12 deletions.
5 changes: 5 additions & 0 deletions src/k8s-extension/HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
Release History
===============

1.2.1
++++++++++++++++++
* Provide no default values for Patch of Extension
* microsoft.azureml.kubernetes: clusterip

1.2.0
++++++++++++++++++
* microsoft.azureml.kubernetes: Update AzureMLKubernetes install parameters on inferenceRouterServiceType and internalLoadBalancerProvider
Expand Down
12 changes: 7 additions & 5 deletions src/k8s-extension/azext_k8s_extension/custom.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,9 +226,9 @@ def update_k8s_extension(
cluster_name,
name,
cluster_type,
auto_upgrade_minor_version="",
release_train="",
version="",
auto_upgrade_minor_version=None,
release_train=None,
version=None,
configuration_settings=None,
configuration_protected_settings=None,
configuration_settings_file=None,
Expand Down Expand Up @@ -261,13 +261,14 @@ def update_k8s_extension(
)
extension_type_lower = extension.extension_type.lower()

config_settings = {}
config_protected_settings = {}
config_settings = None
config_protected_settings = None
# Get Configuration Settings from file
if configuration_settings_file is not None:
config_settings = read_config_settings_file(configuration_settings_file)

if configuration_settings is not None:
config_settings = {}
for dicts in configuration_settings:
for key, value in dicts.items():
config_settings[key] = value
Expand All @@ -279,6 +280,7 @@ def update_k8s_extension(
)

if configuration_protected_settings is not None:
config_protected_settings = {}
for dicts in configuration_protected_settings:
for key, value in dicts.items():
config_protected_settings[key] = value
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -334,9 +334,9 @@ def __normalize_config(self, configuration_settings, configuration_protected_set
inferenceRouterServiceType = _get_value_from_config_protected_config(
self.inferenceRouterServiceType, configuration_settings, configuration_protected_settings)
if inferenceRouterServiceType:
if inferenceRouterServiceType.lower() != 'nodeport' and inferenceRouterServiceType.lower() != 'loadbalancer':
if not _is_valid_service_type(inferenceRouterServiceType):
raise InvalidArgumentValueError(
"inferenceRouterServiceType only supports nodePort or loadBalancer."
"inferenceRouterServiceType only supports NodePort or LoadBalancer or ClusterIP."
"Check https://aka.ms/arcmltsg for more information.")

feIsNodePort = str(inferenceRouterServiceType).lower() == 'nodeport'
Expand Down Expand Up @@ -424,10 +424,10 @@ def __validate_scoring_fe_settings(self, configuration_settings, configuration_p

inferenceRouterServiceType = _get_value_from_config_protected_config(
self.inferenceRouterServiceType, configuration_settings, configuration_protected_settings)
if not inferenceRouterServiceType or (inferenceRouterServiceType.lower() != 'nodeport' and inferenceRouterServiceType.lower() != 'loadbalancer'):
if not _is_valid_service_type(inferenceRouterServiceType):
raise InvalidArgumentValueError(
"To use inference, "
"please specify inferenceRouterServiceType=nodePort or inferenceRouterServiceType=loadBalancer in --configuration-settings and also set internalLoadBalancerProvider=azure if your aks only supports internal load balancer."
"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."
"Check https://aka.ms/arcmltsg for more information.")

feIsNodePort = str(inferenceRouterServiceType).lower() == 'nodeport'
Expand Down Expand Up @@ -690,3 +690,10 @@ def _check_nodeselector_existed(configuration_settings, configuration_protected_
if "nodeSelector" in key:
return True
return False


def _is_valid_service_type(service_type):
if service_type:
return service_type.lower() == 'nodeport' or service_type.lower() == 'loadbalancer' or service_type.lower() == 'clusterip'
else:
return False
Original file line number Diff line number Diff line change
Expand Up @@ -1714,8 +1714,8 @@ class PatchExtension(msrest.serialization.Model):
def __init__(
self,
*,
auto_upgrade_minor_version: Optional[bool] = True,
release_train: Optional[str] = "Stable",
auto_upgrade_minor_version: Optional[bool] = None,
release_train: Optional[str] = None,
version: Optional[str] = None,
configuration_settings: Optional[Dict[str, str]] = None,
configuration_protected_settings: Optional[Dict[str, str]] = None,
Expand Down
2 changes: 1 addition & 1 deletion src/k8s-extension/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
# TODO: Add any additional SDK dependencies here
DEPENDENCIES = []

VERSION = "1.2.0"
VERSION = "1.2.1"

with open("README.rst", "r", encoding="utf-8") as f:
README = f.read()
Expand Down

0 comments on commit d76b9ce

Please sign in to comment.