Skip to content
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

feat: docker-compose artifact delta generation #53

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

GoethalsRobbe
Copy link
Contributor

Changelog: Title
Ticket: None

@mender-test-bot
Copy link
Contributor

Merging these commits will result in the following changelog entries:

Changelogs

app-update-module (feat/docker-compose-delta)

New changes in app-update-module since master:

Features
  • docker-compose artifact delta generation

@GoethalsRobbe GoethalsRobbe force-pushed the feat/docker-compose-delta branch from bd56599 to ac28b09 Compare April 17, 2024 13:10
@GoethalsRobbe
Copy link
Contributor Author

GoethalsRobbe commented Apr 17, 2024

Hi @merlin-northern

As stated in your comment on my previous PR, these changes should allow to generate the delta from different manifests directories.
I did some local testing and these seemed to work, however, I never deployed the artifacts. Still checking how I can integrate it in our CI/CD to deploy on a device.

Please review and comment with your thoughts!

Best regards
Robbe

P.S. CI/CD testing stages succeeded, however, I think a test should be added for this scenario too?

Changelog: Title
Ticket: None
Signed-off-by: Robbe Goethals <[email protected]>
@GoethalsRobbe GoethalsRobbe force-pushed the feat/docker-compose-delta branch from ac28b09 to 78f2e62 Compare April 22, 2024 11:58
@GoethalsRobbe
Copy link
Contributor Author

Hi @merlin-northern

I was able to do some of the first testing using a CI/CD pipeline.
I'm having some trouble with the deep-delta part when updating a container's tag. When installing the created artifact, logs show image.img: No such file or directory, even when following the tutorial. After inspecting the artifact, the file is indeed not there. I'll have a look at the code for the deep delta artifact creation. If you would have any suggestions, please do let me know 😉

Installing artifact...
decompressing images
images/
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-new.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-current.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-current.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image-new.img
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image-current.img
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-new.txt
images/current-image/
images/current-image/blobs/
images/current-image/blobs/sha256/
images/current-image/blobs/sha256/5a446bb8a2191324a4121749f7383586cf68b9c15a3e63326d1708d7a564c938
images/current-image/blobs/sha256/c3a0102d2f55c8d2b7ed039faa5a5792702ef70f86c5ef1794adad3de329f9cf
images/current-image/blobs/sha256/856d2ac8192be32b3ec7fb6384c81671a4aa714607f6eaf2853502c4aa51a2a3
images/current-image/blobs/sha256/6815051712a6bbcf9dd046cec09e574d1dec001d6849ddd20968e8035dc280ab
images/current-image/blobs/sha256/bf3c9ec9aec09ee4ed7849f3515732f22b657cb1dedf14640187bfbb52e657bf
images/current-image/blobs/sha256/25de568ca4c4ad18588efd5f9fd11a3a07866ed309cd3b31123f2c8c46cd1715
images/current-image/blobs/sha256/351769e383ad665c265e87e71446ba13c498dcded6d1034c2fd0da87e1a7328e
images/current-image/blobs/sha256/66c077549480f6828d39797ca3855e6299d0c1e7daf08d67cd62320c07515ff0
images/current-image/blobs/sha256/fcd2b18432721632a4b414ef31619f36be1e7993c3e9b5987b4788e65f6ccb56
images/current-image/blobs/sha256/215296469f2cec502f2d80a0aa3347f65ee2e0563168b84a6b540f53b4970423
images/current-image/manifest.json
images/current-image/oci-layout
images/current-image/index.json
images/current-image/repositories
images/current-image/parent-child/
images/current-image/parent-child/00000/
images/new-image/
images/new-image/blobs/
images/new-image/blobs/sha256/
images/new-image/blobs/sha256/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be 
images/new-image/blobs/sha256/40e5a7ac05904d45f7c724f7b5297e773c04286fafe6ed5909811ccabfc04e4c
images/new-image/blobs/sha256/aebf07596a72256347e3562f09b0935d5be2cd71d1bdd1a97b4cfe08943582ee 
images/new-image/blobs/sha256/9a34e8eeed9c23ab53267c699c60f5ebd1223e9d0fee461bab1accd537076377 
images/new-image/blobs/sha256/f7bfdf0250f2cd09811f68840c163a9f722fb90f0d94bae1f8b206ea3ff0a419 
images/new-image/blobs/sha256/6ea18276af6810b32291ea8e7478ab90e39236ef1eefb4df82888e5746d16d54 
images/new-image/blobs/sha256/ac4d34842145233183135a3a3ddc7d2bf181b1da3023b6ca9627dd8ab946b73c 
images/new-image/blobs/sha256/7a06da8012624d2e01eb6471bca70b99822c076797f26538ef3a6de258b6e6ea 
images/new-image/blobs/sha256/db48c12559cb261ee2a7bcfe12d15757cd57f762797884b3decbef779a9e63bd 
images/new-image/blobs/sha256/80a16eb735a4a805adf93d41b9e211c41712543608e086f7a9fe931cb8d1aaf5
images/new-image/manifest.json
images/new-image/oci-layout
images/new-image/index.json
images/new-image/repositories
decompressing manifests
manifests/
manifests/docker-compose.yaml
unpacking images
unpacking /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be
xdelta3: file open failed: read: /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image.img: No such file or directory
Installation failed: Process returned non-zero exit status: ArtifactInstall: Process exited with status 1
Installation failed, and Update Module does not support rollback. System may be in an inconsistent state.

