providers: retrieve data from instance log file (CRAFT-589)
Metadata
Current evaluation
Merged implementation to retrieve instance log data upon provider execution completion and append it to external logs. Uses craft-cli predictable naming and sets library logs to debug level. Approved, rebased on main, and merged.
Suggested action: —
No scores available.
Issue body
When the provider execution ends, retrieve data from the instance
log file and add it to the external log file.
Notes:
* This change uses the new craft-cli predictable log names feature.
* Set library logs to debug level so they can be captured by craft-cli.
* Output in verbose mode is still confusing (may need adjustments in craft-cli).
Co-authored-by: Chris Patterson <chris.patterson@canonical.com>
Signed-off-by: Claudio Matsuoka <claudio.matsuoka@canonical.com>
- [x] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)?
-----
Evaluation history
| Date | Model | Scores | Action | Summary |
|---|---|---|---|---|
| qwen/qwen3.6-35b-a3b | — | — | Merged implementation to retrieve instance log data upon provider execution completion and append it to external logs. Uses craft-cli predictable naming and sets library logs to debug level. Approved, rebased on main, and merged. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged after rebase on main. Retrieves data from instance log files and appends it to external logs upon provider execution completion. Leverages craft-cli predictable log names and sets library logs to debug level for capture. | |
| qwen3.6-35b-a3b-mtp-q6 | — | — | Merged after rebase on main. Retrieves instance log data and appends it to external logs upon provider execution completion. Utilizes craft-cli predictable log names and sets library logs to debug level for capture. |
Update history
No update history recorded yet.
Related issues
| Issue | Project | State | Summary | Similarity |
|---|---|---|---|---|
| #420 pack: fetch logs from managed instance on error (CRAFT-333) | charmcraft | merged | Merged changes to retrieve managed instance logs upon charm packing failures. Introduces a log path interface, provider log capture method, and log prefixing. Approved by two reviewers and passed CI. | |
| #77 providers: capture logs from instance | rockcraft | merged | Merged a refactor moving capture_logs_from_instance() to rockcraft/providers/providers.py and updating it to use craft-providers temporarily_pull_file(). Approved, resolving CRAFT-1351 with a 63-line reduction across six files. | |
| #3935 providers: refactor `capture_logs_from_instance()` | snapcraft | merged | Merged into main following approval and passing CI. Refactored capture_logs_from_instance() to use craft-providers temporarily_pull_file() and moved it to providers.py, trimming 28 lines and increasing coverage by 0.09%. | |
| #425 providers: handle unexpected case where instance never logs (CRAFT-345) | charmcraft | merged | Merged to handle cases where managed instances fail to create logs by catching and logging FileNotFoundError. Resolves CRAFT-345. Approved by two reviewers, modified two files. |