Made fixes and optimizations to encryption GC#3430
Made fixes and optimizations to encryption GC#3430estesp merged 4 commits intocontainerd:masterfrom lumjjb:encgcfix
Conversation
|
This PR fixes an issue I had seen with this command line:
Tested-by: Stefan Berger [email protected] |
|
Build succeeded.
|
|
Build succeeded.
|
|
Ok, I think I see what is going wrong here. Normally the client is responsible for providing leases through the context and that lease will be used anywhere content is created. Explicitly adding to the lease here is not necessary (it is only needed in read case when you want to consume some content you did not create and want to ensure your operation completes without something else deleting it). In this case, the lease should be created at the highest client level, in your commands before calling down into your code which creates resources. This will ensure everything is kept around during the life of your client command. |
Codecov Report
@@ Coverage Diff @@
## master #3430 +/- ##
==========================================
+ Coverage 44.24% 44.24% +<.01%
==========================================
Files 123 123
Lines 13675 13675
==========================================
+ Hits 6050 6051 +1
+ Misses 6694 6693 -1
Partials 931 931
Continue to review full report at Codecov.
|
|
@dmcgowan That's nice! Let me make a change to that as well in this PR then! |
Signed-off-by: Brandon Lum <[email protected]>
|
Build succeeded.
|
|
Works for me... |
|
Build succeeded.
|
|
The test failing is I am able to make it go away by removing the use of the lease from the encryption test, but I'm not sure if this is the expected behavior for leases. |
|
Build succeeded.
|
There was a problem hiding this comment.
don't call cw.Digest() here, it should be called after Commit
There was a problem hiding this comment.
This test doesn't need a lease such as WithLease?
There was a problem hiding this comment.
Ok - i think i figured out what the issue was. I think it is a bad gc label.
Signed-off-by: Brandon Lum <[email protected]>
|
Build succeeded.
|
|
Build succeeded.
|
|
~~@dmcgowan ready for review!~~
EDIT 2: @stefanberger figured out the underlying issue of test interaction. Potential fixes posted below.
EDIT: nvm, that was not it, but it's really weird... can't explain the tests interacting with each other... We suspect it's that the images are not deleted properly across tests having something to do with the lease.
…On Thu, Jul 18, 2019, 6:49 PM theopenlab-ci[bot] ***@***.***> wrote:
Build succeeded.
- containerd-build-arm64
<https://logs.openlabtesting.org/logs/30/3430/2c6c3b937d1b848a67777578b3b5674bc20519e3/check/containerd-build-arm64/05ceea9/>
: SUCCESS in 9m 14s (non-voting)
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#3430?email_source=notifications&email_token=AAXLDBWWQO65QIWZA4OENTLQADXQJA5CNFSM4IE52CFKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOD2KBFTY#issuecomment-513020623>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AAXLDBVQO2K7RRC4K45QT5LQADXQJANCNFSM4IE52CFA>
.
|
|
Build succeeded.
|
Signed-off-by: Brandon Lum <[email protected]> Signed-off-by: Stefan Berger <[email protected]>
|
Build succeeded.
|
|
Yea, it does seem like the issue is that the tests are interacting with each other because certain things are not being deleted from the content store that were being leased. Since the
The content will not be deleted unless GC runs. We've found 2 patches that work, @dmcgowan let us know what your thoughts are. OR |
| // properly deleted | ||
| defer func() { | ||
| done(ctx) | ||
| client.ImageService().Delete(ctx, imageName, images.SynchronousDelete()) |
There was a problem hiding this comment.
I would definitely encourage using test specific image names here. Also when doing a synchronous delete of 2 images, just add the flag on the second one.
Signed-off-by: Brandon Lum <[email protected]>
|
Build succeeded.
|
|
I think it would make sense to just add some randomness to the encrypted image name; that way parallel runs of the suite won't overlap on name use. And we also pull a seed image at the start of test runs--busybox I think, so I'm not sure you need to absolutely pull or delete that image as you should be able to find it in the image service? @dmcgowan can correct me if I'm wrong on that. |
@estesp I'm curious about that too - I was unsure about the implications for the unpacked image, seeing as how the actual unpacked image would have the same content hash even with a different tag... Let me try that out.. EDIT: I tried it out and it didn't work unfortunately... I tried it with this patch, that takes the pulled image and tags it as another image name. |
dmcgowan
left a comment
There was a problem hiding this comment.
LGTM
This change is better than what is in master...
However, I think there are still some improvements which could be made to improve reliability. We have a "seed" image which gets pulled at the beginning so we can attempt to avoid pulling as much as possible during tests. In this case, it is OK to use that seed image, encrypt it, then decrypt it into a different image name, the original image does not need to be deleted at the end, only the newly created ones.
|
Sounds good - I'll start checking out the seed image in the meantime! |
There are some fixes required for garbage collection, as well as some optimizations for removal of certain resources from the lease for the image encryption feature introduced in #3134.
This PR aims to fix these known GC issues.
Signed-off-by: Brandon Lum [email protected]