public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: "Schmidt, Adriaan" <adriaan.schmidt@siemens.com>
To: "Schild, Henning" <henning.schild@siemens.com>,
	"isar-users@googlegroups.com" <isar-users@googlegroups.com>
Cc: "Moessbauer, Felix" <felix.moessbauer@siemens.com>
Subject: RE: [PATCH 1/1] sttate: change rootfs task to cache
Date: Fri, 28 Jan 2022 06:57:31 +0000	[thread overview]
Message-ID: <AS4PR10MB5318B169A2437AF7997C9AD0ED229@AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM> (raw)
In-Reply-To: <20220127201845.19319-2-henning.schild@siemens.com>

Schild, Henning (T CED SES-DE), 27. Januar 2022 21:19:

> Subject: [PATCH 1/1] sttate: change rootfs task to cache

Typo in commit msg -----^

> This patch moves sstate caching from the task "do_rootfs" to
> "do_rootfs_install". Which is earlier in the task chain.
> 
> There are two "bugs" that we fix by doing so, while hopefully not
> giving up on too much caching speed.
>  - rootfs_postprocess:
>    - image_postprocess_mark: potentially outdated BUILD_ID and friends
>    - rootfs_generate_manifest: manifest file gone missing in DEPLOY_DIR
> 
> Since rootfs_postprocess is kind of an open field it might also fix
> issues in ROOTFS_POSTPROCESS_COMMAND functions in layers. Any function
> deriving stuff (like a manifest) or changing stuff (like the mark) could
> potentially benefit from "not caching".
> 
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
>  meta/classes/rootfs.bbclass | 25 ++++++++++++-------------
>  1 file changed, 12 insertions(+), 13 deletions(-)
> 
> diff --git a/meta/classes/rootfs.bbclass b/meta/classes/rootfs.bbclass
> index 1fc487896f4d..e368244ce1ca 100644
> --- a/meta/classes/rootfs.bbclass
> +++ b/meta/classes/rootfs.bbclass
> @@ -157,6 +157,7 @@ rootfs_install_pkgs_install() {
>  do_rootfs_install[root_cleandirs] = "${ROOTFSDIR}"
>  do_rootfs_install[vardeps] += "${ROOTFS_CONFIGURE_COMMAND}
> ${ROOTFS_INSTALL_COMMAND}"
>  do_rootfs_install[depends] = "isar-bootstrap-${@'target' if
> d.getVar('ROOTFS_ARCH') == d.getVar('DISTRO_ARCH') else 'host'}:do_build"
> +do_rootfs_install[depends] += " base-apt:do_cache isar-apt:do_cache_config"
>  do_rootfs_install[recrdeptask] = "do_deploy_deb"
>  python do_rootfs_install() {
>      configure_cmds = (d.getVar("ROOTFS_CONFIGURE_COMMAND", True) or
> "").split()
> @@ -270,29 +271,27 @@ python do_rootfs() {
>  }
>  addtask rootfs before do_build
> 
> -do_rootfs[depends] = "base-apt:do_cache isar-apt:do_cache_config"

You removed that line.
I don't remember all of the details, but there were some cases where
this explicit dependency was needed when restoring from cache to
an empty tmp/ dir. Might need some testing...

Adriaan

> -
> -SSTATETASKS += "do_rootfs"
> +SSTATETASKS += "do_rootfs_install"
>  ROOTFS_SSTATE = "${WORKDIR}/rootfs-sstate"
> -do_rootfs[dirs] += "${ROOTFS_SSTATE} ${WORKDIR}/mnt/rootfs"
> -do_rootfs[cleandirs] += "${ROOTFS_SSTATE}"
> -do_rootfs[sstate-plaindirs] = "${ROOTFS_SSTATE}"
> -do_rootfs[sstate-interceptfuncs] = "rootfs_sstate_prepare"
> +do_rootfs_install[dirs] += "${ROOTFS_SSTATE} ${WORKDIR}/mnt/rootfs"
> +do_rootfs_install[cleandirs] += "${ROOTFS_SSTATE}"
> +do_rootfs_install[sstate-plaindirs] = "${ROOTFS_SSTATE}"
> +do_rootfs_install[sstate-interceptfuncs] = "rootfs_install_sstate_prepare"
> 
>  # the buildchroot is owned by root, so we need some sudoing to pack and
> unpack
> -rootfs_sstate_prepare() {
> +rootfs_install_sstate_prepare() {
>      sudo mount --bind ${WORKDIR}/rootfs ${WORKDIR}/mnt/rootfs -o ro
>      sudo tar -C ${WORKDIR}/mnt -cpf ${ROOTFS_SSTATE}/rootfs.tar --one-file-
> system rootfs
>      sudo umount ${WORKDIR}/mnt/rootfs
>  }
> -do_rootfs_sstate_prepare[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
> +do_rootfs_install_sstate_prepare[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
> 
> -rootfs_sstate_finalize() {
> +rootfs_install_sstate_finalize() {
>      sudo tar -C ${WORKDIR} -xpf ${ROOTFS_SSTATE}/rootfs.tar
>  }
> 
> -python do_rootfs_setscene() {
> +python do_rootfs_install_setscene() {
>      sstate_setscene(d)
> -    bb.build.exec_func('rootfs_sstate_finalize', d)
> +    bb.build.exec_func('rootfs_install_sstate_finalize', d)
>  }
> -addtask do_rootfs_setscene
> +addtask do_rootfs_install_setscene
> --
> 2.34.1


  reply	other threads:[~2022-01-28  6:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-27 20:18 [PATCH 0/1] sstate bug fix Henning Schild
2022-01-27 20:18 ` [PATCH 1/1] sttate: change rootfs task to cache Henning Schild
2022-01-28  6:57   ` Schmidt, Adriaan [this message]
2022-01-28  7:18     ` Henning Schild
2022-01-27 20:39 ` [PATCH 0/1] sstate bug fix Henning Schild
2022-01-28  6:24   ` Schmidt, Adriaan
2022-01-28  7:15     ` Henning Schild
2022-01-28  7:33       ` Schmidt, Adriaan
2022-01-28  8:09         ` Henning Schild
2022-01-28  9:01         ` Henning Schild
2022-01-28  7:24     ` Henning Schild
2022-01-28  7:38       ` Schmidt, Adriaan
2022-01-28  8:08         ` Henning Schild
2022-02-14  9:28 ` 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=AS4PR10MB5318B169A2437AF7997C9AD0ED229@AS4PR10MB5318.EURPRD10.PROD.OUTLOOK.COM \
    --to=adriaan.schmidt@siemens.com \
    --cc=felix.moessbauer@siemens.com \
    --cc=henning.schild@siemens.com \
    --cc=isar-users@googlegroups.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