public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] sstate: Make image cache imagetype-specific
@ 2021-12-15 12:57 Anton Mikanovich
  2021-12-15 14:33 ` Schmidt, Adriaan
                   ` (2 more replies)
  0 siblings, 3 replies; 9+ messages in thread
From: Anton Mikanovich @ 2021-12-15 12:57 UTC (permalink / raw)
  To: isar-users; +Cc: Anton Mikanovich

Building of isar-image-base for targets qemuamd64-buster-tgz and
qemuamd64-buster-cpiogz with one bitbake call fails with:

ERROR: mc:qemuamd64-buster-tgz:isar-image-base-1.0-r0 do_rootfs: Package already staged

This is caused by sstate cache conflict for those two packages.
We need to add image type to sstate manifest data to fix the issue.

Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
---
 meta/classes/image.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
index d757256d..50ae03e6 100644
--- a/meta/classes/image.bbclass
+++ b/meta/classes/image.bbclass
@@ -9,7 +9,7 @@ STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_SUFFIX}
 STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-${IMAGE_SUFFIX}/*-*"
 
 # Sstate also needs to be machine-specific
-SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-${DISTRO_ARCH}"
+SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-${DISTRO_ARCH}-${IMAGE_SUFFIX}"
 
 IMAGE_INSTALL ?= ""
 IMAGE_FSTYPES ?= "${@ d.getVar("IMAGE_TYPE", True) if d.getVar("IMAGE_TYPE", True) else "ext4-img"}"
-- 
2.20.1


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

* RE: [PATCH] sstate: Make image cache imagetype-specific
  2021-12-15 12:57 [PATCH] sstate: Make image cache imagetype-specific Anton Mikanovich
@ 2021-12-15 14:33 ` Schmidt, Adriaan
  2021-12-16  9:22   ` Anton Mikanovich
  2021-12-17 10:53   ` Baurzhan Ismagulov
  2021-12-22 14:56 ` Anton Mikanovich
  2021-12-23 10:55 ` Anton Mikanovich
  2 siblings, 2 replies; 9+ messages in thread
From: Schmidt, Adriaan @ 2021-12-15 14:33 UTC (permalink / raw)
  To: Anton Mikanovich, isar-users

Anton Mikanovich, 15. Dezember 2021 13:58:
> Building of isar-image-base for targets qemuamd64-buster-tgz and
> qemuamd64-buster-cpiogz with one bitbake call fails with:
> 
> ERROR: mc:qemuamd64-buster-tgz:isar-image-base-1.0-r0 do_rootfs: Package
> already staged
> 
> This is caused by sstate cache conflict for those two packages.
> We need to add image type to sstate manifest data to fix the issue.

Actually, now that IMAGE_FSTYPES supports generating multiple images
with different types at once, multiconfig is the wrong way to go in
this scenario.

When creating the same two images via IMAGE_FSTYPES="targz-img cpiogz-img"
there is no problem, and we can then even go one step further and
remove the ${IMAGE_SUFFIX} completely.
Eventually, this will enable better sharing (and caching), e.g., in this
case both images are built from the same rootfs, which is what is
stored in the sstate-cache.

Also, when removing IMAGE_SUFFIX, the task-once-stamp logic from isar-events
will warn that something is wrong in case IMAGE_FSTYPES is set in
multiconfig (which is exactly what we want):

ERROR: Detect multiple executions of do_image in /work/build/tmp/work/debian-buster-amd64/isar-image-base-qemuamd64/1.0-r0
ERROR: Rerun a clean build with empty STAMPCLEAN and compare the sigdata files

Adriaan

> 
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> ---
>  meta/classes/image.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/image.bbclass b/meta/classes/image.bbclass
> index d757256d..50ae03e6 100644
> --- a/meta/classes/image.bbclass
> +++ b/meta/classes/image.bbclass
> @@ -9,7 +9,7 @@ STAMP = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-
> ${MACHINE}-${IMAGE_SUFFIX}
>  STAMPCLEAN = "${STAMPS_DIR}/${DISTRO}-${DISTRO_ARCH}/${PN}-${MACHINE}-
> ${IMAGE_SUFFIX}/*-*"
> 
>  # Sstate also needs to be machine-specific
> -SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-
> ${DISTRO_ARCH}"
> +SSTATE_MANIFESTS = "${TMPDIR}/sstate-control/${MACHINE}-${DISTRO}-
> ${DISTRO_ARCH}-${IMAGE_SUFFIX}"
> 
>  IMAGE_INSTALL ?= ""
>  IMAGE_FSTYPES ?= "${@ d.getVar("IMAGE_TYPE", True) if d.getVar("IMAGE_TYPE",
> True) else "ext4-img"}"
> --
> 2.20.1
> 
> --
> You received this message because you are subscribed to the Google Groups
> "isar-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to isar-users+unsubscribe@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/isar-users/20211215125748.299859-1-
> amikan%40ilbers.de.

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

* Re: [PATCH] sstate: Make image cache imagetype-specific
  2021-12-15 14:33 ` Schmidt, Adriaan
@ 2021-12-16  9:22   ` Anton Mikanovich
  2021-12-16 14:56     ` Jan Kiszka
  2021-12-17 10:53   ` Baurzhan Ismagulov
  1 sibling, 1 reply; 9+ messages in thread
From: Anton Mikanovich @ 2021-12-16  9:22 UTC (permalink / raw)
  To: Schmidt, Adriaan, isar-users

15.12.2021 17:33, Schmidt, Adriaan wrote:
> Actually, now that IMAGE_FSTYPES supports generating multiple images
> with different types at once, multiconfig is the wrong way to go in
> this scenario.
>
> When creating the same two images via IMAGE_FSTYPES="targz-img cpiogz-img"
> there is no problem, and we can then even go one step further and
> remove the ${IMAGE_SUFFIX} completely.
> Eventually, this will enable better sharing (and caching), e.g., in this
> case both images are built from the same rootfs, which is what is
> stored in the sstate-cache.
>
> Also, when removing IMAGE_SUFFIX, the task-once-stamp logic from isar-events
> will warn that something is wrong in case IMAGE_FSTYPES is set in
> multiconfig (which is exactly what we want):
>
> ERROR: Detect multiple executions of do_image in /work/build/tmp/work/debian-buster-amd64/isar-image-base-qemuamd64/1.0-r0
> ERROR: Rerun a clean build with empty STAMPCLEAN and compare the sigdata files
>
> Adriaan

Making different image types share the same rootfs sounds really good, 
but its separation was compelled.
Some architectural changed will be needed to make it work.

-- 
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov


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

* Re: [PATCH] sstate: Make image cache imagetype-specific
  2021-12-16  9:22   ` Anton Mikanovich
@ 2021-12-16 14:56     ` Jan Kiszka
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2021-12-16 14:56 UTC (permalink / raw)
  To: Anton Mikanovich, Schmidt, Adriaan, isar-users

On 16.12.21 10:22, Anton Mikanovich wrote:
> 15.12.2021 17:33, Schmidt, Adriaan wrote:
>> Actually, now that IMAGE_FSTYPES supports generating multiple images
>> with different types at once, multiconfig is the wrong way to go in
>> this scenario.
>>
>> When creating the same two images via IMAGE_FSTYPES="targz-img
>> cpiogz-img"
>> there is no problem, and we can then even go one step further and
>> remove the ${IMAGE_SUFFIX} completely.
>> Eventually, this will enable better sharing (and caching), e.g., in this
>> case both images are built from the same rootfs, which is what is
>> stored in the sstate-cache.
>>
>> Also, when removing IMAGE_SUFFIX, the task-once-stamp logic from
>> isar-events
>> will warn that something is wrong in case IMAGE_FSTYPES is set in
>> multiconfig (which is exactly what we want):
>>
>> ERROR: Detect multiple executions of do_image in
>> /work/build/tmp/work/debian-buster-amd64/isar-image-base-qemuamd64/1.0-r0
>> ERROR: Rerun a clean build with empty STAMPCLEAN and compare the
>> sigdata files
>>
>> Adriaan
> 
> Making different image types share the same rootfs sounds really good,
> but its separation was compelled.
> Some architectural changed will be needed to make it work.
> 

What's still missing?

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

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

* Re: [PATCH] sstate: Make image cache imagetype-specific
  2021-12-15 14:33 ` Schmidt, Adriaan
  2021-12-16  9:22   ` Anton Mikanovich
@ 2021-12-17 10:53   ` Baurzhan Ismagulov
  2021-12-17 11:24     ` Jan Kiszka
  1 sibling, 1 reply; 9+ messages in thread
From: Baurzhan Ismagulov @ 2021-12-17 10:53 UTC (permalink / raw)
  To: Isar users; +Cc: Henning Schild

On Wed, Dec 15, 2021 at 02:33:58PM +0000, Schmidt, Adriaan wrote:
> Actually, now that IMAGE_FSTYPES supports generating multiple images
> with different types at once, multiconfig is the wrong way to go in
> this scenario.

IIUC, Henning was in favor of keeping multiconfig support
(https://groups.google.com/g/isar-users/c/r91jryQ9v34/m/8OpAiNXCAgAJ), so this
patch preserves both multiconfig and multiple image types. If we have consensus
here, I'm fine with either way.

With kind regards,
Baurzhan.

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

* Re: [PATCH] sstate: Make image cache imagetype-specific
  2021-12-17 10:53   ` Baurzhan Ismagulov
@ 2021-12-17 11:24     ` Jan Kiszka
  0 siblings, 0 replies; 9+ messages in thread
From: Jan Kiszka @ 2021-12-17 11:24 UTC (permalink / raw)
  To: Isar users, Henning Schild, Schmidt, Adriaan

On 17.12.21 11:53, Baurzhan Ismagulov wrote:
> On Wed, Dec 15, 2021 at 02:33:58PM +0000, Schmidt, Adriaan wrote:
>> Actually, now that IMAGE_FSTYPES supports generating multiple images
>> with different types at once, multiconfig is the wrong way to go in
>> this scenario.
> 
> IIUC, Henning was in favor of keeping multiconfig support
> (https://groups.google.com/g/isar-users/c/r91jryQ9v34/m/8OpAiNXCAgAJ), so this
> patch preserves both multiconfig and multiple image types. If we have consensus
> here, I'm fine with either way.
> 

I assume that comment was done prior to our refactorings of the image
classes, pulling OE logic for compression support etc., things that will
make multi-format for single run way more natural and desirable.

The problem of multiplying the workdirs for different format types is
that sharing becomes impossible, and that is against the main
multiconfig goal.

Jan

-- 
Siemens AG, T RDA IOT
Corporate Competence Center Embedded Linux

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

* Re: [PATCH] sstate: Make image cache imagetype-specific
  2021-12-15 12:57 [PATCH] sstate: Make image cache imagetype-specific Anton Mikanovich
  2021-12-15 14:33 ` Schmidt, Adriaan
@ 2021-12-22 14:56 ` Anton Mikanovich
  2021-12-22 15:26   ` Schmidt, Adriaan
  2021-12-23 10:55 ` Anton Mikanovich
  2 siblings, 1 reply; 9+ messages in thread
From: Anton Mikanovich @ 2021-12-22 14:56 UTC (permalink / raw)
  To: isar-users

15.12.2021 15:57, Anton Mikanovich wrote:
> Building of isar-image-base for targets qemuamd64-buster-tgz and
> qemuamd64-buster-cpiogz with one bitbake call fails with:
>
> ERROR: mc:qemuamd64-buster-tgz:isar-image-base-1.0-r0 do_rootfs: Package already staged
>
> This is caused by sstate cache conflict for those two packages.
> We need to add image type to sstate manifest data to fix the issue.
>
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>

Does anyone against merging this first to fix the full CI, and rebuild 
workdir sharing after the release?

-- 
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov


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

* RE: [PATCH] sstate: Make image cache imagetype-specific
  2021-12-22 14:56 ` Anton Mikanovich
@ 2021-12-22 15:26   ` Schmidt, Adriaan
  0 siblings, 0 replies; 9+ messages in thread
From: Schmidt, Adriaan @ 2021-12-22 15:26 UTC (permalink / raw)
  To: Anton Mikanovich, isar-users

Anton Mikanovich, 22. Dezember 2021 15:56:
> To: isar-users <isar-users@googlegroups.com>
> Subject: Re: [PATCH] sstate: Make image cache imagetype-specific
> 
> 15.12.2021 15:57, Anton Mikanovich wrote:
> > Building of isar-image-base for targets qemuamd64-buster-tgz and
> > qemuamd64-buster-cpiogz with one bitbake call fails with:
> >
> > ERROR: mc:qemuamd64-buster-tgz:isar-image-base-1.0-r0 do_rootfs: Package
> already staged
> >
> > This is caused by sstate cache conflict for those two packages.
> > We need to add image type to sstate manifest data to fix the issue.
> >
> > Signed-off-by: Anton Mikanovich <amikan@ilbers.de>
> 
> Does anyone against merging this first to fix the full CI, and rebuild
> workdir sharing after the release?

It's fine with me. The restructuring of the imaging process will be a bigger thing we should start after the release.

Adriaan



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

* Re: [PATCH] sstate: Make image cache imagetype-specific
  2021-12-15 12:57 [PATCH] sstate: Make image cache imagetype-specific Anton Mikanovich
  2021-12-15 14:33 ` Schmidt, Adriaan
  2021-12-22 14:56 ` Anton Mikanovich
@ 2021-12-23 10:55 ` Anton Mikanovich
  2 siblings, 0 replies; 9+ messages in thread
From: Anton Mikanovich @ 2021-12-23 10:55 UTC (permalink / raw)
  To: isar-users

15.12.2021 15:57, Anton Mikanovich wrote:
> Building of isar-image-base for targets qemuamd64-buster-tgz and
> qemuamd64-buster-cpiogz with one bitbake call fails with:
>
> ERROR: mc:qemuamd64-buster-tgz:isar-image-base-1.0-r0 do_rootfs: Package already staged
>
> This is caused by sstate cache conflict for those two packages.
> We need to add image type to sstate manifest data to fix the issue.
>
> Signed-off-by: Anton Mikanovich <amikan@ilbers.de>

Applied to next.

-- 
Anton Mikanovich
Promwad Ltd.
External service provider of ilbers GmbH
Maria-Merian-Str. 8
85521 Ottobrunn, Germany
+49 (89) 122 67 24-0
Commercial register Munich, HRB 214197
General Manager: Baurzhan Ismagulov


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

end of thread, other threads:[~2021-12-23 10:55 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-12-15 12:57 [PATCH] sstate: Make image cache imagetype-specific Anton Mikanovich
2021-12-15 14:33 ` Schmidt, Adriaan
2021-12-16  9:22   ` Anton Mikanovich
2021-12-16 14:56     ` Jan Kiszka
2021-12-17 10:53   ` Baurzhan Ismagulov
2021-12-17 11:24     ` Jan Kiszka
2021-12-22 14:56 ` Anton Mikanovich
2021-12-22 15:26   ` Schmidt, Adriaan
2021-12-23 10:55 ` Anton Mikanovich

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