@@ -260,7 +260,7 @@ def _send_inference_request_via_rest_protocol(
260
260
path_params = self ._get_istio_inference_path (deployment_instance )
261
261
# - add host header
262
262
headers ["host" ] = self ._get_inference_request_host_header (
263
- _client . _project_name ,
263
+ deployment_instance . project_namespace ,
264
264
deployment_instance .name ,
265
265
client .get_knative_domain (),
266
266
)
@@ -291,9 +291,7 @@ def _send_inference_request_via_grpc_protocol(
291
291
# the channel, which will be reused in all following calls on the same deployment object.
292
292
# The gRPC channel is freed when calling deployment.stop()
293
293
print ("Initializing gRPC channel..." )
294
- deployment_instance ._grpc_channel = self ._create_grpc_channel (
295
- deployment_instance .name
296
- )
294
+ deployment_instance ._grpc_channel = self ._create_grpc_channel (deployment_instance )
297
295
# build an infer request
298
296
request = InferRequest (
299
297
infer_inputs = data ,
@@ -308,11 +306,11 @@ def _send_inference_request_via_grpc_protocol(
308
306
# extract infer outputs
309
307
return infer_response .outputs
310
308
311
- def _create_grpc_channel (self , deployment_name : str ):
309
+ def _create_grpc_channel (self , deployment_instance ):
312
310
_client = client .istio .get_instance ()
313
311
service_hostname = self ._get_inference_request_host_header (
314
- _client . _project_name ,
315
- deployment_name ,
312
+ deployment_instance . project_namespace ,
313
+ deployment_instance . name ,
316
314
client .get_knative_domain (),
317
315
)
318
316
return _client ._create_grpc_channel (service_hostname )
@@ -405,11 +403,9 @@ def get_logs(self, deployment_instance, component, tail):
405
403
)
406
404
407
405
def _get_inference_request_host_header (
408
- self , project_name : str , deployment_name : str , domain : str
406
+ self , project_namespace : str , deployment_name : str , domain : str
409
407
):
410
- return "{}.{}.{}" .format (
411
- deployment_name , project_name .replace ("_" , "-" ), domain
412
- ).lower ()
408
+ return "{}.{}.{}" .format (deployment_name , project_namespace , domain ).lower ()
413
409
414
410
def _get_hopsworks_inference_path (self , project_id : int , deployment_instance ):
415
411
return [
0 commit comments