-
Notifications
You must be signed in to change notification settings - Fork 30
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
Update caching mechanism to allow for concurrent genpolicy runs #113
Conversation
d165d78
to
090e5f8
Compare
Thanks @SethHollandsworth! This change seems very promising at a quick look, but please rebase on the latest branch before we review it more thoroughly. |
090e5f8
to
88e5257
Compare
rebased and ready to review, thanks! |
336be43
to
d7c6cfb
Compare
Thanks again for the help, Seth! I think we should try to detect if another app/instance is using the cache, and switch to non-cached mode if that's the case. Otherwise we are still racing while modifying the cache from two or more instances. |
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.
comment
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.
Please see my comment above.
8009d31
to
c698e5a
Compare
This should be merged after #117 . I will rebase and ensure building on Windows works at that point. Thanks for being flexible! |
6fdd439
to
b97fd54
Compare
b97fd54
to
3de20d4
Compare
Previously the tool would use the layers_cache folder for all instances and hence delete the cache when it was done, interfereing with other instances. This change makes it so that each instance of the tool will have its own temp folder to use. Co-authored-by: Khalil Sayid <[email protected]> Signed-off-by: Seth Hollandsworth <[email protected]>
3de20d4
to
565df4a
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.
Pending test results.
This is not a requirement of the tool itself but of the
katapolicygen
python wrapper used in confcom for writing tests that run in parallel. Previously thelayers_cache
folder would be concurrently written to and deleted depending on the settings of the tests, resulting in errors.This PR proposes using temp folders instead of
layers_cache
and keeping the layer hashes in a centralpolicy.json
file that doesn't get deleted after running the tool instead of the.verity
files nested inlayers_cache
. Because of the use of temporary folders, the cleanup process is a little nicer too.Let me know if anything should be changed, thanks!