@merlin-northern
Copy link
Contributor

Hi @merlin-northern

I was able to do some of the first testing using a CI/CD pipeline. I'm having some trouble with the deep-delta part when updating a container's tag. When installing the created artifact, logs show image.img: No such file or directory, even when following the tutorial. After inspecting the artifact, the file is indeed not there. I'll have a look at the code for the deep delta artifact creation. If you would have any suggestions, please do let me know 😉

Installing artifact...
decompressing images
images/
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-new.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-current.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-current.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image-new.img
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image-current.img
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-new.txt
images/current-image/
images/current-image/blobs/
images/current-image/blobs/sha256/
images/current-image/blobs/sha256/5a446bb8a2191324a4121749f7383586cf68b9c15a3e63326d1708d7a564c938
images/current-image/blobs/sha256/c3a0102d2f55c8d2b7ed039faa5a5792702ef70f86c5ef1794adad3de329f9cf
images/current-image/blobs/sha256/856d2ac8192be32b3ec7fb6384c81671a4aa714607f6eaf2853502c4aa51a2a3
images/current-image/blobs/sha256/6815051712a6bbcf9dd046cec09e574d1dec001d6849ddd20968e8035dc280ab
images/current-image/blobs/sha256/bf3c9ec9aec09ee4ed7849f3515732f22b657cb1dedf14640187bfbb52e657bf
images/current-image/blobs/sha256/25de568ca4c4ad18588efd5f9fd11a3a07866ed309cd3b31123f2c8c46cd1715
images/current-image/blobs/sha256/351769e383ad665c265e87e71446ba13c498dcded6d1034c2fd0da87e1a7328e
images/current-image/blobs/sha256/66c077549480f6828d39797ca3855e6299d0c1e7daf08d67cd62320c07515ff0
images/current-image/blobs/sha256/fcd2b18432721632a4b414ef31619f36be1e7993c3e9b5987b4788e65f6ccb56
images/current-image/blobs/sha256/215296469f2cec502f2d80a0aa3347f65ee2e0563168b84a6b540f53b4970423
images/current-image/manifest.json
images/current-image/oci-layout
images/current-image/index.json
images/current-image/repositories
images/current-image/parent-child/
images/current-image/parent-child/00000/
images/new-image/
images/new-image/blobs/
images/new-image/blobs/sha256/
images/new-image/blobs/sha256/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be 
images/new-image/blobs/sha256/40e5a7ac05904d45f7c724f7b5297e773c04286fafe6ed5909811ccabfc04e4c
images/new-image/blobs/sha256/aebf07596a72256347e3562f09b0935d5be2cd71d1bdd1a97b4cfe08943582ee 
images/new-image/blobs/sha256/9a34e8eeed9c23ab53267c699c60f5ebd1223e9d0fee461bab1accd537076377 
images/new-image/blobs/sha256/f7bfdf0250f2cd09811f68840c163a9f722fb90f0d94bae1f8b206ea3ff0a419 
images/new-image/blobs/sha256/6ea18276af6810b32291ea8e7478ab90e39236ef1eefb4df82888e5746d16d54 
images/new-image/blobs/sha256/ac4d34842145233183135a3a3ddc7d2bf181b1da3023b6ca9627dd8ab946b73c 
images/new-image/blobs/sha256/7a06da8012624d2e01eb6471bca70b99822c076797f26538ef3a6de258b6e6ea 
images/new-image/blobs/sha256/db48c12559cb261ee2a7bcfe12d15757cd57f762797884b3decbef779a9e63bd 
images/new-image/blobs/sha256/80a16eb735a4a805adf93d41b9e211c41712543608e086f7a9fe931cb8d1aaf5
images/new-image/manifest.json
images/new-image/oci-layout
images/new-image/index.json
images/new-image/repositories
decompressing manifests
manifests/
manifests/docker-compose.yaml
unpacking images
unpacking /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be
xdelta3: file open failed: read: /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image.img: No such file or directory
Installation failed: Process returned non-zero exit status: ArtifactInstall: Process exited with status 1
Installation failed, and Update Module does not support rollback. System may be in an inconsistent state.

