Skip to content

Commit b7dcd53

Browse files
committed
feat: Phase 1 - Added different data modes to UI server
Signed-off-by: ntkathole <nikhilkathole2683@gmail.com>
1 parent de67bdd commit b7dcd53

4 files changed

Lines changed: 508 additions & 63 deletions

File tree

sdk/python/feast/cli/ui.py

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
from feast.repo_operations import create_feature_store, registry_dump
44

5+
VALID_MODES = ("proto", "rest", "rest-external")
6+
57

68
@click.command()
79
@click.option(
@@ -52,6 +54,25 @@
5254
show_default=False,
5355
help="path to TLS(SSL) certificate public key. You need to pass --key arg as well to start server in TLS mode",
5456
)
57+
@click.option(
58+
"--mode",
59+
"-m",
60+
type=click.Choice(VALID_MODES, case_sensitive=False),
61+
default="proto",
62+
show_default=True,
63+
help=(
64+
"Data serving mode for the UI. "
65+
"'proto' serves the registry as a protobuf blob (current default). "
66+
"'rest' mounts the REST registry API alongside the UI. "
67+
"'rest-external' proxies to an external REST registry API."
68+
),
69+
)
70+
@click.option(
71+
"--rest-api-url",
72+
type=click.STRING,
73+
default="",
74+
help="Base URL of an external REST registry API (required when --mode=rest-external). Example: http://registry-host:6570/api/v1",
75+
)
5576
@click.pass_context
5677
def ui(
5778
ctx: click.Context,
@@ -61,6 +82,8 @@ def ui(
6182
root_path: str = "",
6283
tls_key_path: str = "",
6384
tls_cert_path: str = "",
85+
mode: str = "proto",
86+
rest_api_url: str = "",
6487
):
6588
"""
6689
Shows the Feast UI over the current directory
@@ -69,8 +92,11 @@ def ui(
6992
raise click.BadParameter(
7093
"Please configure --key and --cert args to start the feature server in SSL mode."
7194
)
95+
if mode == "rest-external" and not rest_api_url:
96+
raise click.BadParameter(
97+
"--rest-api-url is required when using --mode=rest-external."
98+
)
7299
store = create_feature_store(ctx)
73-
# Pass in the registry_dump method to get around a circular dependency
74100
store.serve_ui(
75101
host=host,
76102
port=port,
@@ -79,4 +105,6 @@ def ui(
79105
root_path=root_path,
80106
tls_key_path=tls_key_path,
81107
tls_cert_path=tls_cert_path,
108+
mode=mode,
109+
rest_api_url=rest_api_url,
82110
)

sdk/python/feast/feature_store.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3153,8 +3153,15 @@ def serve_ui(
31533153
root_path: str = "",
31543154
tls_key_path: str = "",
31553155
tls_cert_path: str = "",
3156+
mode: str = "proto",
3157+
rest_api_url: str = "",
31563158
) -> None:
3157-
"""Start the UI server locally"""
3159+
"""Start the UI server locally
3160+
3161+
Args:
3162+
mode: Data serving mode - 'proto' (default), 'rest', or 'rest-external'.
3163+
rest_api_url: Base URL for external REST API (required for 'rest-external' mode).
3164+
"""
31583165
if flags_helper.is_test():
31593166
warnings.warn(
31603167
"The Feast UI is an experimental feature. "
@@ -3171,6 +3178,8 @@ def serve_ui(
31713178
root_path=root_path,
31723179
tls_key_path=tls_key_path,
31733180
tls_cert_path=tls_cert_path,
3181+
mode=mode,
3182+
rest_api_url=rest_api_url,
31743183
)
31753184

31763185
def serve_registry(

0 commit comments

Comments
 (0)