Skip to content

Commit

Permalink
Merge branch 'task/#20993_add_github_action' into 'integration'
Browse files Browse the repository at this point in the history
add github action to build minimal image with meta-elos

See merge request elektrobit/base-os/eb-baseos-meta-elos!16
  • Loading branch information
ThomasBrinker committed Aug 26, 2024
2 parents 6ffcab7 + 43f36dd commit a45f12e
Show file tree
Hide file tree
Showing 20 changed files with 357 additions and 47 deletions.
68 changes: 68 additions & 0 deletions .github/workflows/build-elos-minimal.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@

name: Build core-image-minimal
on: [ push, workflow_dispatch, pull_request ]

env:
YOCTO_BUILD_PATH: /tmp/yocto-test-build/

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Install Build Dependencies
run: |
sudo apt-get update
sudo apt-get install -y \
build-essential \
chrpath \
cpio \
diffstat \
file \
gawk \
git \
iproute2 \
iptables \
iputils-ping \
libncurses-dev \
locales \
lz4 \
python3 \
python3-distutils \
wget \
zstd
- name: setup yocto
run: |
sudo locale-gen en_US.UTF-8
mkdir -p $YOCTO_BUILD_PATH
git clone --depth 1 -b kirkstone git://git.yoctoproject.org/poky.git $YOCTO_BUILD_PATH/poky
git clone --depth 1 -b kirkstone https://github.com/openembedded/meta-openembedded.git $YOCTO_BUILD_PATH/meta-openembedded
ln -s $(pwd) $YOCTO_BUILD_PATH/meta-elos
cd $YOCTO_BUILD_PATH
. poky/oe-init-build-env
- name: Setup meta-elos
run: |
echo 'MACHINE = "qemux86"' >> $YOCTO_BUILD_PATH/build/conf/local.conf
echo 'PACKAGECONFIG:append:pn-elos = " daemon"' >> $YOCTO_BUILD_PATH/build/conf/local.conf
echo 'IMAGE_INSTALL += "elos-daemon"' >> $YOCTO_BUILD_PATH/build/conf/local.conf
echo 'BBLAYERS += "' $YOCTO_BUILD_PATH/meta-elos/ '"' >> $YOCTO_BUILD_PATH/build/conf/bblayers.conf
echo "########### local.conf to build ###################"
cat $YOCTO_BUILD_PATH/build/conf/bblayers.conf
- name: create image
run: |
cd $YOCTO_BUILD_PATH
. poky/oe-init-build-env
bitbake-layers show-layers
bitbake elos
- name: save yocto image artifacts
uses: actions/upload-artifact@v4
with:
name: Yocto image artefacts
path: $YOCTO_BUILD_PATH/build/tmp/deploy

21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) [2023] [emlix GmbH, Elektrobit Automotive GmbH]

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@

<img src="doc/static/elos_blue.svg" width=20% height=20% align="right">

