Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 29 additions & 1 deletion sdk/python/feast/cli/ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

from feast.repo_operations import create_feature_store, registry_dump

VALID_MODES = ("proto", "rest", "rest-external")


@click.command()
@click.option(
Expand Down Expand Up @@ -52,6 +54,25 @@
show_default=False,
help="path to TLS(SSL) certificate public key. You need to pass --key arg as well to start server in TLS mode",
)
@click.option(
"--mode",
"-m",
type=click.Choice(VALID_MODES, case_sensitive=False),
default="proto",
show_default=True,
help=(
"Data serving mode for the UI. "
"'proto' serves the registry as a protobuf blob (current default). "
"'rest' mounts the REST registry API alongside the UI. "
"'rest-external' proxies to an external REST registry API."
),
)
@click.option(
"--rest-api-url",
type=click.STRING,
default="",
help="Base URL of an external REST registry API (required when --mode=rest-external). Example: http://registry-host:6570/api/v1",
)
@click.pass_context
def ui(
ctx: click.Context,
Expand All @@ -61,6 +82,8 @@ def ui(
root_path: str = "",
tls_key_path: str = "",
tls_cert_path: str = "",
mode: str = "proto",
rest_api_url: str = "",
):
"""
Shows the Feast UI over the current directory
Expand All @@ -69,8 +92,11 @@ def ui(
raise click.BadParameter(
"Please configure --key and --cert args to start the feature server in SSL mode."
)
if mode == "rest-external" and not rest_api_url:
raise click.BadParameter(
"--rest-api-url is required when using --mode=rest-external."
)
store = create_feature_store(ctx)
# Pass in the registry_dump method to get around a circular dependency
store.serve_ui(
host=host,
port=port,
Expand All @@ -79,4 +105,6 @@ def ui(
root_path=root_path,
tls_key_path=tls_key_path,
tls_cert_path=tls_cert_path,
mode=mode,
rest_api_url=rest_api_url,
)
11 changes: 10 additions & 1 deletion sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -3153,8 +3153,15 @@ def serve_ui(
root_path: str = "",
tls_key_path: str = "",
tls_cert_path: str = "",
mode: str = "proto",
rest_api_url: str = "",
) -> None:
"""Start the UI server locally"""
"""Start the UI server locally

Args:
mode: Data serving mode - 'proto' (default), 'rest', or 'rest-external'.
rest_api_url: Base URL for external REST API (required for 'rest-external' mode).
"""
if flags_helper.is_test():
warnings.warn(
"The Feast UI is an experimental feature. "
Expand All @@ -3171,6 +3178,8 @@ def serve_ui(
root_path=root_path,
tls_key_path=tls_key_path,
tls_cert_path=tls_cert_path,
mode=mode,
rest_api_url=rest_api_url,
)

def serve_registry(
Expand Down
Loading
Loading