public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH v2 0/3] Improving apt cache
@ 2023-01-06  6:48 Uladzimir Bely
  2023-01-06  6:48 ` [PATCH v2 1/3] Clean apt cache from debootstrapped rootfs dirs Uladzimir Bely
                   ` (3 more replies)
  0 siblings, 4 replies; 18+ messages in thread
From: Uladzimir Bely @ 2023-01-06  6:48 UTC (permalink / raw)
  To: isar-users

Currently, apt cache (e.g. `var/cache/apt/archives`) import and export
functions are not optimal. Multiple files are imported from global
DL_DIR to package WORKDIR, increasing disk IO and size needed.

Also, various chroots (bootstrap, buildchroot, sbuild chroot) include
their apt caches to sstate cache files.

This patchset switches to hardlinks instead of copies and removes apt
cache from bootstrapped images ans sstate caches.

Currently (measured on qemuarm64-bullseye cross-compilation with
maximum 8 parallel tasks (e.g. 8 CPU cores)):
- build directory size reduced from 8906 to 6675 MiB
- runtime maximum disk usage reduced from 15965 to 8501 MiB

TODO:
- cleanup other rootfs's (sbuild-chroot, buildchroot).
  Actually, this won't bring much benefit, but why not cleanup final
  rootfs's apt cache when the build finishes?
- deal with additional copying in sbuild routines (patch 3).
  We could use hardlinks instead of copying packages between upper
  layer (where sbuild temporarly keeps them) and workdir rootfs,
  but it is not expected to bring much benefit, since upper layer
  temporary nature. Additinal measurements are required.

Changes since v1:
 - Simplified cleanup of apt cache in debootstrap rootfs.
 - Now "ln" instead of "cp -l" used.
 - Removed apt cache contents from sstate cache. The idea is proposed
in patch 3, but it was reworked and fixed. Firstly, CACHEDIR.TAG can't
be just a file (e.g. created by 'touch'), it should include some
specific signature [1]. Secondly, it's easier to just create this tag
in bootstrapped rootfs and it will be automatically used in all
derivatives (sbuild-chroot/buildchroot/image). So, the original patch
from Roberto A. Foglietta was simplified.

This patchset includes (or absorbs) the logic from p1..p3 patches of
the series Roberto prosposed. What concerns additional patches, they
don't let us benefit much, but require quite significant changes
in Isar, so we should check twice if they are worth including.

[1] https://bford.info/cachedir/
- 

Roberto A. Foglietta (1):
  Changes for a faster build using less disk space

Uladzimir Bely (2):
  Clean apt cache from debootstrapped rootfs dirs
  Use hardlinks in deb-dl-dir functions

 meta/classes/deb-dl-dir.bbclass                     |  6 +++---
 meta/classes/rootfs.bbclass                         |  3 ++-
 meta/recipes-core/isar-bootstrap/isar-bootstrap.inc | 10 +++++++++-
 3 files changed, 14 insertions(+), 5 deletions(-)

-- 
2.20.1


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2023-01-20  7:23 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-01-06  6:48 [PATCH v2 0/3] Improving apt cache Uladzimir Bely
2023-01-06  6:48 ` [PATCH v2 1/3] Clean apt cache from debootstrapped rootfs dirs Uladzimir Bely
2023-01-06  6:48 ` [PATCH v2 2/3] Use hardlinks in deb-dl-dir functions Uladzimir Bely
2023-01-06  6:48 ` [PATCH v2 3/3] Changes for a faster build using less disk space Uladzimir Bely
2023-01-06 15:58   ` Henning Schild
2023-01-06 17:38     ` Uladzimir Bely
2023-01-06 17:52       ` Roberto A. Foglietta
2023-01-06 18:11       ` Henning Schild
2023-01-09  6:32 ` [PATCH v2 0/3] Improving apt cache Moessbauer, Felix
2023-01-09  7:39   ` Uladzimir Bely
2023-01-19  7:36     ` Uladzimir Bely
2023-01-19 14:52       ` Roberto A. Foglietta
2023-01-19 16:30         ` Roberto A. Foglietta
2023-01-20  4:44         ` Uladzimir Bely
2023-01-20  5:08           ` Moessbauer, Felix
2023-01-20  7:01             ` Uladzimir Bely
2023-01-20  7:12               ` Roberto A. Foglietta
2023-01-20  7:23                 ` Uladzimir Bely

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox