Skip to content

Commit 72bfd2f

Browse files
authored
Merge pull request #142 from SoftwareDefinedVehicle/main
Self Update Agent container via BitBake
2 parents e572498 + f9516fb commit 72bfd2f

File tree

10 files changed

+146
-227
lines changed

10 files changed

+146
-227
lines changed
Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# /********************************************************************************
2+
# * Copyright (c) 2023 Contributors to the Eclipse Foundation
3+
# *
4+
# * See the NOTICE file(s) distributed with this work for additional
5+
# * information regarding copyright ownership.
6+
# *
7+
# * This program and the accompanying materials are made available under the
8+
# * terms of the Apache License 2.0 which is available at
9+
# * https://www.apache.org/licenses/LICENSE-2.0
10+
# *
11+
# * SPDX-License-Identifier: Apache-2.0
12+
# ********************************************************************************/
13+
14+
name: Build SDV application container images
15+
on:
16+
pull_request:
17+
workflow_dispatch:
18+
19+
jobs:
20+
build-container-images:
21+
name: Build Container Images
22+
runs-on: ubuntu-22.04
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v3
26+
27+
- name: Update apt
28+
run: sudo apt-get update -y
29+
30+
- name: Install tools
31+
run: sudo apt-get install -y --no-install-recommends socat file gawk wget git diffstat unzip texinfo gcc build-essential chrpath socat cpio python3 python3-pip python3-pexpect xz-utils debianutils iputils-ping python3-git python3-jinja2 libegl1-mesa libsdl1.2-dev pylint xterm python3-subunit mesa-common-dev zstd liblz4-tool tmux mc skopeo fdisk ruby-full jq libvirt-clients libvirt-daemon-system qemu-system-x86 qemu-system-arm qemu-kvm squashfs-tools rauc python3-newt ca-certificates curl gnupg lsb-release
32+
33+
- name: Install kas
34+
run: sudo pip3 install kas
35+
36+
- name: Cache Downloads
37+
id: cache-downloads
38+
uses: actions/cache@v3
39+
with:
40+
path: build/downloads
41+
key: bb-downloads
42+
43+
- name: Cache SState
44+
id: cache-sstate
45+
uses: actions/cache@v3
46+
with:
47+
path: build/sstate-cache
48+
key: bb-sstate-cache
49+
50+
- name: Cache Local
51+
id: cache-local
52+
uses: actions/cache@v3
53+
with:
54+
path: build/cache
55+
key: bb-cache-local
56+
57+
- name: Build container images for QEMU x86-64
58+
run: kas build kas/.config-kirkstone.yaml --target packagegroup-sdv-container-images
59+
60+
- name: Upload QEMU x86-64 images
61+
uses: actions/upload-artifact@v3
62+
with:
63+
name: AppContainerImages_QEMUx86-64
64+
if-no-files-found: error
65+
path: build/tmp/deploy/images/qemux86-64/*qemux86-64-oci.tar
66+
67+
- name: Build container images for Raspberry Pi 4
68+
run: kas build kas/.config-kirkstone-rpi4.yaml --target packagegroup-sdv-container-images
69+
70+
- name: Upload Raspberry Pi 4 (64bit) images
71+
uses: actions/upload-artifact@v3
72+
with:
73+
name: AppContainerImages_RaspberryPi4-64
74+
if-no-files-found: error
75+
path: build/tmp/deploy/images/raspberrypi4-64/*raspberrypi4-64-oci.tar

kas/.config-kirkstone-rpi4.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,4 @@ repos:
7979
meta-leda-bsp:
8080
meta-leda-components:
8181
meta-leda-distro:
82+
meta-leda-distro-container:

kas/.config-kirkstone.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,3 +79,4 @@ repos:
7979
meta-leda-bsp:
8080
meta-leda-components:
8181
meta-leda-distro:
82+
meta-leda-distro-container:

kas/.config-master.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,3 +71,4 @@ repos:
7171
meta-leda-bsp:
7272
meta-leda-components:
7373
meta-leda-distro:
74+
meta-leda-distro-container:

meta-leda-distro-container/recipes-sdv/images/sdv-image-container.bb

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ IMAGE_INSTALL = " \
3030

3131
# If the following is configured in local.conf (or the distro):
3232
# PACKAGE_EXTRA_ARCHS:append = " container-dummy-provides"
33-
#
33+
#
3434
# it has been explicitly # indicated that we don't want or need a shell, so we'll
3535
# add the dummy provides.
36-
#
36+
#
3737
# This is required, since there are postinstall scripts in base-files and base-passwd
3838
# that reference /bin/sh and we'll get a rootfs error if there's no shell or no dummy
3939
# provider.
@@ -49,3 +49,18 @@ rootfs_fixup_var_volatile () {
4949
install -m 755 -d ${IMAGE_ROOTFS}/${localstatedir}/volatile/log
5050
}
5151

52+
# create stable symlinks to the latest container image
53+
IMAGE_CMD:append:oci() {
54+
cd ${IMGDEPLOYDIR}
55+
56+
if [ -n "${OCI_IMAGE_TAR_OUTPUT}" ]; then
57+
58+
cd $image_name
59+
tar -cf "../$image_name.tar" *
60+
cd -
61+
62+
ln -sf "$image_name.tar" "${IMAGE_BASENAME}-${MACHINE}-oci.tar"
63+
fi
64+
65+
ln -sf $image_name ${IMAGE_BASENAME}-${MACHINE}-oci
66+
}
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# /********************************************************************************
2+
# * Copyright (c) 2023 Contributors to the Eclipse Foundation
3+
# *
4+
# * See the NOTICE file(s) distributed with this work for additional
5+
# * information regarding copyright ownership.
6+
# *
7+
# * This program and the accompanying materials are made available under the
8+
# * terms of the Apache License 2.0 which is available at
9+
# * https://www.apache.org/licenses/LICENSE-2.0
10+
# *
11+
# * SPDX-License-Identifier: Apache-2.0
12+
# ********************************************************************************/
13+
14+
SUMMARY = "SDV application container images"
15+
DESCRIPTION = "Packages creating application images to be run as containers"
16+
17+
inherit packagegroup
18+
19+
RDEPENDS:${PN} = "\
20+
self-update-agent-container \
21+
"

