-
-
Notifications
You must be signed in to change notification settings - Fork 14.4k
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
Building singularity container very slow #171551
Comments
Interesting, the following is running quickly for me:
I'll try an ubuntu machine and see what happens. |
That test ran very quickly for me as well, so I must have been wrong about what's eating the time. It must be the copy loop
I'm a bit surprised, I guess the qcow2 file doesn't preallocate the space and grows as the data gets copied in (hence why I was seeing the size of the qcow2 file grow over time). I checked the size of the references in the |
Update on some further experiments, I enabled extended l2 in the qcow file, still no faster. got the idea from https://www.youtube.com/watch?v=zJetcfDVFNw. Didn't help. I looked at the file chris@TURING:~/documents/tbi_clinical_prediction_project/code/container$ TMPDIR=/mnt/4TB-SSD/chris/.nix-tmp/ nix --cores 4 build --print-build-logs
path '/home/chris/documents/tbi_clinical_prediction_project/code/container' does not contain a 'flake.nix', searching up
warning: Git tree '/home/chris/documents/tbi_clinical_prediction_project' is dirty
singularity-image-test-container.img> Formatting '/nix/store/8a0r3fpkx0h9bbf5hsncvmcqjxahpjp0-singularity-image-test-container.img/disk-image.qcow2', fmt=qcow2 cluster_size=65536 extended_l2=on compression_type=zlib size=42949672960 lazy_refcounts=off refcount_bits=16
singularity-image-test-container.img> cSeaBIOS (version rel-1.15.0-0-g2dd4b9b3f840-prebuilt.qemu.org)
singularity-image-test-container.img> iPXE (http://ipxe.org) 00:03.0 CA00 PCI2.10 PnP PMM+BFF91140+BFEF1140 CA00
singularity-image-test-container.img> Booting from ROM...
singularity-image-test-container.img> Probing EDD (edd=off to disable)... ocloading kernel modules...
singularity-image-test-container.img> [ 0.259248] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.274746] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.277254] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.278837] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.326114] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.327768] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.332860] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.334861] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.336670] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.338596] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.346266] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.348049] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.349430] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.351276] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.352959] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.387931] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.393880] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.399981] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.405045] Module has invalid ELF structures
singularity-image-test-container.img> [ 0.408280] Module has invalid ELF structures
singularity-image-test-container.img> mounting Nix store...
singularity-image-test-container.img> mounting host's temporary directory...
singularity-image-test-container.img> starting stage 2 (/nix/store/6ziw0dr9gwcs5svd7smkm2i0c9hg69jh-vm-run-stage2)
singularity-image-test-container.img> mke2fs 1.46.5 (30-Dec-2021)
singularity-image-test-container.img> Discarding device blocks: done
singularity-image-test-container.img> Creating filesystem with 10485760 4k blocks and 2621440 inodes
singularity-image-test-container.img> Filesystem UUID: 28a69c82-1fa4-4d32-a8b9-80955184a2e7
singularity-image-test-container.img> Superblock backups stored on blocks:
singularity-image-test-container.img> 32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208,
singularity-image-test-container.img> 4096000, 7962624
singularity-image-test-container.img> Allocating group tables: done
singularity-image-test-container.img> Writing inode tables: done
singularity-image-test-container.img> Creating journal (65536 blocks): done
singularity-image-test-container.img> Writing superblocks and filesystem accounting information: done I'm wondering now if the module has invalid ELF structure could be a problem now. |
FYI, I'm refactoring the singularity-tools. #224636 |
this issue no longer applies, thanks to https://determinate.systems/posts/qemu-fix |
Describe the bug
I'm trying to generate a large singularity container (~10G of contents) and it's taking >1hr to generate the image. I have both my nix store and tmpdir set to fast ssd. Monitoring the progress is a challenge because after the
Writing superblocks and filesystem accounting information: done
message from qemu there is no output while the vm hard disk is set up.The command that's taking forever is
nixpkgs/pkgs/build-support/singularity-tools/default.nix
Line 61 in 777a4ba
Monitoring progress is very challenging, because from the view of the host system, the qcow2 file mounted there is deleted. I was able to crudely get progress my finding the pid and fd with
the qcow file will be there and listed as
(deleted)
, the size can then be checked withdoing that shows the file growing by tens or hundreds of megs a minute.
I tried tweaking the mkfs command by disabling trim with
-o nodiscard
, switching to ext4, playing with qemu arguments all with no success.Steps To Reproduce
I'm building the container using
nix build
with a flakethis builds the container using a VM with a 20G hard drive.
Expected behavior
I would expect
mkfs
, especially with-o nodiscard
to run in several minutes on my ssd, instead it runs for hours.Notify maintainers
@jbedo
Metadata
Please run
nix-shell -p nix-info --run "nix-info -m"
and paste the result.The text was updated successfully, but these errors were encountered: