Skip to content

Commit

Permalink
Merge pull request #38 from SoftwareDefinedVehicle/yocto-oci-containers
Browse files Browse the repository at this point in the history
Build yocto OCI containers
  • Loading branch information
mikehaller authored Mar 8, 2023
2 parents e572498 + b904988 commit f9516fb
Show file tree
Hide file tree
Showing 10 changed files with 146 additions and 227 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build-container-images.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
# /********************************************************************************
# * Copyright (c) 2023 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

name: Build SDV application container images
on:
pull_request:
workflow_dispatch:

jobs:
build-container-images:
name: Build Container Images
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Update apt
run: sudo apt-get update -y

- name: Install tools
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

- name: Install kas
run: sudo pip3 install kas

- name: Cache Downloads
id: cache-downloads
uses: actions/cache@v3
with:
path: build/downloads
key: bb-downloads

- name: Cache SState
id: cache-sstate
uses: actions/cache@v3
with:
path: build/sstate-cache
key: bb-sstate-cache

- name: Cache Local
id: cache-local
uses: actions/cache@v3
with:
path: build/cache
key: bb-cache-local

- name: Build container images for QEMU x86-64
run: kas build kas/.config-kirkstone.yaml --target packagegroup-sdv-container-images

- name: Upload QEMU x86-64 images
uses: actions/upload-artifact@v3
with:
name: AppContainerImages_QEMUx86-64
if-no-files-found: error
path: build/tmp/deploy/images/qemux86-64/*qemux86-64-oci.tar

- name: Build container images for Raspberry Pi 4
run: kas build kas/.config-kirkstone-rpi4.yaml --target packagegroup-sdv-container-images

- name: Upload Raspberry Pi 4 (64bit) images
uses: actions/upload-artifact@v3
with:
name: AppContainerImages_RaspberryPi4-64
if-no-files-found: error
path: build/tmp/deploy/images/raspberrypi4-64/*raspberrypi4-64-oci.tar
1 change: 1 addition & 0 deletions kas/.config-kirkstone-rpi4.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ repos:
meta-leda-bsp:
meta-leda-components:
meta-leda-distro:
meta-leda-distro-container:
1 change: 1 addition & 0 deletions kas/.config-kirkstone.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -79,3 +79,4 @@ repos:
meta-leda-bsp:
meta-leda-components:
meta-leda-distro:
meta-leda-distro-container:
1 change: 1 addition & 0 deletions kas/.config-master.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,3 +71,4 @@ repos:
meta-leda-bsp:
meta-leda-components:
meta-leda-distro:
meta-leda-distro-container:
Original file line number Diff line number Diff line change
Expand Up @@ -30,10 +30,10 @@ IMAGE_INSTALL = " \

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

# create stable symlinks to the latest container image
IMAGE_CMD:append:oci() {
cd ${IMGDEPLOYDIR}

if [ -n "${OCI_IMAGE_TAR_OUTPUT}" ]; then

cd $image_name
tar -cf "../$image_name.tar" *
cd -

ln -sf "$image_name.tar" "${IMAGE_BASENAME}-${MACHINE}-oci.tar"
fi

ln -sf $image_name ${IMAGE_BASENAME}-${MACHINE}-oci
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# /********************************************************************************
# * Copyright (c) 2023 Contributors to the Eclipse Foundation
# *
# * See the NOTICE file(s) distributed with this work for additional
# * information regarding copyright ownership.
# *
# * This program and the accompanying materials are made available under the
# * terms of the Apache License 2.0 which is available at
# * https://www.apache.org/licenses/LICENSE-2.0
# *
# * SPDX-License-Identifier: Apache-2.0
# ********************************************************************************/

SUMMARY = "SDV application container images"
DESCRIPTION = "Packages creating application images to be run as containers"

inherit packagegroup

RDEPENDS:${PN} = "\
self-update-agent-container \
"
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,11 @@

SUMMARY = "SDV Cloud Connector container image"
DESCRIPTION = "Docker container of the Eclipse Kanto Cloud Connector for IoT Suite"

SRC_URI += "file://LICENSE"

# According to https://wiki.yoctoproject.org/wiki/License_Infrastructure_Interest_Group
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=d9fc0efef5228704e7f5b37f27192723"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

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

# Shell may be needed
IMAGE_INSTALL += " \
busybox \
kanto-suite-connector \
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
SUMMARY = "SDV container images to demonstrate CycloneDDS"
DESCRIPTION ="The resulting image contains all the python examples from the CycloneDDS project"
LICENSE = "Apache-2.0"
LIC_FILES_CHKSUM = "file://${WORKDIR}/LICENSE;md5=3b83ef96387f14655fc854ddc3c6bd57"
LIC_FILES_CHKSUM = "file://${COMMON_LICENSE_DIR}/Apache-2.0;md5=89aea4e17d99a7cacdbeed46a0096b10"

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

Expand All @@ -25,18 +25,3 @@ IMAGE_INSTALL += " \
"

OCI_IMAGE_TAG = "cyclonedds-example:${PV}"

IMAGE_CMD:append:oci() {
cd ${IMGDEPLOYDIR}

if [ -n "${OCI_IMAGE_TAR_OUTPUT}" ]; then

cd $image_name
tar -cf "../$image_name.tar" *
cd -

ln -sf "$image_name.tar" "${IMAGE_BASENAME}-${MACHINE}-oci.tar"
fi

ln -sf $image_name ${IMAGE_BASENAME}-${MACHINE}-oci
}
202 changes: 0 additions & 202 deletions meta-leda-distro-container/recipes-sdv/sdv-containers/files/LICENSE

This file was deleted.

Loading

0 comments on commit f9516fb

Please sign in to comment.