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

singularity-tools.buildImage: non-deterministic #279250

Open
5 tasks
SomeoneSerge opened this issue Jan 6, 2024 · 1 comment
Open
5 tasks

singularity-tools.buildImage: non-deterministic #279250

SomeoneSerge opened this issue Jan 6, 2024 · 1 comment

Comments

@SomeoneSerge
Copy link
Contributor

SomeoneSerge commented Jan 6, 2024

Steps To Reproduce

❯ nix build -f '<nixpkgs>' apptainer.tests.image-hello-cowsay --print-out-paths
/nix/store/yxznakyhiwzvy5w1v7yr8hmjih2c5dlx-apptainer-image-hello-cowsay.img
❯ nix build -f '<nixpkgs>' apptainer.tests.image-hello-cowsay --print-out-paths --rebuild
error: derivation '/nix/store/v5xq9nyw68f8l5dy1wj95psqpz3faf4i-apptainer-image-hello-cowsay.img.drv' may not be deterministic: output '/nix/store/yxznakyhiwzvy5w1v7yr8hmjih2c5dlx-apptainer-image-hello-cowsay.img' differs

Known impurities, assuming we've just run nix build .#apptainer.tests.image-hello-cowsay:

  • The sif "header", observed by apptainer inspect ./result
  • Labels inside the JSON.Generic "data" section, as seen via apptainer sif list ./result, apptainer sif dump 2 ./result
    ❯ read JSON_LAYER < <(apptainer sif list ./result | grep JSON | cut -d" " -f1)
    ❯ apptainer sif dump "$JSON_LAYER" ./result  | jq '.data.attributes.labels."org.label-schema.build-date"'
    
    • build-arch?
  • .singularity.d/labels.json inside the squashfs section?
  • One of the above did contain random UUIDs, iirc

Expected behavior

Identical hashes

Additional context

Add any other context about the problem here.

Notify maintainers

@ShamrockLee

Metadata

Please run nix-shell -p nix-info --run "nix-info -m" and paste the result.

nix-shell -p nix-info --run "nix-info -m"
 - system: `"x86_64-linux"`
 - host os: `Linux 6.1.69, NixOS, 24.05 (Uakari), 24.05.20231224.5f64a12`
 - multi-user?: `yes`
 - sandbox: `yes`
 - version: `nix-env (Nix) 2.19.2`
 - channels(ss): `"nixgl"`
 - channels(root): `"nixgl, nixos-21.05.2132.733682c3292"`
 - nixpkgs: `/nix/store/5acdh8xyry0kdvp6xla2hw7wf3zkphkl-source`

@ShamrockLee


Add a 👍 reaction to issues you find important.

@SomeoneSerge SomeoneSerge added the 0.kind: bug Something is broken label Jan 6, 2024
@SomeoneSerge
Copy link
Contributor Author

SomeoneSerge commented Mar 19, 2024

A prospective solution is to patch apptainer and/or sif-tool to clean out (conditionally) the impurities (UUIDs and timestamps). Note that spoofing the time isn't feasible because golang doesn't use libc

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

No branches or pull requests

1 participant