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

Miscellanous improvements #129

Merged
merged 4 commits into from
Nov 22, 2024
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
return partial logs if all logs couldn't be retrieved
(with a warning log)

This allows to specify a larger number of logs if the exact one is not
known and still get logs when number of tries is reached
  • Loading branch information
jcuquemelle committed Nov 21, 2024
commit 2a3c00ddc12524e411c2ef582f32f29adf174523
7 changes: 6 additions & 1 deletion cluster_pack/skein/skein_launcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,17 +223,22 @@ def get_application_logs(
wait_for_nb_logs: Optional[int] = None,
log_tries: int = 15
) -> Optional[skein.model.ApplicationLogs]:
nb_keys = 0
for ind in range(log_tries):
try:
logs = client.application_logs(app_id)
nb_keys = len(logs.keys())
logger.info(f"Got {nb_keys}/{wait_for_nb_logs} log files")
if not wait_for_nb_logs or nb_keys == wait_for_nb_logs:
if not wait_for_nb_logs or nb_keys >= wait_for_nb_logs:
return logs
except Exception:
logger.warning(
f"Cannot collect logs (attempt {ind+1}/{log_tries})")
time.sleep(3)
if nb_keys >= 1:
logger.warning(
f"Only {nb_keys} logs retrieved instead of {wait_for_nb_logs} requested")
return logs
return None


Expand Down