public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
From: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
To: isar-users@googlegroups.com
Subject: [PATCH v8 5/5] ci: add container image sample configurations
Date: Mon, 29 Mar 2021 17:56:40 +0200	[thread overview]
Message-ID: <20210329155640.62445-6-silvano.cirujano-cuesta@siemens.com> (raw)
In-Reply-To: <20210329155640.62445-1-silvano.cirujano-cuesta@siemens.com>

Add samples for the creation of container images and containerized SDKs
as well as testing configurations to the CI script.

Signed-off-by: Silvano Cirujano Cuesta <silvano.cirujano-cuesta@siemens.com>
---
 meta-isar/conf/local.conf.sample              |  3 ++
 meta-isar/conf/machine/container.conf         |  5 ++++
 .../conf/multiconfig/container-bullseye.conf  |  4 +++
 .../conf/multiconfig/container-buster.conf    |  4 +++
 .../conf/multiconfig/container-stretch.conf   |  4 +++
 scripts/ci_build.sh                           | 29 ++++++++++++++++++-
 6 files changed, 48 insertions(+), 1 deletion(-)
 create mode 100644 meta-isar/conf/machine/container.conf
 create mode 100644 meta-isar/conf/multiconfig/container-bullseye.conf
 create mode 100644 meta-isar/conf/multiconfig/container-buster.conf
 create mode 100644 meta-isar/conf/multiconfig/container-stretch.conf

diff --git a/meta-isar/conf/local.conf.sample b/meta-isar/conf/local.conf.sample
index 107496c..87ba26f 100644
--- a/meta-isar/conf/local.conf.sample
+++ b/meta-isar/conf/local.conf.sample
@@ -51,6 +51,9 @@ BBMULTICONFIG = " \
     qemuamd64-buster \
     qemuamd64-buster-tgz \
     qemuamd64-bullseye \
+    container-stretch \
+    container-buster \
+    container-bullseye \
     qemumipsel-stretch \
     qemumipsel-buster \
     qemumipsel-bullseye \
diff --git a/meta-isar/conf/machine/container.conf b/meta-isar/conf/machine/container.conf
new file mode 100644
index 0000000..367d790
--- /dev/null
+++ b/meta-isar/conf/machine/container.conf
@@ -0,0 +1,5 @@
+# This software is a part of ISAR.
+# Copyright (C) 2015-2017 ilbers GmbH
+
+IMAGE_TYPE = "container-img"
+
diff --git a/meta-isar/conf/multiconfig/container-bullseye.conf b/meta-isar/conf/multiconfig/container-bullseye.conf
new file mode 100644
index 0000000..200b241
--- /dev/null
+++ b/meta-isar/conf/multiconfig/container-bullseye.conf
@@ -0,0 +1,4 @@
+# This software is a part of ISAR.
+
+MACHINE ?= "container"
+DISTRO ?= "debian-bullseye"
diff --git a/meta-isar/conf/multiconfig/container-buster.conf b/meta-isar/conf/multiconfig/container-buster.conf
new file mode 100644
index 0000000..78b0324
--- /dev/null
+++ b/meta-isar/conf/multiconfig/container-buster.conf
@@ -0,0 +1,4 @@
+# This software is a part of ISAR.
+
+MACHINE ?= "container"
+DISTRO ?= "debian-buster"
diff --git a/meta-isar/conf/multiconfig/container-stretch.conf b/meta-isar/conf/multiconfig/container-stretch.conf
new file mode 100644
index 0000000..3ff8bcb
--- /dev/null
+++ b/meta-isar/conf/multiconfig/container-stretch.conf
@@ -0,0 +1,4 @@
+# This software is a part of ISAR.
+
+MACHINE ?= "container"
+DISTRO ?= "debian-stretch"
diff --git a/scripts/ci_build.sh b/scripts/ci_build.sh
index 3868fb6..6445b10 100755
--- a/scripts/ci_build.sh
+++ b/scripts/ci_build.sh
@@ -17,6 +17,15 @@ cd "$(dirname "$0")/.."
 # Start build in Isar tree by default
 BUILD_DIR=./build
 