hey @GoethalsRobbe

I am sorry I was unable to respond this past week. is this with the current master? this bug was fixed.

@merlin-northern
Copy link
Contributor

Hi @merlin-northern

As stated in your comment on my previous PR, these changes should allow to generate the delta from different manifests directories. I did some local testing and these seemed to work, however, I never deployed the artifacts. Still checking how I can integrate it in our CI/CD to deploy on a device.

Please review and comment with your thoughts!

Best regards Robbe

P.S. CI/CD testing stages succeeded, however, I think a test should be added for this scenario too?

great to hear from you again, I will need sometime to go through this, please give me until Wed end of day.

@GoethalsRobbe
Copy link
Contributor Author

Hi @merlin-northern
As stated in your comment on my previous PR, these changes should allow to generate the delta from different manifests directories. I did some local testing and these seemed to work, however, I never deployed the artifacts. Still checking how I can integrate it in our CI/CD to deploy on a device.
Please review and comment with your thoughts!
Best regards Robbe
P.S. CI/CD testing stages succeeded, however, I think a test should be added for this scenario too?

great to hear from you again, I will need sometime to go through this, please give me until Wed end of day.

Sure, no need to hurry!

@GoethalsRobbe
Copy link
Contributor Author

Hi @merlin-northern
I was able to do some of the first testing using a CI/CD pipeline. I'm having some trouble with the deep-delta part when updating a container's tag. When installing the created artifact, logs show image.img: No such file or directory, even when following the tutorial. After inspecting the artifact, the file is indeed not there. I'll have a look at the code for the deep delta artifact creation. If you would have any suggestions, please do let me know 😉

Installing artifact...
decompressing images
images/
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-new.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-current.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-current.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image-new.img
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image-current.img
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-new.txt
images/current-image/
images/current-image/blobs/
images/current-image/blobs/sha256/
images/current-image/blobs/sha256/5a446bb8a2191324a4121749f7383586cf68b9c15a3e63326d1708d7a564c938
images/current-image/blobs/sha256/c3a0102d2f55c8d2b7ed039faa5a5792702ef70f86c5ef1794adad3de329f9cf
images/current-image/blobs/sha256/856d2ac8192be32b3ec7fb6384c81671a4aa714607f6eaf2853502c4aa51a2a3
images/current-image/blobs/sha256/6815051712a6bbcf9dd046cec09e574d1dec001d6849ddd20968e8035dc280ab
images/current-image/blobs/sha256/bf3c9ec9aec09ee4ed7849f3515732f22b657cb1dedf14640187bfbb52e657bf
images/current-image/blobs/sha256/25de568ca4c4ad18588efd5f9fd11a3a07866ed309cd3b31123f2c8c46cd1715
images/current-image/blobs/sha256/351769e383ad665c265e87e71446ba13c498dcded6d1034c2fd0da87e1a7328e
images/current-image/blobs/sha256/66c077549480f6828d39797ca3855e6299d0c1e7daf08d67cd62320c07515ff0
images/current-image/blobs/sha256/fcd2b18432721632a4b414ef31619f36be1e7993c3e9b5987b4788e65f6ccb56
images/current-image/blobs/sha256/215296469f2cec502f2d80a0aa3347f65ee2e0563168b84a6b540f53b4970423
images/current-image/manifest.json
images/current-image/oci-layout
images/current-image/index.json
images/current-image/repositories
images/current-image/parent-child/
images/current-image/parent-child/00000/
images/new-image/
images/new-image/blobs/
images/new-image/blobs/sha256/
images/new-image/blobs/sha256/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be 
images/new-image/blobs/sha256/40e5a7ac05904d45f7c724f7b5297e773c04286fafe6ed5909811ccabfc04e4c
images/new-image/blobs/sha256/aebf07596a72256347e3562f09b0935d5be2cd71d1bdd1a97b4cfe08943582ee 
images/new-image/blobs/sha256/9a34e8eeed9c23ab53267c699c60f5ebd1223e9d0fee461bab1accd537076377 
images/new-image/blobs/sha256/f7bfdf0250f2cd09811f68840c163a9f722fb90f0d94bae1f8b206ea3ff0a419 
images/new-image/blobs/sha256/6ea18276af6810b32291ea8e7478ab90e39236ef1eefb4df82888e5746d16d54 
images/new-image/blobs/sha256/ac4d34842145233183135a3a3ddc7d2bf181b1da3023b6ca9627dd8ab946b73c 
images/new-image/blobs/sha256/7a06da8012624d2e01eb6471bca70b99822c076797f26538ef3a6de258b6e6ea 
images/new-image/blobs/sha256/db48c12559cb261ee2a7bcfe12d15757cd57f762797884b3decbef779a9e63bd 
images/new-image/blobs/sha256/80a16eb735a4a805adf93d41b9e211c41712543608e086f7a9fe931cb8d1aaf5
images/new-image/manifest.json
images/new-image/oci-layout
images/new-image/index.json
images/new-image/repositories
decompressing manifests
manifests/
manifests/docker-compose.yaml
unpacking images
unpacking /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be
xdelta3: file open failed: read: /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image.img: No such file or directory
Installation failed: Process returned non-zero exit status: ArtifactInstall: Process exited with status 1
Installation failed, and Update Module does not support rollback. System may be in an inconsistent state.

hey @GoethalsRobbe

I am sorry I was unable to respond this past week. is this with the current master? this bug was fixed.

No problem at all!
It is with current master, I will check the git log for the fix...

@GoethalsRobbe
Copy link
Contributor Author

GoethalsRobbe commented Apr 29, 2024

Hi @merlin-northern
I was able to do some of the first testing using a CI/CD pipeline. I'm having some trouble with the deep-delta part when updating a container's tag. When installing the created artifact, logs show image.img: No such file or directory, even when following the tutorial. After inspecting the artifact, the file is indeed not there. I'll have a look at the code for the deep delta artifact creation. If you would have any suggestions, please do let me know 😉

Installing artifact...
decompressing images
images/
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-new.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-current.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-current.txt
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image-new.img
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image-current.img
images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-new.txt
images/current-image/
images/current-image/blobs/
images/current-image/blobs/sha256/
images/current-image/blobs/sha256/5a446bb8a2191324a4121749f7383586cf68b9c15a3e63326d1708d7a564c938
images/current-image/blobs/sha256/c3a0102d2f55c8d2b7ed039faa5a5792702ef70f86c5ef1794adad3de329f9cf
images/current-image/blobs/sha256/856d2ac8192be32b3ec7fb6384c81671a4aa714607f6eaf2853502c4aa51a2a3
images/current-image/blobs/sha256/6815051712a6bbcf9dd046cec09e574d1dec001d6849ddd20968e8035dc280ab
images/current-image/blobs/sha256/bf3c9ec9aec09ee4ed7849f3515732f22b657cb1dedf14640187bfbb52e657bf
images/current-image/blobs/sha256/25de568ca4c4ad18588efd5f9fd11a3a07866ed309cd3b31123f2c8c46cd1715
images/current-image/blobs/sha256/351769e383ad665c265e87e71446ba13c498dcded6d1034c2fd0da87e1a7328e
images/current-image/blobs/sha256/66c077549480f6828d39797ca3855e6299d0c1e7daf08d67cd62320c07515ff0
images/current-image/blobs/sha256/fcd2b18432721632a4b414ef31619f36be1e7993c3e9b5987b4788e65f6ccb56
images/current-image/blobs/sha256/215296469f2cec502f2d80a0aa3347f65ee2e0563168b84a6b540f53b4970423
images/current-image/manifest.json
images/current-image/oci-layout
images/current-image/index.json
images/current-image/repositories
images/current-image/parent-child/
images/current-image/parent-child/00000/
images/new-image/
images/new-image/blobs/
images/new-image/blobs/sha256/
images/new-image/blobs/sha256/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be 
images/new-image/blobs/sha256/40e5a7ac05904d45f7c724f7b5297e773c04286fafe6ed5909811ccabfc04e4c
images/new-image/blobs/sha256/aebf07596a72256347e3562f09b0935d5be2cd71d1bdd1a97b4cfe08943582ee 
images/new-image/blobs/sha256/9a34e8eeed9c23ab53267c699c60f5ebd1223e9d0fee461bab1accd537076377 
images/new-image/blobs/sha256/f7bfdf0250f2cd09811f68840c163a9f722fb90f0d94bae1f8b206ea3ff0a419 
images/new-image/blobs/sha256/6ea18276af6810b32291ea8e7478ab90e39236ef1eefb4df82888e5746d16d54 
images/new-image/blobs/sha256/ac4d34842145233183135a3a3ddc7d2bf181b1da3023b6ca9627dd8ab946b73c 
images/new-image/blobs/sha256/7a06da8012624d2e01eb6471bca70b99822c076797f26538ef3a6de258b6e6ea 
images/new-image/blobs/sha256/db48c12559cb261ee2a7bcfe12d15757cd57f762797884b3decbef779a9e63bd 
images/new-image/blobs/sha256/80a16eb735a4a805adf93d41b9e211c41712543608e086f7a9fe931cb8d1aaf5
images/new-image/manifest.json
images/new-image/oci-layout
images/new-image/index.json
images/new-image/repositories
decompressing manifests
manifests/
manifests/docker-compose.yaml
unpacking images
unpacking /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be
xdelta3: file open failed: read: /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image.img: No such file or directory
Installation failed: Process returned non-zero exit status: ArtifactInstall: Process exited with status 1
Installation failed, and Update Module does not support rollback. System may be in an inconsistent state.

hey @GoethalsRobbe
I am sorry I was unable to respond this past week. is this with the current master? this bug was fixed.

No problem at all! It is with current master, I will check the git log for the fix...

Hi @merlin-northern

I have not found the time yet to search for the specific commit. Do you happen to know it by hard?
Tomorrow, I should be able to make some time to investigate this.

EDIT 29/04/2024 16u28: jq was not installed in the container running the artifact creation. This fixed the error with image.img.

However, the installation of the artifact now fails with another error. I'll have look tomorrow on what is going on. The delta generation seems to be ok.

