Skip to content

Commit

Permalink
Fixing the unit test cases.
Browse files Browse the repository at this point in the history
Signed-off-by: lrangine <[email protected]>
  • Loading branch information
lokeshrangineni committed Dec 17, 2024
1 parent 436f0db commit 1d64ebb
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
3 changes: 1 addition & 2 deletions sdk/python/feast/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -1112,14 +1112,13 @@ def serve_registry_command(
tls_ca_file_path: str,
):
"""Start a registry server locally on a given port."""
configure_ssl_ca(ca_file_path=tls_ca_file_path)
if (tls_key_path and not tls_cert_path) or (not tls_key_path and tls_cert_path):
raise click.BadParameter(
"Please pass --cert and --key args to start the registry server in TLS mode."
)
store = create_feature_store(ctx)

store.serve_registry(port, tls_key_path, tls_cert_path)
store.serve_registry(port, tls_key_path, tls_cert_path, tls_ca_file_path)


@cli.command("serve_offline")
Expand Down
12 changes: 10 additions & 2 deletions sdk/python/feast/feature_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -1949,13 +1949,21 @@ def serve_ui(
)

def serve_registry(
self, port: int, tls_key_path: str = "", tls_cert_path: str = ""
self,
port: int,
tls_key_path: str = "",
tls_cert_path: str = "",
tls_ca_file_path: str = "",
) -> None:
"""Start registry server locally on a given port."""
from feast import registry_server

registry_server.start_server(
self, port=port, tls_key_path=tls_key_path, tls_cert_path=tls_cert_path
self,
port=port,
tls_key_path=tls_key_path,
tls_cert_path=tls_cert_path,
tls_ca_file_path=tls_ca_file_path,
)

def serve_offline(
Expand Down
3 changes: 3 additions & 0 deletions sdk/python/feast/registry_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@
from feast.project import Project
from feast.protos.feast.registry import RegistryServer_pb2, RegistryServer_pb2_grpc
from feast.saved_dataset import SavedDataset, ValidationReference
from feast.ssl_ca_setup import configure_ssl_ca
from feast.stream_feature_view import StreamFeatureView

logger = logging.getLogger(__name__)
Expand Down Expand Up @@ -763,7 +764,9 @@ def start_server(
wait_for_termination: bool = True,
tls_key_path: str = "",
tls_cert_path: str = "",
tls_ca_file_path: str = "",
):
configure_ssl_ca(ca_file_path=tls_ca_file_path)
auth_manager_type = str_to_auth_manager_type(store.config.auth_config.type)
init_security_manager(auth_type=auth_manager_type, fs=store)
init_auth_manager(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ def start_registry_server(
wait_for_termination=False,
tls_key_path=tls_key_path,
tls_cert_path=tls_cert_path,
tls_ca_file_path=tls_ca_file_path,
)
else:
print(f"Starting Registry in Non-TLS mode at {server_port}")
Expand Down

0 comments on commit 1d64ebb

Please sign in to comment.