Skip to content

Commit

Permalink
tmp
Browse files Browse the repository at this point in the history
  • Loading branch information
approxit committed Oct 23, 2023
1 parent 3bd355b commit 4456c29
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 19 deletions.
21 changes: 13 additions & 8 deletions ray_on_golem/provider/node_provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -212,20 +212,25 @@ def _start_webserver(
cli_logger.print("Starting webserver done")
return
else:
cli_logger.abort(
"Starting webserver failed!\nShowing last 50 lines from `{}`:\n{}",
LOGGING_DEBUG_PATH,
"".join(LOGGING_DEBUG_PATH.open("r").readlines()[-50:]),
)
with LOGGING_DEBUG_PATH.open("r") as file:
cli_logger.abort(
"Starting webserver failed!\nShowing last 50 lines from `{}`:\n{}",
LOGGING_DEBUG_PATH,
"".join(file.readlines()[-50:]),
)

cli_logger.print(
"Webserver is not yet running, waiting additional `{}` seconds...",
check_seconds,
)

cli_logger.abort(
"Starting webserver failed! Deadline of `{}` reached.", RAY_ON_GOLEM_START_DEADLINE
)
with LOGGING_DEBUG_PATH.open("r") as file:
cli_logger.abort(
"Starting webserver failed! Deadline of `{}` reached.\nShowing last 50 lines from `{}`:\n{}",
RAY_ON_GOLEM_START_DEADLINE,
LOGGING_DEBUG_PATH,
"".join(file.readlines()[-50:]),
)

@staticmethod
def _stop_webserver(ray_on_golem_client: RayOnGolemClient) -> None:
Expand Down
24 changes: 13 additions & 11 deletions ray_on_golem/server/services/yagna.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,24 +100,26 @@ async def _run_yagna(self) -> None:
logger.info("Starting Yagna done")
return
else:
logger.error(
"Starting Yagna failed!\nShowing last 50 lines from `%s`:\n%s",
LOGGING_YAGNA_PATH,
"".join(LOGGING_YAGNA_PATH.open("r").readlines()[-50:]),
)
with LOGGING_YAGNA_PATH.open("r") as file:
logger.error(
"Starting Yagna failed!\nShowing last 50 lines from `%s`:\n%s",
LOGGING_YAGNA_PATH,
"".join(file.readlines()[-50:]),
)
raise YagnaServiceError("Starting Yagna failed!")

logger.info(
"Yagna is not yet running, waiting additional `%s` seconds...",
check_seconds,
)

logger.error(
"Starting Yagna failed! Deadline of `%s` reached.\nShowing last 50 lines from `%s`:\n%s",
YAGNA_START_DEADLINE,
LOGGING_YAGNA_PATH,
"".join(LOGGING_YAGNA_PATH.open("r").readlines()[-50:]),
)
with LOGGING_YAGNA_PATH.open("r") as file:
logger.error(
"Starting Yagna failed! Deadline of `%s` reached.\nShowing last 50 lines from `%s`:\n%s",
YAGNA_START_DEADLINE,
LOGGING_YAGNA_PATH,
"".join(file.readlines()[-50:]),
)
raise YagnaServiceError("Starting Yagna failed!")

async def _on_yagna_early_exit(self) -> None:
Expand Down

0 comments on commit 4456c29

Please sign in to comment.