Skip to content

Commit

Permalink
Loosen protobuf and numpy dependency (kubeflow#2673)
Browse files Browse the repository at this point in the history
* replace table logger with tabulate

Signed-off-by: Andrews Arokiam <andrews.arokiam@ideas2it.com>

* remove numpy<1.24.0 constraint

Signed-off-by: Andrews Arokiam <andrews.arokiam@ideas2it.com>

* loosen protobuf dependency

Signed-off-by: Andrews Arokiam <andrews.arokiam@ideas2it.com>

---------

Signed-off-by: Andrews Arokiam <andrews.arokiam@ideas2it.com>
  • Loading branch information
andyi2it committed Feb 4, 2023
1 parent de3980d commit 5991590
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
14 changes: 7 additions & 7 deletions python/kserve/kserve/api/watch.py
Expand Up @@ -13,9 +13,10 @@
# limitations under the License.

import time

from kubernetes import client
from kubernetes import watch as k8s_watch
from table_logger import TableLogger
from tabulate import tabulate

from ..constants import constants
from ..utils import utils
Expand All @@ -27,10 +28,8 @@ def isvc_watch(name=None, namespace=None, timeout_seconds=600, generation=0):
if namespace is None:
namespace = utils.get_default_target_namespace()

tbl = TableLogger(
columns='NAME,READY,PREV,LATEST,URL',
colwidth={'NAME': 20, 'READY': 10, 'PREV': 25, 'LATEST': 25, 'URL': 65},
border=False)
headers = ['NAME', 'READY', 'PREV', 'LATEST', 'URL']
table_fmt = 'plain'

stream = k8s_watch.Watch().stream(
client.CustomObjectsApi().list_namespaced_custom_object,
Expand Down Expand Up @@ -63,12 +62,13 @@ def isvc_watch(name=None, namespace=None, timeout_seconds=600, generation=0):
for condition in isvc['status'].get('conditions', {}):
if condition.get('type', '') == 'Ready':
status = condition.get('status', 'Unknown')
tbl(isvc_name, status, 100-traffic_percent, traffic_percent, url)
print(tabulate([[isvc_name, status, 100 - traffic_percent, traffic_percent, url]],
headers=headers, tablefmt=table_fmt))
if status == 'True':
break

else:
tbl(isvc_name, status, '', '', '')
print(tabulate([[isvc_name, status, '', '', '']], headers=headers, tablefmt=table_fmt))
# Sleep 2 to avoid status section is not generated within a very short time.
time.sleep(2)
continue
6 changes: 3 additions & 3 deletions python/kserve/requirements.txt
Expand Up @@ -7,8 +7,8 @@ argparse>=1.4.0
minio>=4.0.9,<=7.1.3
google-cloud-storage>=1.20.0
adal>=1.2.7
table_logger>=0.3.6
numpy>=1.21.5,<1.24.0
tabulate>=0.9.0
numpy>=1.21.5
azure-storage-blob==12.9.0
azure-storage-file-share==12.7.0
azure-identity>=1.8.0
Expand All @@ -19,7 +19,7 @@ psutil>=5.9.0
ray[serve]==2.0.0
grpcio>=1.34.0
tritonclient==2.18.0
protobuf~=3.19.0
protobuf>=3.19.0
prometheus-client>=0.13.1
orjson>=3.8.0
httpx>=0.23.0
Expand Down

0 comments on commit 5991590

Please sign in to comment.