Skip to content

Commit

Permalink
clusterip (#121)
Browse files Browse the repository at this point in the history
* clusterip

* fix pr test

Co-authored-by: Jun Min <mijun@microsoft.com>
  • Loading branch information
mjaow and Jun Min authored Apr 20, 2022
1 parent 8dae55b commit f61151c
Showing 1 changed file with 11 additions and 4 deletions.
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

0 comments on commit f61151c

Please sign in to comment.