Skip to content

Commit

Permalink
Fix hsml client so that it is possible to do hsml.connection(...)
Browse files Browse the repository at this point in the history
  • Loading branch information
aversey committed Jul 25, 2024
1 parent d74018e commit 25d08e4
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 5 deletions.
21 changes: 21 additions & 0 deletions python/hsml/client/istio/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,24 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#

from hopsworks_common.client.istio import (
base,
external,
get_instance,
grpc,
hopsworks,
init,
utils,
)


__all__ = [
base,
external,
get_instance,
grpc,
hopsworks,
init,
utils,
]
10 changes: 5 additions & 5 deletions python/hsml/core/model_serving_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def load_default_configuration(self):
client.set_kserve_installed(is_kserve_installed)

# istio client
self._isito_init_if_available()
self._istio_init_if_available()

# resource limits
max_resources = self._serving_api.get_resource_limits()
Expand All @@ -77,7 +77,7 @@ def _istio_init_if_available(self):
if client.is_kserve_installed():
# check existing istio client
try:
if client.istio_get_instance() is not None:
if client.istio.get_instance() is not None:
return # istio client already set
except Exception:
pass
Expand All @@ -90,7 +90,7 @@ def _istio_init_if_available(self):
inference_endpoints, INFERENCE_ENDPOINTS.ENDPOINT_TYPE_NODE
)
if endpoint is not None:
client.istio_init(
client.istio.init(
endpoint.get_any_host(),
endpoint.get_port(INFERENCE_ENDPOINTS.PORT_NAME_HTTP).number,
)
Expand All @@ -107,7 +107,7 @@ def _istio_init_if_available(self):
if endpoint is not None:
# if load balancer (external ip) available
_client = client.get_instance()
client.istio_init(
client.istio.init(
endpoint.get_any_host(),
endpoint.get_port(INFERENCE_ENDPOINTS.PORT_NAME_HTTP).number,
_client._project_name,
Expand All @@ -125,7 +125,7 @@ def _istio_init_if_available(self):
port = endpoint.get_port(INFERENCE_ENDPOINTS.PORT_NAME_HTTP).number
if self._is_host_port_open(host, port):
# and it is open
client.istio_init(
client.istio.init(
host,
port,
_client._project_name,
Expand Down

0 comments on commit 25d08e4

Please sign in to comment.