diff mbox series

[yocto-autobuilder-helper,v4,1/2] config.json: Move AUH from custom scripts to config.json

Message ID 20231102152044.3433589-2-yoann.congal@smile.fr
State New
Headers show
Series Extend auto-upgrade helper to meta-openembedded | expand

Commit Message

Yoann Congal Nov. 2, 2023, 3:20 p.m. UTC
setup-auh and run-auh were doing what the AB config.json does:
* creating repo checkouts: Now use NEEDREPOS
* configuring bitbake env: Now use extravars

This refactoring is needed to prepare adding AUH meta-oe support.

Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
---
 config.json                          | 26 ++++++++++++++++++---
 scripts/auh-config/local.conf.append |  5 ----
 scripts/run-auh                      | 34 ----------------------------
 scripts/setup-auh                    | 29 ------------------------
 4 files changed, 23 insertions(+), 71 deletions(-)
 delete mode 100644 scripts/auh-config/local.conf.append
 delete mode 100755 scripts/run-auh
 delete mode 100755 scripts/setup-auh

Comments

Alexander Kanavin Nov. 3, 2023, 9:36 a.m. UTC | #1
Ka-boom:
https://autobuilder.yoctoproject.org/typhoon/#/builders/130/builds/59

Alex

On Thu, 2 Nov 2023 at 16:21, Yoann Congal <yoann.congal@smile.fr> wrote:
>
> setup-auh and run-auh were doing what the AB config.json does:
> * creating repo checkouts: Now use NEEDREPOS
> * configuring bitbake env: Now use extravars
>
> This refactoring is needed to prepare adding AUH meta-oe support.
>
> Signed-off-by: Yoann Congal <yoann.congal@smile.fr>
> ---
>  config.json                          | 26 ++++++++++++++++++---
>  scripts/auh-config/local.conf.append |  5 ----
>  scripts/run-auh                      | 34 ----------------------------
>  scripts/setup-auh                    | 29 ------------------------
>  4 files changed, 23 insertions(+), 71 deletions(-)
>  delete mode 100644 scripts/auh-config/local.conf.append
>  delete mode 100755 scripts/run-auh
>  delete mode 100755 scripts/setup-auh
>
> diff --git a/config.json b/config.json
> index 1b3c2b0..2e33c73 100644
> --- a/config.json
> +++ b/config.json
> @@ -1454,9 +1454,29 @@
>              "TEMPLATE" : "buildperf"
>          },
>          "auh" : {
> -            "EXTRAPLAINCMDS" : [
> -                "${SCRIPTSDIR}/setup-auh ${HELPERBUILDDIR}; ${SCRIPTSDIR}/run-auh ${HELPERBUILDDIR} ${WEBPUBLISH_DIR}/pub/auh/"
> -            ]
> +            "NEEDREPOS" : ["poky", "auto-upgrade-helper"],
> +            "extravars" :[
> +                "INHERIT += 'buildhistory'",
> +                "LICENSE_FLAGS_ACCEPTED = 'commercial'",
> +                "DISTRO_FEATURES:append:libc-glibc = ' systemd usrmerge'",
> +                "DISTRO_FEATURES:append = ' pam'"
> +            ],
> +            "step1" : {
> +                "shortname" : "setup AUH",
> +                "EXTRAPLAINCMDS" : [
> +                    "git config user.email auh@yoctoproject.org",
> +                    "git config user.name 'Auto Upgrade Helper'",
> +                    "git switch -C tmp-auh-upgrades HEAD",
> +                    "install -D ${SCRIPTSDIR}/auh-config/upgrade-helper.conf ./upgrade-helper/upgrade-helper.conf"
> +                ]
> +            },
> +            "step2" : {
> +                "shortname" : "run AUH",
> +                "EXTRACMDS" : [
> +                    "../auto-upgrade-helper/upgrade-helper.py -e all",
> +                    "cp -rf ./upgrade-helper/* ${WEBPUBLISH_DIR}/pub/auh/"
> +                ]
> +            }
>          },
>          "yocto-mirror" : {
>              "MACHINE" : "qemux86-64",
> diff --git a/scripts/auh-config/local.conf.append b/scripts/auh-config/local.conf.append
> deleted file mode 100644
> index ee7ee2d..0000000
> --- a/scripts/auh-config/local.conf.append
> +++ /dev/null
> @@ -1,5 +0,0 @@
> -
> -INHERIT += "buildhistory"
> -LICENSE_FLAGS_ACCEPTED = "commercial"
> -DISTRO_FEATURES:append:libc-glibc = ' systemd usrmerge'
> -DISTRO_FEATURES:append = ' pam'
> diff --git a/scripts/run-auh b/scripts/run-auh
> deleted file mode 100755
> index 0419dd1..0000000
> --- a/scripts/run-auh
> +++ /dev/null
> @@ -1,34 +0,0 @@
> -#!/bin/bash
> -#
> -# SPDX-License-Identifier: GPL-2.0-only
> -#
> -# Run Auto Upgrade Helper in a directory set up by setup_auh.
> -#
> -# Called with $1 - the directory where the setup was created
> -
> -if [ -z $1 ]; then
> -  echo "Use: $0 auh_setup_dir [publish_dir]"
> -  exit 1
> -fi
> -
> -full_dir=$(readlink -e $1)
> -
> -auh_dir=$full_dir/auto-upgrade-helper
> -poky_dir=$full_dir/poky
> -build_dir=$full_dir/build
> -sstate_dir=$full_dir/build/sstate-cache
> -
> -pushd $poky_dir
> -
> -# Base the upgrades on poky master
> -git fetch origin
> -git checkout -B tmp-auh-upgrades origin/master
> -
> -source $poky_dir/oe-init-build-env $build_dir
> -$auh_dir/upgrade-helper.py -e all
> -
> -if [ -n $2 ]; then
> -  cp -rf $build_dir/upgrade-helper/* $2
> -fi
> -
> -popd
> diff --git a/scripts/setup-auh b/scripts/setup-auh
> deleted file mode 100755
> index d6b83fe..0000000
> --- a/scripts/setup-auh
> +++ /dev/null
> @@ -1,29 +0,0 @@
> -#!/bin/bash
> -#
> -# SPDX-License-Identifier: GPL-2.0-only
> -#
> -# Initialize Auto Upgrade Helper in a directory.
> -#
> -# Called with $1 - the directory to place the setup
> -CONFIG_DIR=`dirname $0`/auh-config
> -
> -if [ -z $1 ]; then
> -  echo "Use: $0 target_dir"
> -  exit 1
> -fi
> -
> -mkdir -p $1
> -pushd $1
> -
> -git clone git://git.yoctoproject.org/poky
> -pushd poky
> -git config user.email auh@yoctoproject.org
> -git config user.name "Auto Upgrade Helper"
> -popd
> -git clone git://git.yoctoproject.org/auto-upgrade-helper
> -source poky/oe-init-build-env build
> -mkdir -p upgrade-helper
> -popd
> -
> -cp $CONFIG_DIR/upgrade-helper.conf $1/build/upgrade-helper
> -cat $CONFIG_DIR/local.conf.append >> $1/build/conf/local.conf
> --
> 2.30.2
>
>
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#61580): https://lists.yoctoproject.org/g/yocto/message/61580
> Mute This Topic: https://lists.yoctoproject.org/mt/102344544/1686489
> Group Owner: yocto+owner@lists.yoctoproject.org
> Unsubscribe: https://lists.yoctoproject.org/g/yocto/unsub [alex.kanavin@gmail.com]
> -=-=-=-=-=-=-=-=-=-=-=-
>
Alexander Kanavin Nov. 3, 2023, 9:44 a.m. UTC | #2
On Fri, 3 Nov 2023 at 10:37, Alexander Kanavin via
lists.yoctoproject.org <alex.kanavin=gmail.com@lists.yoctoproject.org>
wrote:
>
> Ka-boom:
> https://autobuilder.yoctoproject.org/typhoon/#/builders/130/builds/59

"
ERROR: Command . ./oe-init-build-env; bitbake-layers add-layer
/home/pokybuild/yocto-worker/auh/build/auto-upgrade-helper failed with
exit code 1, see errors above. (1699003823.8)
"

I'm not exactly sure, but I think this should be addressed by adding
an entry in config.json with "no-layer-add" : true (there are examples
there).

Alex
Richard Purdie Nov. 3, 2023, 10:46 a.m. UTC | #3
On Fri, 2023-11-03 at 10:44 +0100, Alexander Kanavin wrote:
> On Fri, 3 Nov 2023 at 10:37, Alexander Kanavin via
> lists.yoctoproject.org <alex.kanavin=gmail.com@lists.yoctoproject.org>
> wrote:
> > 
> > Ka-boom:
> > https://autobuilder.yoctoproject.org/typhoon/#/builders/130/builds/59
> 
> "
> ERROR: Command . ./oe-init-build-env; bitbake-layers add-layer
> /home/pokybuild/yocto-worker/auh/build/auto-upgrade-helper failed with
> exit code 1, see errors above. (1699003823.8)
> "
> 
> I'm not exactly sure, but I think this should be addressed by adding
> an entry in config.json with "no-layer-add" : true (there are examples
> there).

My changes have a piece at the end of config.json which adds the repo
and fix that issue. I'll separate out that change and add it that way.

Cheers,

Richard
diff mbox series

Patch

diff --git a/config.json b/config.json
index 1b3c2b0..2e33c73 100644
--- a/config.json
+++ b/config.json
@@ -1454,9 +1454,29 @@ 
             "TEMPLATE" : "buildperf"
         },
         "auh" : {
-            "EXTRAPLAINCMDS" : [
-                "${SCRIPTSDIR}/setup-auh ${HELPERBUILDDIR}; ${SCRIPTSDIR}/run-auh ${HELPERBUILDDIR} ${WEBPUBLISH_DIR}/pub/auh/"
-            ]
+            "NEEDREPOS" : ["poky", "auto-upgrade-helper"],
+            "extravars" :[
+                "INHERIT += 'buildhistory'",
+                "LICENSE_FLAGS_ACCEPTED = 'commercial'",
+                "DISTRO_FEATURES:append:libc-glibc = ' systemd usrmerge'",
+                "DISTRO_FEATURES:append = ' pam'"
+            ],
+            "step1" : {
+                "shortname" : "setup AUH",
+                "EXTRAPLAINCMDS" : [
+                    "git config user.email auh@yoctoproject.org",
+                    "git config user.name 'Auto Upgrade Helper'",
+                    "git switch -C tmp-auh-upgrades HEAD",
+                    "install -D ${SCRIPTSDIR}/auh-config/upgrade-helper.conf ./upgrade-helper/upgrade-helper.conf"
+                ]
+            },
+            "step2" : {
+                "shortname" : "run AUH",
+                "EXTRACMDS" : [
+                    "../auto-upgrade-helper/upgrade-helper.py -e all",
+                    "cp -rf ./upgrade-helper/* ${WEBPUBLISH_DIR}/pub/auh/"
+                ]
+            }
         },
         "yocto-mirror" : {
             "MACHINE" : "qemux86-64",
diff --git a/scripts/auh-config/local.conf.append b/scripts/auh-config/local.conf.append
deleted file mode 100644
index ee7ee2d..0000000
--- a/scripts/auh-config/local.conf.append
+++ /dev/null
@@ -1,5 +0,0 @@ 
-
-INHERIT += "buildhistory"
-LICENSE_FLAGS_ACCEPTED = "commercial"
-DISTRO_FEATURES:append:libc-glibc = ' systemd usrmerge'
-DISTRO_FEATURES:append = ' pam'
diff --git a/scripts/run-auh b/scripts/run-auh
deleted file mode 100755
index 0419dd1..0000000
--- a/scripts/run-auh
+++ /dev/null
@@ -1,34 +0,0 @@ 
-#!/bin/bash
-#
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Run Auto Upgrade Helper in a directory set up by setup_auh.
-#
-# Called with $1 - the directory where the setup was created
-
-if [ -z $1 ]; then
-  echo "Use: $0 auh_setup_dir [publish_dir]"
-  exit 1
-fi
-
-full_dir=$(readlink -e $1)
-
-auh_dir=$full_dir/auto-upgrade-helper
-poky_dir=$full_dir/poky
-build_dir=$full_dir/build
-sstate_dir=$full_dir/build/sstate-cache
-
-pushd $poky_dir
-
-# Base the upgrades on poky master
-git fetch origin
-git checkout -B tmp-auh-upgrades origin/master
-
-source $poky_dir/oe-init-build-env $build_dir
-$auh_dir/upgrade-helper.py -e all
-
-if [ -n $2 ]; then
-  cp -rf $build_dir/upgrade-helper/* $2
-fi
-
-popd
diff --git a/scripts/setup-auh b/scripts/setup-auh
deleted file mode 100755
index d6b83fe..0000000
--- a/scripts/setup-auh
+++ /dev/null
@@ -1,29 +0,0 @@ 
-#!/bin/bash
-#
-# SPDX-License-Identifier: GPL-2.0-only
-#
-# Initialize Auto Upgrade Helper in a directory.
-#
-# Called with $1 - the directory to place the setup
-CONFIG_DIR=`dirname $0`/auh-config
-
-if [ -z $1 ]; then
-  echo "Use: $0 target_dir"
-  exit 1
-fi
-
-mkdir -p $1
-pushd $1
-
-git clone git://git.yoctoproject.org/poky
-pushd poky
-git config user.email auh@yoctoproject.org
-git config user.name "Auto Upgrade Helper"
-popd
-git clone git://git.yoctoproject.org/auto-upgrade-helper
-source poky/oe-init-build-env build
-mkdir -p upgrade-helper
-popd
-
-cp $CONFIG_DIR/upgrade-helper.conf $1/build/upgrade-helper
-cat $CONFIG_DIR/local.conf.append >> $1/build/conf/local.conf