From 88928c421485772d23ff5d8cc13f015eb4d96516 Mon Sep 17 00:00:00 2001 From: Akihiro Nitta Date: Tue, 20 Dec 2022 19:57:37 +0900 Subject: [PATCH] Fix endpoint information tab not showing up in AutoScaler UI (#16128) * . * why * Revert "why" This reverts commit 375d3e85f442226c6990ecf0e812fff94bed2de9. * tried api access with fixed values * Revert "tried api access with fixed values" This reverts commit f1720f6b1ad64b0734b5a3ea7b010124cf39b5b7. * Fix typo :tada: * update chglog * revert removing lines in chlog * update chglog Co-authored-by: Akihiro Nitta --- src/lightning_app/CHANGELOG.md | 3 +++ src/lightning_app/components/serve/auto_scaler.py | 6 +++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/lightning_app/CHANGELOG.md b/src/lightning_app/CHANGELOG.md index bd28c4ca55d7f..73a6ee75db065 100644 --- a/src/lightning_app/CHANGELOG.md +++ b/src/lightning_app/CHANGELOG.md @@ -63,6 +63,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Fixed Http Queue sleeping for 1 sec by default if no delta were found ([#16114](https://github.com/Lightning-AI/lightning/pull/16114)) +- Fixed the endpoint info tab not showing up in `AutoScaler` UI ([#16128](https://github.com/Lightning-AI/lightning/pull/16128)) + + ## [1.8.5] - 2022-12-15 ### Added diff --git a/src/lightning_app/components/serve/auto_scaler.py b/src/lightning_app/components/serve/auto_scaler.py index a8af51ca79913..0c2b3224983c8 100644 --- a/src/lightning_app/components/serve/auto_scaler.py +++ b/src/lightning_app/components/serve/auto_scaler.py @@ -469,8 +469,8 @@ def _get_sample_dict_from_datatype(datatype: Any) -> dict: # not a pydantic model raise TypeError(f"datatype must be a pydantic model, for the UI to be generated. but got {datatype}") - if hasattr(datatype, "_get_sample_data"): - return datatype._get_sample_data() + if hasattr(datatype, "get_sample_data"): + return datatype.get_sample_data() datatype_props = datatype.schema()["properties"] out: Dict[str, Any] = {} @@ -774,7 +774,7 @@ def autoscale(self) -> None: def configure_layout(self): tabs = [ - {"name": "Endpoint Info", "content": f"{self.load_balancer}/endpoint-info"}, + {"name": "Endpoint Info", "content": f"{self.load_balancer.url}/endpoint-info"}, {"name": "Swagger", "content": self.load_balancer.url}, ] return tabs