Installing artifact...
Sending status update to server
Update Module output (stdout): decompressing images
Update Module output (stdout): images/
Update Module output (stdout): images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/
Update Module output (stdout): images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-new.txt
Update Module output (stdout): images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/sums-current.txt
Update Module output (stdout): images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-current.txt
Update Module output (stdout): images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/image.img
Update Module output (stdout): images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/deep_delta
Update Module output (stdout): images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be/url-new.txt
Update Module output (stdout): decompressing manifests
Update Module output (stdout): manifests/
Update Module output (stdout): manifests/VERSION
Update Module output (stdout): manifests/README.md
Update Module output (stdout): manifests/docker-compose.yaml
Update Module output (stdout): manifests/.github/
Update Module output (stdout): manifests/.github/workflows/
Update Module output (stdout): manifests/.github/workflows/mender-artifact-pr.yml
Update Module output (stdout): manifests/.github/workflows/mender-artifact-manual.yml
Update Module output (stdout): manifests/app-gen
Update Module output (stdout): unpacking images
Update Module output (stdout): unpacking /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be
Update Module output (stdout): copying existing composition to -previous
Update Module output (stdout): renamed '/data/mender-app/vintecc_men-cdt' -> '/data/mender-app/vintecc_men-cdt-previous'
Update Module output (stdout): mkdir: created directory '/data/mender-app/vintecc_men-cdt'
Update Module output (stdout): mkdir: created directory '/data/mender-app/vintecc_men-cdt/images'
Update Module output (stdout): scanning /var/lib/mender/modules/v3/payloads/0000/tree/tmp/images/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be
Update Module output (stdout): ./
Update Module output (stdout): ./blobs/
Update Module output (stdout): ./blobs/sha256/
Update Module output (stdout): ./blobs/sha256/7a06da8012624d2e01eb6471bca70b99822c076797f26538ef3a6de258b6e6ea.vcdiff
Update Module output (stdout): ./blobs/sha256/7bf33d2be1db3d2e3269b3f7952c276cbf9c1eaddc95c629257537490f8db2be
Update Module output (stdout): ./blobs/sha256/40e5a7ac05904d45f7c724f7b5297e773c04286fafe6ed5909811ccabfc04e4c
Update Module output (stdout): ./blobs/sha256/80a16eb735a4a805adf93d41b9e211c41712543608e086f7a9fe931cb8d1aaf5.source
Update Module output (stdout): ./blobs/sha256/ac4d34842145233183135a3a3ddc7d2bf181b1da3023b6ca9627dd8ab946b73c.vcdiff
Update Module output (stdout): ./blobs/sha256/9a34e8eeed9c23ab53267c699c60f5ebd1223e9d0fee461bab1accd537076377
Update Module output (stdout): ./blobs/sha256/ac4d34842145233183135a3a3ddc7d2bf181b1da3023b6ca9627dd8ab946b73c.source
Update Module output (stdout): ./blobs/sha256/7a06da8012624d2e01eb6471bca70b99822c076797f26538ef3a6de258b6e6ea.source
Update Module output (stdout): ./blobs/sha256/80a16eb735a4a805adf93d41b9e211c41712543608e086f7a9fe931cb8d1aaf5.vcdiff
Update Module output (stdout): ./blobs/sha256/f7bfdf0250f2cd09811f68840c163a9f722fb90f0d94bae1f8b206ea3ff0a419
Update Module output (stdout): ./blobs/sha256/aebf07596a72256347e3562f09b0935d5be2cd71d1bdd1a97b4cfe08943582ee.vcdiff
Update Module output (stdout): ./blobs/sha256/6ea18276af6810b32291ea8e7478ab90e39236ef1eefb4df82888e5746d16d54
Update Module output (stdout): ./blobs/sha256/aebf07596a72256347e3562f09b0935d5be2cd71d1bdd1a97b4cfe08943582ee.source
Update Module output (stdout): ./blobs/sha256/db48c12559cb261ee2a7bcfe12d15757cd57f762797884b3decbef779a9e63bd
Update Module output (stdout): ./manifest.json
Update Module output (stdout): ./oci-layout
Update Module output (stdout): ./index.json
Update Module output (stdout): ./repositories
Update Module output (stdout): blobs/
Update Module output (stdout): blobs/sha256/
Update Module output (stdout): blobs/sha256/047f536077abb484250a9be4c43bc85d106accc31970261ce693cec37e213b4a
Update Module output (stdout): blobs/sha256/25de568ca4c4ad18588efd5f9fd11a3a07866ed309cd3b31123f2c8c46cd1715
Update Module output (stdout): blobs/sha256/351769e383ad665c265e87e71446ba13c498dcded6d1034c2fd0da87e1a7328e
Update Module output (stdout): blobs/sha256/607d48558b44c7956ff52295dd13e15805c56b31cf90a45f327187336f7d32bb
Update Module output (stdout): blobs/sha256/66c077549480f6828d39797ca3855e6299d0c1e7daf08d67cd62320c07515ff0
Update Module output (stdout): blobs/sha256/8244bd28a91ea38cf7d6d51398376ab5960e5993a73767296eb491e7d2745b03
Update Module output (stdout): blobs/sha256/bf3c9ec9aec09ee4ed7849f3515732f22b657cb1dedf14640187bfbb52e657bf
Update Module output (stdout): blobs/sha256/c3a0102d2f55c8d2b7ed039faa5a5792702ef70f86c5ef1794adad3de329f9cf
Update Module output (stdout): blobs/sha256/ce1535471914bbd907aed497ae106cfa6599e514757f1793bb945769aba46cb3
Update Module output (stdout): blobs/sha256/fcd2b18432721632a4b414ef31619f36be1e7993c3e9b5987b4788e65f6ccb56
Update Module output (stdout): index.json
Update Module output (stdout): manifest.json
Update Module output (stdout): oci-layout
Update Module output (stdout): repositories
Update Module output (stderr): open /var/lib/docker/tmp/docker-import-4094046215/blobs/sha256/ac4d34842145233183135a3a3ddc7d2bf181b1da3023b6ca9627dd8ab946b73c: no such file or directory
: Process returned non-zero exit status: ArtifactInstall: Process exited with status 1
Sending status update to server