![Yocto workflow](https://github.com/Elektrobit/meta-elos/actions/workflows/build-core-image-minimal.yml/badge.svg)

elos is a tool to collect, store and publish various system events (i.e. syslogs, core dumps, measurements obtained from proc- and sys-fs, …) while providing easy access to the collected data.


Expand Down Expand Up @@ -87,10 +89,21 @@ Following plugins are added:
* scanner_syslog

## elos demos
To add the demos that are part of elos add `PACKAGECONFIG += "demos"` pull in the package "elos-demo".
To add the demos that are part of elos, either add `PACKAGECONFIG += "demos"`
to your `bbapend` file or add to your `local.conf` with
`PACKAGECONFIG:append:pn-elos = " demos"`. In any case make sure to install the
package:

```
CORE_IMAGE_EXTRA_INSTALL += "elos-demos"
```
.

The `elos-demo` package depends on additional layers:

* meta-openembedded/meta-oe/
* meta-openembedded/meta-python/
* meta-openembedded/meta-networking/

Following demos are added:
* demo_eloslog
Expand Down
4 changes: 2 additions & 2 deletions ci/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ ENV LC_ALL=en_US.UTF-8
ENV DOCKERBUILD=1
ENV BBCACHE="/home/ci/bbcache"

RUN git clone -b kirkstone git://git.yoctoproject.org/poky.git /home/$USER/layers/poky/
RUN git clone -b kirkstone git://git.openembedded.org/meta-openembedded /home/$USER/layers/meta-openembedded/
RUN git clone --depth 1 -b kirkstone git://git.yoctoproject.org/poky.git /home/$USER/layers/poky/
RUN git clone --depth 1 -b kirkstone git://git.openembedded.org/meta-openembedded /home/$USER/layers/meta-openembedded/

RUN echo ". /home/$USER/layers/poky/oe-init-build-env /base/build >/dev/null" >> /home/$USER/.bashrc

Expand Down
16 changes: 16 additions & 0 deletions ci/bblayers.conf.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
/home/ci/layers/poky/meta \
/home/ci/layers/poky/meta-poky \
/home/ci/layers/poky/meta-yocto-bsp \
/home/ci/layers/meta-openembedded/meta-oe/ \
/home/ci/layers/meta-openembedded/meta-python/ \
/home/ci/layers/meta-openembedded/meta-networking/ \
/base/ \
"
13 changes: 13 additions & 0 deletions ci/bblayers.conf.minimal
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
/home/ci/layers/poky/meta \
/home/ci/layers/poky/meta-poky \
/home/ci/layers/poky/meta-yocto-bsp \
/base/ \
"
16 changes: 16 additions & 0 deletions ci/bblayers.conf.smoketest
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
/home/ci/layers/poky/meta \
/home/ci/layers/poky/meta-poky \
/home/ci/layers/poky/meta-yocto-bsp \
/home/ci/layers/meta-openembedded/meta-oe/ \
/home/ci/layers/meta-openembedded/meta-python/ \
/home/ci/layers/meta-openembedded/meta-networking/ \
/base/ \
"
16 changes: 16 additions & 0 deletions ci/bblayers.conf.utest
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# POKY_BBLAYERS_CONF_VERSION is increased each time build/conf/bblayers.conf
# changes incompatibly
POKY_BBLAYERS_CONF_VERSION = "2"

BBPATH = "${TOPDIR}"
BBFILES ?= ""

BBLAYERS ?= " \
/home/ci/layers/poky/meta \
/home/ci/layers/poky/meta-poky \
/home/ci/layers/poky/meta-yocto-bsp \
/home/ci/layers/meta-openembedded/meta-oe/ \
/home/ci/layers/meta-openembedded/meta-python/ \
/home/ci/layers/meta-openembedded/meta-networking/ \
/base/ \
"
19 changes: 19 additions & 0 deletions ci/local.conf.benchmark
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MACHINE ??= "qemux86-64"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
CONF_VERSION = "2"
PACKAGECONFIG:append:pn-elos = " daemon tools benchmark"
CORE_IMAGE_EXTRA_INSTALL += "elos elos-daemon elos-tools elos-benchmark"
19 changes: 19 additions & 0 deletions ci/local.conf.minimal
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MACHINE ??= "qemux86-64"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
CONF_VERSION = "2"
PACKAGECONFIG:append:pn-elos = " daemon"
CORE_IMAGE_EXTRA_INSTALL += "elos-daemon"
19 changes: 19 additions & 0 deletions ci/local.conf.smoketest
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
MACHINE ??= "qemux86-64"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
CONF_VERSION = "2"
PACKAGECONFIG:append:pn-elos = " daemon demos smoketest"
CORE_IMAGE_EXTRA_INSTALL += "elos elos-daemon elos-demos elos-smoketest"
21 changes: 21 additions & 0 deletions ci/local.conf.utest
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MACHINE ??= "qemux86-64"
DISTRO ?= "poky"
PACKAGE_CLASSES ?= "package_rpm"
EXTRA_IMAGE_FEATURES ?= "debug-tweaks"
USER_CLASSES ?= "buildstats"
PATCHRESOLVE = "noop"
BB_DISKMON_DIRS ??= "\
STOPTASKS,${TMPDIR},1G,100K \
STOPTASKS,${DL_DIR},1G,100K \
STOPTASKS,${SSTATE_DIR},1G,100K \
STOPTASKS,/tmp,100M,100K \
HALT,${TMPDIR},100M,1K \
HALT,${DL_DIR},100M,1K \
HALT,${SSTATE_DIR},100M,1K \
HALT,/tmp,10M,1K"
PACKAGECONFIG:append:pn-qemu-system-native = " sdl"
CONF_VERSION = "2"
PACKAGECONFIG:append:pn-elos = " daemon demos utests"
PACKAGECONFIG:append:pn-safu = " mocks"
PACKAGECONFIG:append:pn-samconf = " utests mocks"
CORE_IMAGE_EXTRA_INSTALL += "elos elos-daemon elos-demos elos-utest"
38 changes: 38 additions & 0 deletions ci/test_build_variants.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
#!/bin/bash


CMDPATH="$(realpath "$(dirname "$0")")"
BASEDIR="${CMDPATH%/*}"

LAYERS_DIR=${LAYERS_DIR-"/home/ci/layers/"}
# setup
cd "$BASEDIR" || exit 1
. "${LAYERS_DIR}/poky/oe-init-build-env"

RESULT_FILE="$(mktemp /tmp/meta-elos-test_XXXXXX.log)"

. $HOME/layers/poky/oe-init-build-env "${BASEDIR}/build"

function test_config() {
LOCAL_CONF="$1"
BBLAYERS_CONF="$2"
cp "${LOCAL_CONF}" "${BASEDIR}/build/conf/local.conf"
cp "${BBLAYERS_CONF}" "${BASEDIR}/build/conf/bblayers.conf"
if bitbake elos; then
echo "${LOCAL_CONF}: OK" | tee -a "${RESULT_FILE}"
else
echo "${LOCAL_CONF}: FAIL" | tee -a "${RESULT_FILE}"
fi
}

test_config "${BASEDIR}/ci/local.conf" "${BASEDIR}/ci/bblayers.conf"
test_config "${BASEDIR}/ci/local.conf.minimal" "${BASEDIR}/ci/bblayers.conf.minimal"
test_config "${BASEDIR}/ci/local.conf.smoketest" "${BASEDIR}/ci/bblayers.conf.smoketest"
test_config "${BASEDIR}/ci/local.conf.utest" "${BASEDIR}/ci/bblayers.conf.utest"
test_config "${BASEDIR}/ci/local.conf.benchmark" "${BASEDIR}/ci/bblayers.conf.benchmark"

echo "###################################"
echo "Results"
echo "###################################"
cat "${RESULT_FILE}"
rm "${RESULT_FILE}"
2 changes: 1 addition & 1 deletion conf/layer.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ BBFILE_PATTERN_meta-elos = "^${LAYERDIR}/"
BBFILE_PRIORITY_meta-elos = "5"

# We need the core layer (naturally) and meta-oe from openembedded for cmocka
LAYERDEPENDS_meta-elos = "core openembedded-layer"
LAYERDEPENDS_meta-elos = "core"
LAYERSERIES_COMPAT_meta-elos = "kirkstone"

META_ELOS_SRC_REPO_BASE ?= "git://github.com/Elektrobit"
Expand Down
4 changes: 2 additions & 2 deletions recipes-core/elos/elos-src.inc
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# SPDX-License-Identifier: MIT
SRC_VERSION = "0.60.11"
SRC_VERSION = "0.62.6"
SRC_GITREF = "branch=main"
SRCREV = "71ba40e086237baa23e3cbffde866aa2c032e223"
SRCREV = "245c2ef836a675aafa56dc8b71f265aab5d5c1b0"

#uncomment to build latest version
#SRC_GITREF = "branch=main"
Expand Down
Loading

0 comments on commit a45f12e

Please sign in to comment.