meta-leda-distro-container/recipes-sdv/sdv-containers/cloudagent-container_git.bb

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,11 @@
1313

1414
SUMMARY = "SDV Cloud Connector container image"
1515
DESCRIPTION = "Docker container of the Eclipse Kanto Cloud Connector for IoT Suite"
16-
17-
SRC_URI += "file://LICENSE"
18-
19-
# According to https://wiki.yoctoproject.org/wiki/License_Infrastructure_Interest_Group
2016
LICENSE = "Apache-2.0"
21-
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=d9fc0efef5228704e7f5b37f27192723"
17+
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
2218

23-
# Ensure we're building a container image
2419
include images/sdv-image-container.bb
2520

26-
# Shell may be needed
2721
IMAGE_INSTALL += " \
2822
busybox \
2923
kanto-suite-connector \

meta-leda-distro-container/recipes-sdv/sdv-containers/cyclonedds-example-container_0.1.bb

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
SUMMARY = "SDV container images to demonstrate CycloneDDS"
1515
DESCRIPTION ="The resulting image contains all the python examples from the CycloneDDS project"
1616
LICENSE = "Apache-2.0"
17-
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
17+
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"
1818

1919
require ../images/sdv-image-container.bb
2020

@@ -25,18 +25,3 @@ IMAGE_INSTALL += " \
2525
"
2626

2727
OCI_IMAGE_TAG = "cyclonedds-example:${PV}"
28-
29-
IMAGE_CMD:append:oci() {
30-
cd ${IMGDEPLOYDIR}
31-
32-
if [ -n "${OCI_IMAGE_TAR_OUTPUT}" ]; then
33-
34-
cd $image_name
35-
tar -cf "../$image_name.tar" *
36-
cd -
37-
38-
ln -sf "$image_name.tar" "${IMAGE_BASENAME}-${MACHINE}-oci.tar"
39-
fi
40-
41-
ln -sf $image_name ${IMAGE_BASENAME}-${MACHINE}-oci
42-
}

meta-leda-distro-container/recipes-sdv/sdv-containers/files/LICENSE

Lines changed: 0 additions & 202 deletions
This file was deleted.

0 commit comments

Comments
 (0)