From: Henning Schild <henning.schild@siemens.com>
To: <isar-users@googlegroups.com>,
"PFEFFERL, JOHANN" <johann.pfefferl@siemens.com>
Subject: Re: [PATCH 3/3] classes: image: remove populate and replace it with a custom repo
Date: Wed, 9 Aug 2017 08:21:09 +0200 [thread overview]
Message-ID: <20170809082109.549bf091@md1em3qc> (raw)
In-Reply-To: <f482a9c7a64e79b1206fa4f947aa23dbc2107b1a.1501600807.git.henning.schild@siemens.com>
Hey,
Hans pointed out that this one effectively doubles build-times. That is
because we do multistrap two times. Once for the buildchroot and one
for the rootfs. Without this patch these two run in parallel, with it
they are serialized because the rootfs can only start once all .debs
are ready.
He suggested building a repo, very much like mine, but replace "dpdk
-i" in do_populate with "apt-get install". This way only do_populate of
rootfs has to wait for buildchroot doing its stuff and multistrap can
already run in the background.
But i still think we should feed the debs into multistrap
- we introduce an important policy "the only way into the rootfs is
multistrap"
- that is very likely to help with the reproducible builds
- that reduces all fetching/internet access to multistrap and the
recipes build in chroot
- build times will still be very short compared to Yocto
To address the performance problem we should first look at what is
taking multistrap so long, the downloading or the installing. And
then look into caching:
- make the second multistrap use the files downloaded by the first
- keep the buildchroot across builds
- keep all remote .debs acroos builds
Henning
Am Tue, 1 Aug 2017 17:24:08 +0200
schrieb Henning Schild <henning.schild@siemens.com>:
> Create a custom Debian repository and give that to multistrap. That
> way multistrap can take care of our dependencies and we do not force
> in packages with "dpdk -i" anymore.
> The only way stuff gets into the rootfs is debian packages installed
> by multistrap. Plus whatever the configscripts do.
>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> .../recipes-core/images/files/multistrap.conf.in | 10 +++++-
> meta/classes/ext4-img.bbclass | 2 +-
> meta/classes/image.bbclass | 37
> ++++++++++------------ 3 files changed, 26 insertions(+), 23
> deletions(-)
>
> diff --git a/meta-isar/recipes-core/images/files/multistrap.conf.in
> b/meta-isar/recipes-core/images/files/multistrap.conf.in index
> 2d08c36..fd24baa 100644 ---
> a/meta-isar/recipes-core/images/files/multistrap.conf.in +++
> b/meta-isar/recipes-core/images/files/multistrap.conf.in @@ -4,7 +4,7
> @@ [General]
> noauth=true
> unpack=true
> -bootstrap=##DISTRO##
> +bootstrap=##DISTRO## Isar
> aptsources=##DISTRO##
> configscript=##CONFIG_SCRIPT##
> setupscript=##SETUP_SCRIPT##
> @@ -16,3 +16,11 @@ suite=##DISTRO_SUITE##
> components=##DISTRO_COMPONENTS##
> packages=##IMAGE_PREINSTALL##
> omitdebsrc=true
> +
> +[Isar]
> +packages=##IMAGE_INSTALL##
> +source=##DEPLOY_DIR_DEB##
> +suite=./
> +components=
> +omitdebsrc=true
> +
> diff --git a/meta/classes/ext4-img.bbclass
> b/meta/classes/ext4-img.bbclass index 61699b8..430032c 100644
> --- a/meta/classes/ext4-img.bbclass
> +++ b/meta/classes/ext4-img.bbclass
> @@ -36,4 +36,4 @@ do_ext4_image() {
> fi
> }
>
> -addtask ext4_image before do_build after do_populate
> +addtask ext4_image before do_build after do_configure
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index ab3d1ff..d9bd879 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -9,6 +9,18 @@ IMAGE_INSTALL ?= ""
> WORKDIR = "${TMPDIR}/work/${PN}/${MACHINE}"
> S = "${WORKDIR}/rootfs"
>
> +do_repository() {
> + if [ -n "${IMAGE_INSTALL}" ]; then
> + cd ${DEPLOY_DIR_DEB}
> + sudo dpkg-scanpackages . > Packages
> + sudo gzip Packages
> + fi
> +}
> +
> +addtask repository before do_build
> +do_repository[deptask] = "do_build"
> +do_repository[stamp-extra-info] = "${MACHINE}"
> +
> do_multistrap_conf() {
> # Copy config file
> install -m 644 ${FILESDIR}/multistrap.conf.in
> ${WORKDIR}/multistrap.conf @@ -33,9 +45,11 @@ do_multistrap_conf() {
> ${WORKDIR}/multistrap.conf
> sed -i
> 's|##DIR_HOOKS##|./tmp/work/${PN}/${MACHINE}/hooks_multistrap|' \
> ${WORKDIR}/multistrap.conf
> + sed -i 's|##DEPLOY_DIR_DEB##|copy:///${DEPLOY_DIR_DEB}|'
> ${WORKDIR}/multistrap.conf
> + sed -i 's|##IMAGE_INSTALL##|${IMAGE_INSTALL}|'
> ${WORKDIR}/multistrap.conf }
>
> -addtask multistrap_conf before do_build
> +addtask multistrap_conf after do_repository before do_build
> do_multistrap_conf[stamp-extra-info] = "${MACHINE}"
> do_multistrap_conf[dirs] = "${WORKDIR}/hooks_multistrap"
>
> @@ -44,7 +58,7 @@ do_multistrap() {
>
> # Create root filesystem
> sudo multistrap -a ${DISTRO_ARCH} -d "${S}" -f \
> - "${WORKDIR}/multistrap.conf" || true
> + "${WORKDIR}/multistrap.conf"
> }
>
> addtask multistrap after do_multistrap_conf before do_build
> @@ -60,22 +74,3 @@ do_configure() {
>
> addtask configure after do_multistrap before do_build
> do_configure[stamp-extra-info] = "${MACHINE}"
> -
> -# Install Debian packages, that were built from sources
> -do_populate() {
> - if [ -n "${IMAGE_INSTALL}" ]; then
> - sudo mkdir -p ${S}/deb
> -
> - for p in ${IMAGE_INSTALL}; do
> - sudo cp ${DEPLOY_DIR_DEB}/${p}_*.deb ${S}/deb
> - done
> -
> - sudo chroot ${S} /usr/bin/dpkg -i -R /deb
> -
> - sudo rm -rf ${S}/deb
> - fi
> -}
> -
> -addtask populate after do_configure before do_build
> -do_populate[deptask] = "do_build"
> -do_populate[stamp-extra-info] = "${MACHINE}"
next prev parent reply other threads:[~2017-08-09 6:19 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-08-01 15:24 [PATCH 0/3] use local repo for multistrap and drop "dpkg -i" Henning Schild
2017-08-01 15:24 ` [PATCH 1/3] classes: images: remove cyclic "inherit" Henning Schild
2017-08-01 15:24 ` [PATCH 2/3] classes: move rootfs into image class and split into tasks Henning Schild
2017-08-01 15:24 ` [PATCH 3/3] classes: image: remove populate and replace it with a custom repo Henning Schild
2017-08-09 6:21 ` Henning Schild [this message]
2017-08-02 6:16 ` [PATCH 0/3] use local repo for multistrap and drop "dpkg -i" Jan Kiszka
2017-08-02 7:04 ` Claudius Heine
2017-08-02 8:15 ` Henning Schild
2017-08-02 8:11 ` Henning Schild
2017-08-02 8:12 ` Henning Schild
2017-08-03 19:17 ` Henning Schild
2017-08-10 12:46 ` Baurzhan Ismagulov
2017-08-11 8:13 ` Henning Schild
2017-08-11 15:36 ` Baurzhan Ismagulov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170809082109.549bf091@md1em3qc \
--to=henning.schild@siemens.com \
--cc=isar-users@googlegroups.com \
--cc=johann.pfefferl@siemens.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox