Skip to content

Commit

Permalink
fix: java to proto failing
Browse files Browse the repository at this point in the history
- changed java_outer_classname for Permission.proto and Policy.proto
- removed experimental optional from permission proto

Signed-off-by: Theodor Mihalache <[email protected]>
  • Loading branch information
tmihalac committed Aug 6, 2024
1 parent 6a63a34 commit 377fce1
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 54 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -228,56 +228,3 @@ def _overwrite_remote_client_feature_store_yaml(
)
+ auth_config
)


def _start_feature_server(repo_path: str, server_port: int, metrics: bool = False):
host = "0.0.0.0"
cmd = [
"feast",
"-c" + repo_path,
"serve",
"--host",
host,
"--port",
str(server_port),
]
feast_server_process = subprocess.Popen(
cmd, stdout=subprocess.PIPE, stderr=subprocess.DEVNULL
)
_time_out_sec: int = 60
# Wait for server to start
wait_retry_backoff(
lambda: (None, check_port_open(host, server_port)),
timeout_secs=_time_out_sec,
timeout_msg=f"Unable to start the feast server in {_time_out_sec} seconds for remote online store type, port={server_port}",
)

if metrics:
cmd.append("--metrics")

# Check if metrics are enabled and Prometheus server is running
if metrics:
wait_retry_backoff(
lambda: (None, check_port_open("localhost", 8000)),
timeout_secs=_time_out_sec,
timeout_msg="Unable to start the Prometheus server in 60 seconds.",
)
else:
assert not check_port_open(
"localhost", 8000
), "Prometheus server is running when it should be disabled."

yield f"http://localhost:{server_port}"

if feast_server_process is not None:
feast_server_process.kill()

# wait server to free the port
wait_retry_backoff(
lambda: (
None,
not check_port_open("localhost", server_port),
),
timeout_msg=f"Unable to stop the feast server in {_time_out_sec} seconds for remote online store type, port={server_port}",
timeout_secs=_time_out_sec,
)
17 changes: 16 additions & 1 deletion sdk/python/tests/utils/auth_permissions_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def default_store(
return fs


def start_feature_server(repo_path: str, server_port: int):
def start_feature_server(repo_path: str, server_port: int, metrics: bool = False):
host = "0.0.0.0"
cmd = [
"feast",
Expand All @@ -76,6 +76,21 @@ def start_feature_server(repo_path: str, server_port: int):
timeout_msg=f"Unable to start the feast server in {_time_out_sec} seconds for remote online store type, port={server_port}",
)

if metrics:
cmd.append("--metrics")

# Check if metrics are enabled and Prometheus server is running
if metrics:
wait_retry_backoff(
lambda: (None, check_port_open("localhost", 8000)),
timeout_secs=_time_out_sec,
timeout_msg="Unable to start the Prometheus server in 60 seconds.",
)
else:
assert not check_port_open(
"localhost", 8000
), "Prometheus server is running when it should be disabled."

yield f"http://localhost:{server_port}"

if feast_server_process is not None:
Expand Down

0 comments on commit 377fce1

Please sign in to comment.