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

erofs: improve reproducibility of podvm images #964

Merged
merged 2 commits into from
Oct 30, 2024
Merged

Conversation

katexochen
Copy link
Member

Please verify reproducibility on your local system with

nix build .#image-podvm --builders "" &&
nix build .#image-podvm --builders "" --rebuild && 
[[ $(sha256sum result/image-podvm-gpu_1-rc1.raw | cut -d' ' -f1) == f1f9c021b2aae46771b138b603e269032e9fc6369a7ce17391cc54899e359d0f ]]

If you face reproducibility issues, try to optimise your nix store, as the issue might be related to hard linking. There is a (soft) improvement on that already in unstable (but we are currently a bit behind), but it is also a topic of future work.

nix store optimise

While this was working in v1.7.1, there was a refactoring in
https://git.kernel.org/pub/scm/linux/kernel/git/xiang/erofs-utils.git/commit/?id=0da388cfdc9dcb952c01b0755ab8a1d6d59a5312
causing the inode numbering to depend on the host fs.
This patch adds sorting to provide a stable ordering when calling readdir.

Signed-off-by: Paul Meyer <[email protected]>
@katexochen katexochen added the changelog PRs that should be part of the release notes label Oct 30, 2024
Copy link
Contributor

@msanft msanft left a comment

Choose a reason for hiding this comment

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

[12:11] msanft:☸ ms-pp_caa_cluster_aks in contrast @ p/erofs-patch [$] took 1m30s
❯ sha256sum result/image-podvm-gpu_1-rc1.raw
f1f9c021b2aae46771b138b603e269032e9fc6369a7ce17391cc54899e359d0f  result/image-podvm-gpu_1-rc1.raw

LGTM! Thanks

@katexochen katexochen mentioned this pull request Oct 30, 2024
Copy link
Contributor

@Freax13 Freax13 left a comment

Choose a reason for hiding this comment

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

:(

[freax13@laptop:~/code/contrast-3]$ sha256sum result/image-podvm-gpu_1-rc1.raw
497894fa4b8d8eb24b6bc91db3c0010843238789f5efc5c73cd8ab5d46f056cf  result/image-podvm-gpu_1-rc1.raw
[freax13@laptop:~/code/contrast-3]$ realpath result/image-podvm-gpu_1-rc1.raw
/nix/store/75i3pwrp4yf8vf0lh5d241z3b4fkdm5k-image-podvm-gpu-1-rc1/image-podvm-gpu_1-rc1.raw

@Freax13
Copy link
Contributor

Freax13 commented Oct 30, 2024

Nvm, I can't read, I didn't run nix store optimise yet. Will do and report back.

Copy link
Contributor

@burgerdev burgerdev left a comment

Choose a reason for hiding this comment

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

Reproduces after build/optimise/build.

@Freax13
Copy link
Contributor

Freax13 commented Oct 30, 2024

Should we enable auto-optimise for our CI builders?

@katexochen
Copy link
Member Author

Still not reproducible for @3u13r , but I'd say it's a step in the right direction so we merge anyway?

@katexochen katexochen merged commit fb704b4 into main Oct 30, 2024
10 checks passed
@katexochen katexochen deleted the p/erofs-patch branch October 30, 2024 14:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog PRs that should be part of the release notes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants