Commit c273f29
authored
fix: Add log retrieval after job finalization (#61)
This PR adds log retrieval for finished Google Batch jobs.
Log tailing is not available via the Cloud Logging API, so we can only
retrieve logs all at once. A simple solution is to retrieve them only
after the job has finished.
There was a discussion in #14 about how the API only allows retrieving a
single line per request and 60 requests per minute. However, I have
discovered that we can retrieve 1,000 lines (stdout/stderr) per request,
so 60,000 lines per minute.
In this implementation, if a request fails, it retries after a 60-second
delay. If it fails again, the logfile is left as-is - remains
incomplete.
This implementation, while not perfect, improves the current situation,
where an empty `.snakemake/googlebatch_logs/` directory is created.
Downloading these logs is highly beneficial, as browsing them in the
Google Cloud Console's logging utility is highly painful.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
- **New Features**
- Automated log collection for completed jobs is now available. This
update ensures that logs from both successful and failed jobs are
reliably captured with built-in handling of temporary service
limitations to improve overall stability.
- **Bug Fixes**
- Improved error handling for log retrieval to manage service request
limitations effectively.
- **Tests**
- Enhanced mock functionality in tests to accommodate new attributes and
methods, improving test coverage and reliability.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->1 parent 3a37591 commit c273f29
File tree
3 files changed
+70
-7
lines changed- snakemake_executor_plugin_googlebatch
- tests
3 files changed
+70
-7
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
25 | | - | |
| 25 | + | |
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | 31 | | |
32 | | - | |
33 | | - | |
| 32 | + | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
2 | 3 | | |
3 | 4 | | |
4 | 5 | | |
| |||
11 | 12 | | |
12 | 13 | | |
13 | 14 | | |
14 | | - | |
15 | | - | |
| 15 | + | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
508 | 509 | | |
509 | 510 | | |
510 | 511 | | |
| 512 | + | |
| 513 | + | |
| 514 | + | |
511 | 515 | | |
512 | 516 | | |
513 | 517 | | |
| |||
519 | 523 | | |
520 | 524 | | |
521 | 525 | | |
| 526 | + | |
| 527 | + | |
| 528 | + | |
| 529 | + | |
| 530 | + | |
| 531 | + | |
| 532 | + | |
| 533 | + | |
| 534 | + | |
| 535 | + | |
| 536 | + | |
| 537 | + | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
| 574 | + | |
| 575 | + | |
| 576 | + | |
| 577 | + | |
522 | 578 | | |
523 | 579 | | |
524 | | - | |
| 580 | + | |
525 | 581 | | |
526 | 582 | | |
527 | 583 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
14 | | - | |
| 14 | + | |
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
| |||
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
25 | 32 | | |
26 | 33 | | |
27 | 34 | | |
| |||
0 commit comments