Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Make UI accessible behind proxy #3428

Merged
merged 2 commits into from
Jan 6, 2023
Merged
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
17 changes: 15 additions & 2 deletions sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,12 +151,24 @@ def version():
"--registry_ttl_sec",
"-r",
help="Number of seconds after which the registry is refreshed",
type=int,
type=click.INT,
default=5,
show_default=True,
)
@click.option(
"--root_path",
help="Provide root path to make the UI working behind proxy",
type=click.STRING,
default="",
)
@click.pass_context
def ui(ctx: click.Context, host: str, port: int, registry_ttl_sec: int):
def ui(
ctx: click.Context,
host: str,
port: int,
registry_ttl_sec: int,
root_path: Optional[str] = "",
):
"""
Shows the Feast UI over the current directory
"""
Expand All @@ -170,6 +182,7 @@ def ui(ctx: click.Context, host: str, port: int, registry_ttl_sec: int):
port=port,
get_registry_dump=registry_dump,
registry_ttl_sec=registry_ttl_sec,
root_path=root_path,
)


Expand Down
8 changes: 7 additions & 1 deletion sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -2319,7 +2319,12 @@ def get_feature_server_endpoint(self) -> Optional[str]:

@log_exceptions_and_usage
def serve_ui(
self, host: str, port: int, get_registry_dump: Callable, registry_ttl_sec: int
self,
host: str,
port: int,
get_registry_dump: Callable,
registry_ttl_sec: int,
root_path: Optional[str] = "",
sudohainguyen marked this conversation as resolved.
Show resolved Hide resolved
) -> None:
"""Start the UI server locally"""
if flags_helper.is_test():
Expand All @@ -2335,6 +2340,7 @@ def serve_ui(
get_registry_dump=get_registry_dump,
project_id=self.config.project,
registry_ttl_sec=registry_ttl_sec,
root_path=root_path,
)

@log_exceptions_and_usage
Expand Down
12 changes: 10 additions & 2 deletions sdk/python/feast/ui_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ def start_server(
get_registry_dump: Callable,
project_id: str,
registry_ttl_sec: int,
root_path: Optional[str] = "",
sudohainguyen marked this conversation as resolved.
Show resolved Hide resolved
):
app = get_app(store, get_registry_dump, project_id, registry_ttl_sec, host, port)
uvicorn.run(app, host=host, port=port)
app = get_app(
store,
get_registry_dump,
project_id,
registry_ttl_sec,
host,
port,
)
uvicorn.run(app, host=host, port=port, root_path=root_path)