forked from feast-dev/feast
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathui.py
More file actions
70 lines (67 loc) · 1.63 KB
/
ui.py
File metadata and controls
70 lines (67 loc) · 1.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import click
from feast.repo_operations import create_feature_store
@click.command()
@click.option(
"--host",
"-h",
type=click.STRING,
default="0.0.0.0",
show_default=True,
help="Specify a host for the server",
)
@click.option(
"--port",
"-p",
type=click.INT,
default=8888,
show_default=True,
help="Specify a port for the server",
)
@click.option(
"--root_path",
help="Provide root path to make the UI working behind proxy",
type=click.STRING,
default="",
)
@click.option(
"--key",
"-k",
"tls_key_path",
type=click.STRING,
default="",
show_default=False,
help="path to TLS(SSL) certificate private key. You need to pass --cert arg as well to start server in TLS mode",
)
@click.option(
"--cert",
"-c",
"tls_cert_path",
type=click.STRING,
default="",
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.pass_context
def ui(
ctx: click.Context,
host: str,
port: int,
root_path: str = "",
tls_key_path: str = "",
tls_cert_path: str = "",
):
"""
Shows the Feast UI over the current directory
"""
if (tls_key_path and not tls_cert_path) or (not tls_key_path and tls_cert_path):
raise click.BadParameter(
"Please configure --key and --cert args to start the feature server in SSL mode."
)
store = create_feature_store(ctx)
store.serve_ui(
host=host,
port=port,
root_path=root_path,
tls_key_path=tls_key_path,
tls_cert_path=tls_cert_path,
)