eth-cscs / uenv2

BSD 3-Clause "New" or "Revised" License
1 stars 3 forks source link

`uenv image add` fails when referencing internal store.squashfs #15

Open finkandreas opened 3 weeks ago

finkandreas commented 3 weeks ago

I tried the following:

uenv image add wombat/v2:test@eiger%zen2 $SCRATCH/my_store.squashfs
uenv image add wombat/v2:1234@eiger%zen2 $(uenv image inspect --format '{sqfs}' wombat/v2:test@eiger%zen2

This command takes some time and then fails with the exception:

[warning] a uenv with the same sha c76fad212c777cc7ba90ce8d1efade79b76bd7afaf1696aaf4e560c0750b2ec7 is already in the repo
terminate called after throwing an instance of 'std::filesystem::__cxx11::filesystem_error'
  what():  filesystem error: cannot get file time: No such file or directory [.uenv-images-ci-eiger-tds/images/c76fad212c777cc7ba90ce8d1efade79b76bd7afaf1696aaf4e560c0750b2ec7/store.squashfs]
Aborted
bcumming commented 2 weeks ago

The fix is to check whether an image with the same sha256 exists, and make the "delete-then-copy" a noop if it does, while still updating the label in the database if needed.