-
Notifications
You must be signed in to change notification settings - Fork 225
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
cancel analysis #1305
base: master
Are you sure you want to change the base?
cancel analysis #1305
Conversation
jstucke
commented
Nov 25, 2024
- new feature: cancel analyses that are currently in progress (also works with updates)
- analyses and extractions that are currently underway will not be canceled
- instead, following analyses and extractions will not be scheduled
- can be triggered on the "system health" page in the web interface (REST: TODO)
61dc184
to
ff10fb4
Compare
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #1305 +/- ##
==========================================
- Coverage 92.21% 91.93% -0.29%
==========================================
Files 377 376 -1
Lines 23068 21047 -2021
==========================================
- Hits 21273 19350 -1923
+ Misses 1795 1697 -98 ☔ View full report in Codecov by Sentry. |
ff10fb4
to
5dff8f2
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How can analysis be resumed?
Would I have to hit the re-analyze button?
Also, I think there needs to be an endpoint in the rest API to cancel an anylsis.
Furthermore, I think it should be queryable whether an analysis was canceled.
If., e.g., analyzing LFwC which contains thousands of firmware images and I canceled some of them, I would want to exclude them from my farther evaluation.
src/scheduler/analysis_status.py
Outdated
self.manager = Manager() | ||
# this object tracks only the FW objects and not the status of the individual files | ||
self.currently_analyzed = self.manager.dict() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should these be private?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes -> fixed
class FwAnalysisStatus: | ||
files_to_unpack: Set[str] | ||
files_to_analyze: Set[str] | ||
files_to_unpack: set[str] | ||
files_to_analyze: set[str] | ||
total_files_count: int | ||
hid: str | ||
analysis_plugins: Dict[str, int] | ||
analysis_plugins: dict[str, int] | ||
start_time: float = field(default_factory=time) | ||
completed_files: Set[str] = field(default_factory=set) | ||
completed_files: set[str] = field(default_factory=set) | ||
total_files_with_duplicates: int = 1 | ||
unpacked_files_count: int = 1 | ||
analyzed_files_count: int = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the future please, create a separate commit for (unrelated) formatting changes.
Having them in the same commit makes reviewing harder as you have to deliberatly ignore some parts of the code but not all ofc.
The analysis cannot be resumed. The files were dropped from scheduling at that point (it would not really be feasible to keep them lying around somewhere for when we might need them again (if that ever happens))
You would have to use "Redo analysis" as there is currently no way to tell which files were fully extracted/analyzed. We could consider adding some kind of flag to the metadata which could also be displayed in the web interface.
Yes, that is planned (but in another PR)
There should be a new entry |
1927858
to
91fc6f0
Compare
91fc6f0
to
2679946
Compare