Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

clusterip #121

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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