Feature #7368
closedSupport lightweight verification results
Added by Evgeny Novikov over 8 years ago. Updated over 8 years ago.
100%
Description
Klever is already mature enough so that one would like to either get lightweight verification results when deciding jobs or to convert already uploaded heavyweight verification results to the lightweight ones. The former is very useful in production, especially when verifying the large number of modules or/and rules, and should be likely done by default. The latter will allow to collect verification results from workers and to store them into production databases very-very efficiently.
The main idea of making verification results lightweight is to collapse verification report trees, that can have more than 90% of almost useless nodes, and to keep for them just some high-level statistics, e.g. resources consumption. I suggest to always keep just:- root reports, in particular with data reports,
- unsafe reports,
- their parent verification reports if they contain input files of a verifier,
- unknown reports.
Of course there will be no report trees any more. Everything will be children of root reports. Thus it is required to accurately deal with attributes, component names and so on. Other functionality like mark up should work with lightweight verification results as for heavyweight ones.
In addition I suppose to completely switch off logging for the production mode. So Bridge should support null log fields of reports while Core shouldn't create stub empty log files for these fields.
I hope that the number of required memory, space and CPU time for different operations with lightweight verification results will be reduced up to 90%.
Files
Job-053c4efcb0-0.tar.gz (14.9 KB) Job-053c4efcb0-0.tar.gz | Evgeny Novikov, 07/28/2016 10:17 PM |
Updated by Evgeny Novikov over 8 years ago
- Priority changed from Urgent to Immediate
This forces us to keep raw verification results on computational nodes rather than to download them from there and to upload archives to the production server. Nobody likes to mark up such the verification results. Besides computational nodes can't be shut down whereas they should be shut down just after verification results are obtained and downloaded.
Updated by Vladimir Gratinskiy over 8 years ago
- Due date set to 07/25/2016
- % Done changed from 0 to 90
Implemented in branch feature_7368. But all unknown reports are saved with their parents, because if Core has unknown report the job is corrupted + components can't have more than one unknown report. Unsafes's parents are saved if they have archive (with files and log). It is too expensive to parse all archives while collapsing reports. So if you want lightweight results: logs must be null while verification. And acrhive with files should be included only if it has important tool's files. Button "collapse" is also added. But it doesn't delete logs of leaves' parents. The only thing still in progress is tests for this feature.
Updated by Evgeny Novikov over 8 years ago
Input files for static verifiers are included just if corresponding option is enabled at the job start up page. For the production mode this isn't the case.
To get rid of annoying and large logs I suppose to reduce log levels in the production mode even more - to WARNING. As far as I understand, if log files are absent or empty, Core can report "log": null rather than to create artificial empty files and upload them.
I didn't catch why unknown reports need their parent reports to be uploaded. There are quite a lot of unknown reports, thus the corresponding number of parent reports will be kept as well. If Core has unknown report, the job is Failed rather than Corrupted, but for this something special can be added, e.g. specify this in another table.
Updated by Vladimir Gratinskiy over 8 years ago
- Status changed from New to Resolved
- % Done changed from 90 to 100
Evgeny Novikov wrote:
Input files for static verifiers are included just if corresponding option is enabled at the job start up page. For the production mode this isn't the case.
For log's should be the same option.
To get rid of annoying and large logs I suppose to reduce log levels in the production mode even more - to WARNING. As far as I understand, if log files are absent or empty, Core can report "log": null rather than to create artificial empty files and upload them.
You can have reports with 'log': null and without 'log' at all.
I didn't catch why unknown reports need their parent reports to be uploaded. There are quite a lot of unknown reports, thus the corresponding number of parent reports will be kept as well. If Core has unknown report, the job is Failed rather than Corrupted, but for this something special can be added, e.g. specify this in another table.
For example, the report's page have status of component. If component has unknown as its child then status=Failed and status is link to the corresponding unknown. Several unknowns for component will lead to exception.
Now branch is ready to tests with huge jobs and to merge to master. It contains migration.
Updated by Evgeny Novikov over 8 years ago
Vladimir Gratinskiy wrote:
Evgeny Novikov wrote:
Input files for static verifiers are included just if corresponding option is enabled at the job start up page. For the production mode this isn't the case.
For log's should be the same option.
I guess that it already exists and called the log level. But actually I understand that for lightweight verification results there shouldn't be logs at all because of they won't be available. We should specify the lowest log level (all logs will be most likely empty) or even, better, specify special log levels, say, NONE, meaning that logging isn't required (this will be even a bit more efficient).
To get rid of annoying and large logs I suppose to reduce log levels in the production mode even more - to WARNING. As far as I understand, if log files are absent or empty, Core can report "log": null rather than to create artificial empty files and upload them.
You can have reports with 'log': null and without 'log' at all.
I didn't catch why unknown reports need their parent reports to be uploaded. There are quite a lot of unknown reports, thus the corresponding number of parent reports will be kept as well. If Core has unknown report, the job is Failed rather than Corrupted, but for this something special can be added, e.g. specify this in another table.
For example, the report's page have status of component. If component has unknown as its child then status=Failed and status is link to the corresponding unknown. Several unknowns for component will lead to exception.
This and some other checks can be (already are) missed for lightweight verification results since we rely upon everything is quite good enough..
I still don't see any sense to keep component statutes. Just keep unknown reports with required attributes, including component names, somehow. You can even introduce new fields or even tables especially for lightweight verification results.
Now branch is ready to tests with huge jobs and to merge to master. It contains migration.
Updated by Vladimir Gratinskiy over 8 years ago
- Due date changed from 07/25/2016 to 07/27/2016
After commit f4faeb9 unknowns are saved without parents. And job status is Failed rather than corrupted if Core has unknown(s). The problem is cache. If you will recalculate cache for lightweight job you will lose resources for deleted components. If you download lightweight job and upload it - the same. Also unknowns marks will not be associated with lightweight unknowns due to its component is changed to Core after collapsing (cache was not changed - you will still see correct unknown's component, but after recalculating cache and download-uploading the job you will lose it).
Updated by Evgeny Novikov over 8 years ago
- Status changed from Resolved to Open
Vladimir Gratinskiy wrote:
After commit f4faeb9 unknowns are saved without parents. And job status is Failed rather than corrupted if Core has unknown(s). The problem is cache. If you will recalculate cache for lightweight job you will lose resources for deleted components. If you download lightweight job and upload it - the same. Also unknowns marks will not be associated with lightweight unknowns due to its component is changed to Core after collapsing (cache was not changed - you will still see correct unknown's component, but after recalculating cache and download-uploading the job you will lose it).
I don't know how but all mentioned issues definitely should be fixed since lightweight verification results shouldn't be disabled verification results. They will be obtained on dedicated servers and then downloaded/uploaded to the production server. After that they will be evaluated with unsafe/unknown marks. Everybody expects to see resources both without and with cache recalculation. And that is even much more important, one should be able to evaluate unknowns as usual.
As I already mentioned you are free to introduce new fields and even tables. For instance, you can keep resources so that they will not be touched by cache recalculation. In addition, you need to see resources in that source first (lightweight verification results) and just if they aren't present calculate (get them from caches) as usual (usual verification results). Something similar should work with unknown reports and marks as well.
Updated by Evgeny Novikov over 8 years ago
Evgeny Novikov wrote:
Vladimir Gratinskiy wrote:
Evgeny Novikov wrote:
Input files for static verifiers are included just if corresponding option is enabled at the job start up page. For the production mode this isn't the case.
For log's should be the same option.
I guess that it already exists and called the log level. But actually I understand that for lightweight verification results there shouldn't be logs at all because of they won't be available. We should specify the lowest log level (all logs will be most likely empty) or even, better, specify special log levels, say, NONE, meaning that logging isn't required (this will be even a bit more efficient).
I created special log level NONE that is now the default one for the production mode. Corresponding logs, logging handlers and files aren't created and uploaded. Since this works even in master, I implemented this there and merge master to the current branch.
Updated by Evgeny Novikov over 8 years ago
When you mentioned resources (just total ones since component reports are thrown away) I realized that information on the total number of safes will be also welcome since it will reflect how many verification tasks were solved. As well it shouldn't be removed when caches are recalculated and when a job archive is downloaded/uploaded.
In addition, I think that Bridge should allow null proofs for safe reports, since most likely we will not upload them at all unless one will ask for this (#6598).
Updated by Vladimir Gratinskiy over 8 years ago
- Status changed from Open to Resolved
Done. But I'm not sure I covered all cases in tests. So try it yourself with real jobs.
Updated by Evgeny Novikov over 8 years ago
- Status changed from Resolved to Open
- Since unsafe reports don't have attributes unsafe marks are created too long (there are not fast filters based on attributes matching - just on error trace comparison).
- Core has status Failed even if it finishes successfully - it is enough to finish with unknown for one of its children.
- It would be better to move flag lightweight from jobs themselves to the jobs non fast start decision page since it isn't a job property - it is a property of job verification results representation (although one can argue that verification results do differ with and without that flag, but indeed this difference isn't very important from the verification perspective - all unsafes and unknowns are kept).
- There is "Safe(0)" when, say, some unknown report is uploaded.
- I am interested in how collapsing works. As far as I can see, all component reports are actually uploaded to the database and can be even viewed by the user. But then (when?) the most of them disappear. I don't think that reports to be deleted should be shown to users. In addition I am not sure that it is a good idea to remove them with some delay. If I understand properly when we will verify all Linux kernel modules, then actual collapsing will work just when all of them will be verified - too much overhead.
Updated by Vladimir Gratinskiy over 8 years ago
Evgeny Novikov wrote:
After first look I have the following questions and remarks:
- Since unsafe reports don't have attributes unsafe marks are created too long (there are not fast filters based on attributes matching - just on error trace comparison).
Oh, I forgot about attributes. Will be fixed soon.
- Core has status Failed even if it finishes successfully - it is enough to finish with unknown for one of its children.
The lightweight job is Failed because the scheduler said it has Failed. Normal jobs can be also failed if Core has unknown as its child.
- It would be better to move flag lightweight from jobs themselves to the jobs non fast start decision page since it isn't a job property - it is a property of job verification results representation (although one can argue that verification results do differ with and without that flag, but indeed this difference isn't very important from the verification perspective - all unsafes and unknowns are kept).
Will be moved soon.
- There is "Safe(0)" when, say, some unknown report is uploaded.
Maybe besause there no safes? I'll fix it so there will be Safes(x) if x > 0.
- I am interested in how collapsing works. As far as I can see, all component reports are actually uploaded to the database and can be even viewed by the user. But then (when?) the most of them disappear. I don't think that reports to be deleted should be shown to users. In addition I am not sure that it is a good idea to remove them with some delay. If I understand properly when we will verify all Linux kernel modules, then actual collapsing will work just when all of them will be verified - too much overhead.
Collapsing or lightweight job verification? I think you mean the second case.
Reports are deleted when you upload finish Core report. Reports tree is needed to collect unsafes attributes (currently it doesn't work but I suggested it). Reports' archives and data are uploaded for Core component and for verification reports, so only parents, resources, cache are filled for reports that will be deleted at the end. It is too difficult to hide reports that will be deleted. Maybe it is easier to upload all needed attributes with unsafe reports?
Updated by Evgeny Novikov over 8 years ago
Vladimir Gratinskiy wrote:
Evgeny Novikov wrote:
After first look I have the following questions and remarks:
- Core has status Failed even if it finishes successfully - it is enough to finish with unknown for one of its children.
The lightweight job is Failed because the scheduler said it has Failed. Normal jobs can be also failed if Core has unknown as its child.
I think that you didn't understand. Status of the whole job decision is Solved (Core returns 0 and Native Scheduler reports about successful decision). But when I click Solved I see that Core has status Failed although the only unknown report is the child report of the report of the Core component.
- There is "Safe(0)" when, say, some unknown report is uploaded.
Maybe besause there no safes? I'll fix it so there will be Safes(x) if x > 0.
Definitely this will be better. BTW, non-lightweight verification results also suffer from this in the given branch.
- I am interested in how collapsing works. As far as I can see, all component reports are actually uploaded to the database and can be even viewed by the user. But then (when?) the most of them disappear. I don't think that reports to be deleted should be shown to users. In addition I am not sure that it is a good idea to remove them with some delay. If I understand properly when we will verify all Linux kernel modules, then actual collapsing will work just when all of them will be verified - too much overhead.
Collapsing or lightweight job verification? I think you mean the second case.
Yes, the second case (collapsing during getting lightweight verification results).
Reports are deleted when you upload finish Core report. Reports tree is needed to collect unsafes attributes (currently it doesn't work but I suggested it). Reports' archives and data are uploaded for Core component and for verification reports, so only parents, resources, cache are filled for reports that will be deleted at the end. It is too difficult to hide reports that will be deleted. Maybe it is easier to upload all needed attributes with unsafe reports?
Okay, let's show them. I don't think that uploading all needed attributes with unsafe reports is enough. Also you need to assume that for each started component an unknown report can be received. The good suggestion is the following. You can remove information on component reports immediately when they terminate, i.e. Bridge receive their finish reports, because of starting from this time such reports couldn't receive any child report which can, say, requires their attributes. I think that this will allow to remove the most of intermediate tree nodes quite quickly.
As well I am interested, do you keep data for all verification reports or just for those ones that can child unsafe reports? Actually for other verification reports it will be unreached.
Updated by Vladimir Gratinskiy over 8 years ago
Evgeny Novikov wrote:
Vladimir Gratinskiy wrote:
Evgeny Novikov wrote:
After first look I have the following questions and remarks:
- Core has status Failed even if it finishes successfully - it is enough to finish with unknown for one of its children.
The lightweight job is Failed because the scheduler said it has Failed. Normal jobs can be also failed if Core has unknown as its child.
I think that you didn't understand. Status of the whole job decision is Solved (Core returns 0 and Native Scheduler reports about successful decision). But when I click Solved I see that Core has status Failed although the only unknown report is the child report of the report of the Core component.
Can you provide me with such job?
- There is "Safe(0)" when, say, some unknown report is uploaded.
Maybe besause there no safes? I'll fix it so there will be Safes(x) if x > 0.
Definitely this will be better. BTW, non-lightweight verification results also suffer from this in the given branch.
Non-lightweight verification safes are not shown if number of safes is 0. For lightweight results it is already the same.
Reports are deleted when you upload finish Core report. Reports tree is needed to collect unsafes attributes (currently it doesn't work but I suggested it). Reports' archives and data are uploaded for Core component and for verification reports, so only parents, resources, cache are filled for reports that will be deleted at the end. It is too difficult to hide reports that will be deleted. Maybe it is easier to upload all needed attributes with unsafe reports?
Okay, let's show them. I don't think that uploading all needed attributes with unsafe reports is enough. Also you need to assume that for each started component an unknown report can be received. The good suggestion is the following. You can remove information on component reports immediately when they terminate, i.e. Bridge receive their finish reports, because of starting from this time such reports couldn't receive any child report which can, say, requires their attributes. I think that this will allow to remove the most of intermediate tree nodes quite quickly.
Good idea. Working on this.
As well I am interested, do you keep data for all verification reports or just for those ones that can child unsafe reports? Actually for other verification reports it will be unreached.
For all verification reports as unsafe can be uploaded after verification report is uploaded.
Updated by Evgeny Novikov over 8 years ago
- File Job-053c4efcb0-0.tar.gz Job-053c4efcb0-0.tar.gz added
Vladimir Gratinskiy wrote:
Evgeny Novikov wrote:
Vladimir Gratinskiy wrote:
Evgeny Novikov wrote:
After first look I have the following questions and remarks:
- Core has status Failed even if it finishes successfully - it is enough to finish with unknown for one of its children.
The lightweight job is Failed because the scheduler said it has Failed. Normal jobs can be also failed if Core has unknown as its child.
I think that you didn't understand. Status of the whole job decision is Solved (Core returns 0 and Native Scheduler reports about successful decision). But when I click Solved I see that Core has status Failed although the only unknown report is the child report of the report of the Core component.
Can you provide me with such job?
I attached the example.
- There is "Safe(0)" when, say, some unknown report is uploaded.
Maybe besause there no safes? I'll fix it so there will be Safes(x) if x > 0.
Definitely this will be better. BTW, non-lightweight verification results also suffer from this in the given branch.
Non-lightweight verification safes are not shown if number of safes is 0. For lightweight results it is already the same.
Maybe this is due to some JavaScript files weren't updated properly.
Reports are deleted when you upload finish Core report. Reports tree is needed to collect unsafes attributes (currently it doesn't work but I suggested it). Reports' archives and data are uploaded for Core component and for verification reports, so only parents, resources, cache are filled for reports that will be deleted at the end. It is too difficult to hide reports that will be deleted. Maybe it is easier to upload all needed attributes with unsafe reports?
Okay, let's show them. I don't think that uploading all needed attributes with unsafe reports is enough. Also you need to assume that for each started component an unknown report can be received. The good suggestion is the following. You can remove information on component reports immediately when they terminate, i.e. Bridge receive their finish reports, because of starting from this time such reports couldn't receive any child report which can, say, requires their attributes. I think that this will allow to remove the most of intermediate tree nodes quite quickly.
Good idea. Working on this.
As well I am interested, do you keep data for all verification reports or just for those ones that can child unsafe reports? Actually for other verification reports it will be unreached.
For all verification reports as unsafe can be uploaded after verification report is uploaded.
So after job decision is completed you can easily delete all verification reports and all their data, if it was uploaded, if they haven't child unsafe reports.
Updated by Vladimir Gratinskiy over 8 years ago
- Due date changed from 07/27/2016 to 07/29/2016
- Status changed from Open to Feedback
Done. I've added support of 'verification finish' reports. If you don't upload it, then reports would not be deleted while verification of lightweight jobs. These reports need just 'id' and 'type'.
Updated by Evgeny Novikov over 8 years ago
- Status changed from Feedback to Open
- Now if Core as well as any other component finishes successfully when verification results are lightweight it doesn't have status at all.
- Please, make the lightweightness flag a part of the mode configuration. I would like to specify that the production mode should always make verification results lightweight while other existing modes shouldn't do that. In future the mode set can be extended but this should be easily configurable as well.
Updated by Vladimir Gratinskiy over 8 years ago
- Status changed from Open to Feedback
Done. Fast start decision uses default LIGHWEIGHTNESS.
Updated by Evgeny Novikov over 8 years ago
- Status changed from Feedback to Open
When I choose any mode the lightweightness flag value doesn't change. This happens because of you specified it in incorrect place. It should be specified in DEF_KLEVER_CORE_MODES rather than in Bridge settings. The fix will not require any additional notes for fast decision start since it is started with the default mode. In general the decision mode can differ from the Bridge mode.
Updated by Evgeny Novikov over 8 years ago
Core began to send "verification finish" reports starting from 611a46e to branch feature_7368.
Updated by Vladimir Gratinskiy over 8 years ago
Done. Job configuration file must include 'lighweightness' option (true/false) now.
Updated by Evgeny Novikov over 8 years ago
- Status changed from Open to Closed
- Published in build set to 70df722
I merged the branch in 70df722.
Please, note that you need to migrate your databases after this commit.