+# Check dependencies
+DEPENDENCIES="umoci skopeo"
+for prog in ${DEPENDENCIES} ; do
+    if [ ! -x "$(which $prog)" ] ; then
+        echo "missing $prog in PATH, exiting" >&2
+        exit 1
+    fi
+done
+
 BB_ARGS="-v"
 
 TARGETS_SET="\
@@ -33,7 +42,8 @@ TARGETS_SET="\
             mc:qemumipsel-buster:isar-image-base \
             mc:nand-ubi-demo-buster:isar-image-ubi \
             mc:rpi-stretch:isar-image-base \
-            mc:qemuamd64-focal:isar-image-base"
+            mc:qemuamd64-focal:isar-image-base \
+            "
           # qemu-user-static of <= buster too old to build that
           # mc:qemuarm64-buster:isar-image-base
           # mc:qemuarm64-bullseye:isar-image-base
@@ -45,6 +55,12 @@ TARGETS_SET_BULLSEYE="\
     mc:qemumipsel-bullseye:isar-image-base \
 "
 
+TARGETS_CONTAINERS="\
+    mc:container-stretch:isar-image-base \
+    mc:container-buster:isar-image-base \
+    mc:container-bullseye:isar-image-base \
+"
+
 CROSS_TARGETS_SET="\
                   mc:qemuarm-stretch:isar-image-base \
                   mc:qemuarm-buster:isar-image-base \
@@ -237,3 +253,14 @@ bitbake $BB_ARGS mc:qemuamd64-stretch:isar-image-base
 mv "${LAYERDIR_isar}/scripts/lib/wic/canned-wks/sdimage-efi.wks.ci-backup" "${LAYERDIR_isar}/scripts/lib/wic/canned-wks/sdimage-efi.wks"
 mv ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img.ci-backup \
     ${BUILDDIR}/tmp/deploy/images/qemuamd64/isar-image-base-debian-stretch-qemuamd64.wic.img
+
+# Finalize with containerized images, since they remove some not-needed packages from the local.conf
+sed -i -e 's/\(IMAGE_INSTALL = .*\) example-module-${KERNEL_NAME}\(.*\)/\1\2/g' conf/local.conf
+sed -i -e 's/\(IMAGE_INSTALL = .*\) enable-fsck\(.*\)/\1\2/g' conf/local.conf
+bitbake $BB_ARGS $TARGETS_CONTAINERS
+while [ -e bitbake.sock ]; do sleep 1; done
+# and SDK container image creation
+echo 'SDK_FORMATS = "docker-archive"' >> conf/local.conf
+bitbake $BB_ARGS -c do_populate_sdk mc:container-stretch:isar-image-base
+while [ -e bitbake.sock ]; do sleep 1; done
+
-- 
2.30.2


  parent reply	other threads:[~2021-03-29 16:11 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-03-29 15:56 [PATCH v8 0/5] Add support for containerized root filesystems Silvano Cirujano Cuesta
2021-03-29 15:56 ` [PATCH v8 1/5] classes: add root filesystem containerizing class Silvano Cirujano Cuesta
2021-04-08 17:55   ` Jan Kiszka
2021-04-12  7:14     ` Silvano Cirujano Cuesta
2021-04-12  8:20     ` Silvano Cirujano Cuesta
2021-08-19 20:43   ` Bezdeka, Florian
2021-08-20  6:54     ` Jan Kiszka
2021-08-31 12:56       ` Silvano Cirujano Cuesta
2021-03-29 15:56 ` [PATCH v8 2/5] classes: add new image type 'container-img' Silvano Cirujano Cuesta
2021-03-29 15:56 ` [PATCH v8 3/5] sdk: add support for containerized sdk Silvano Cirujano Cuesta
2021-03-29 15:56 ` [PATCH v8 4/5] docs: document creation of container images Silvano Cirujano Cuesta
2021-03-29 15:56 ` Silvano Cirujano Cuesta [this message]
2021-04-02 15:18 ` [PATCH v8 0/5] Add support for containerized root filesystems Anton Mikanovich
2021-04-06  5:23   ` Silvano Cirujano Cuesta

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=20210329155640.62445-6-silvano.cirujano-cuesta@siemens.com \
    --to=silvano.cirujano-cuesta@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