@GoethalsRobbe
Copy link
Contributor Author

GoethalsRobbe commented May 29, 2024

@merlin-northern I did not find the time yet to investigate the issue any further. Would you have any guesses?

@merlin-northern
Copy link
Contributor

@merlin-northern I did not find the time yet to investigate the issue any further. Would you have any guesses?

yes I do. thank you for being patient. so, during past days I tested your patch and I found a bit of problems, unrelated to you code, which works flawlessly.

the error you see is a problem with delta generation. please use --deep-delta in case you see it. I have been trying to do something about it, but for now my only suggestion is: use --deep-delta during generation.

tomorrow I will give your code a review, so far I was a bit carried away with the hands-on testing. you see I needed this feature :)

Copy link
Contributor

@merlin-northern merlin-northern left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

really nice job @GoethalsRobbe . thank you. the only question is: are you willing to write a test for it, or would you prefer me to write one?

@@ -34,7 +34,7 @@ Usage: $0 [options] [-- [options-for-mender-artifact] ]
--output-path - Path to output artifact file. Default: reboot-artifact.mender
--image [current-url,]new-url - Path to output artifact file. Default: reboot-artifact.mender
--deep-delta - Calculate delta by parsing the image
--manifests-dir - Directory containing orchestrator-specific manifests describing the deployment
--manifests-dir [current-dir,]new-dir - Directory containing orchestrator-specific manifests describing the deployment
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should fix the description a bit, explaining what will happen when two paths are given.

Comment on lines +102 to +103
manifests_current_dir=$( echo "$2" | cut -f1 -d,)
manifests_new_dir=$( echo "$2" | cut -f2 -d,)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we need those spaces?

Suggested change
manifests_current_dir=$( echo "$2" | cut -f1 -d,)
manifests_new_dir=$( echo "$2" | cut -f2 -d,)
manifests_current_dir=$(echo "$2" | cut -f1 -d,)
manifests_new_dir=$(echo "$2" | cut -f2 -d,)

Comment on lines +234 to +252
for i in "${!current_images[@]}"; do
for j in "${!new_images[@]}"; do
# if it's a full match, don't include because it was already included in previous docker-compose
if [ "${current_images[i]}" == "${new_images[j]}" ]; then
unset 'current_images[i]'
unset 'new_images[j]'
continue 2
# if it's a match up until the tag, include for update
elif [ "${current_images[i]%%:*}" == "${new_images[j]%%:*}" ]; then
images+=("${current_images[i]}")
images+=("${new_images[j]}")
unset 'current_images[i]'
unset 'new_images[j]'
continue 2
fi
done
# if it isn't a match, don't include because it's removed from docker-compose
unset 'current_images[i]'
done
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. have you considered using associative arrays (with declare -A array) perhaps it would save you some trouble here? if you decide to keep it this way, I would move the ifs to [[ instead single bracket.

@merlin-northern
Copy link
Contributor

@GoethalsRobbe I consider this a very worthy contribution. if you are busy and do not have the time, please let me know if we should carry it over.

@GoethalsRobbe
Copy link
Contributor Author

GoethalsRobbe commented Jan 8, 2025

@GoethalsRobbe I consider this a very worthy contribution. if you are busy and do not have the time, please let me know if we should carry it over.

Hi @merlin-northern

I must have missed your comments on 14/10/2024. I will not be able to make time for this PR I'm afraid. In case anyone else could have a look at this, it could hopefully get merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants