-
Notifications
You must be signed in to change notification settings - Fork 203
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
nydus-image: Fix blob unpacking bug in specified blob directory #1426
Conversation
e8ee46d
to
be28740
Compare
Codecov Report
@@ Coverage Diff @@
## master #1426 +/- ##
==========================================
- Coverage 46.45% 46.44% -0.02%
==========================================
Files 123 123
Lines 38640 38702 +62
Branches 38640 38702 +62
==========================================
+ Hits 17951 17975 +24
- Misses 19714 19753 +39
+ Partials 975 974 -1
|
Follow the steps in #1340 to reproduce that issue and verify if it is fixed:
# create a directory to store only one file `echarts.png`
mkdir echarts
# create a directory to store two file `avatar.png` and `echarts.png`
mkdir echarts-add
# create a directory to store created images (meta, blob)
mkdir echarts-image
# download images
wget https://user-images.githubusercontent.com/1655233/249319028-009b32a0-1563-465c-867e-7623d1b9275d.png -O echarts/echarts.png
wget https://user-images.githubusercontent.com/1655233/249319027-5dcdaf14-631c-46c4-ac11-58b1d4c04a0f.png -O echarts-add/avatar.png
wget https://user-images.githubusercontent.com/1655233/249319028-009b32a0-1563-465c-867e-7623d1b9275d.png -O echarts-add/echarts.png
./nydus-image create -v 5 -t dir-rafs -D echarts-image echarts
[2023-09-17 15:10:14.890232 +00:00] INFO successfully built RAFS filesystem:
meta blob path: echarts-image/59016ae5c245fd768f85cf6eeab74da0d88cd00d9f2df5d3627e6f0177ba38d9
data blob size: 0xc0e1
data blobs: ["fa964c10cd36503b3bbd0d8218ec03d132214a51b0e4b03d2684770290306bce"]
./nydus-image create -v 5 -t dir-rafs --chunk-dict echarts-image/59016ae5c245fd768f85cf6eeab74da0d88cd00d9f2df5d3627e6f0177ba38d9 -D echarts-image echarts-add
[2023-09-17 15:12:04.145951 +00:00] INFO RAFS v5 super block features: HASH_BLAKE3 | EXPLICIT_UID_GID | COMPRESSION_ZSTD
[2023-09-17 15:12:04.153042 +00:00] INFO successfully built RAFS filesystem:
meta blob path: echarts-image/86235ef91901df9392244c0f973c118530519f5b932bed33671aa9775e45a5e9
data blob size: 0xc0e1
data blobs: ["5ee38535110c9470daeb434efbace48b15dfb7c08878cc9effa2bc0b29638a0d", "fa964c10cd36503b3bbd0d8218ec03d132214a51b0e4b03d2684770290306bce"]
./nydus-image unpack --blob-dir echarts-image --output ./unpack-files.tar echarts-image/86235ef91901df9392244c0f973
c118530519f5b932bed33671aa9775e45a5e9
[2023-09-17 15:13:23.384728 +00:00] INFO RAFS v5 super block features: HASH_BLAKE3 | EXPLICIT_UID_GID | COMPRESSION_ZSTD
$ tar xvf unpack-files.tar
avatar.png
echarts.png
$ md5sum avatar.png
8d852403b0badc7731e8b5aa7bd3ad36 avatar.png
$ md5sum echarts-add/avatar.png
8d852403b0badc7731e8b5aa7bd3ad36 echarts-add/avatar.png
$ md5sum echarts.png
c747eb230ad3439052e001187b6a216d echarts.png
$ md5sum echarts-add/echarts.png
c747eb230ad3439052e001187b6a216d echarts-add/echarts.png |
Great job, thanks for the PR! |
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 organize your commits before merging. Our repo uses rebase merging, which will submit your original commit information to the master branch.
dae8cab
to
08dfec2
Compare
@adamqqqplay Done. |
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.
others LGTM! Thanks!
9d6e9e0
to
1b4bb61
Compare
b7703e5
to
1b4bb61
Compare
Signed-off-by: Junduo Dong <[email protected]>
1b4bb61
to
b48b662
Compare
Relevant Issue (if applicable)
Close #1340
Details
Fix the
unpack
bug in multi blobs situation. (Based on the unmerged work in #1338)Types of changes
What types of changes does your PullRequest introduce? Put an
x
in all the boxes that apply:Checklist
Go over all the following points, and put an
x
in all the boxes that apply.