Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions .github/workflows/build_and_test_autosd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,12 @@ jobs:
sudo apt-get install -y podman curl qemu-system createrepo-c
- name: Build Showcases
run: |
bazel build --config autosd-x86_64 //images/autosd_x86_64:image
working-directory: ./images/autosd_x86_64
- name: Copy showcases_all folder
bazel build --config autosd-x86_64 //images/autosd_x86_64:score-showcases
- name: Copy showcases folder
run: |
set -e
mkdir -p ./images/autosd_x86_64/build/rpms
cp -R bazel-bin/showcases/showcases_all ./images/autosd_x86_64/build/files/
ls ./bazel-bin/showcases/showcases/showcases
cp -R ./bazel-bin/showcases/showcases/showcases ./images/autosd_x86_64/build/files/reference_integration/
- name: Install AIB Tools
run: |
curl -o auto-image-builder.sh "https://gitlab.com/CentOS/automotive/src/automotive-image-builder/-/raw/main/auto-image-builder.sh?ref_type=heads"
Expand Down
7 changes: 6 additions & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,10 @@
"feature_integration_tests"
],
"python.testing.unittestEnabled": false,
"python.testing.pytestEnabled": true
"python.testing.pytestEnabled": true,
"search.exclude": {
"./build/**": true,
"./bazel-*/**": true,
"**/*.orig": true,
}
}
15 changes: 3 additions & 12 deletions MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,9 @@ include("//bazel_common:score_modules_tooling.MODULE.bazel")
# Score modules
include("//bazel_common:score_modules_target_sw.MODULE.bazel")

# Score test images
include("//bazel_common:score_images.MODULE.bazel")

bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
archive_override(
module_name = "rules_boost",
Expand Down Expand Up @@ -68,15 +71,3 @@ toolchains_qnx.sdp(
)
use_repo(toolchains_qnx, "toolchains_qnx_sdp")
use_repo(toolchains_qnx, "toolchains_qnx_ifs")

bazel_dep(name = "rules_oci", version = "1.8.0")

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "ubuntu_22_04",
digest = "sha256:3ba65aa20f86a0fad9df2b2c259c613df006b2e6d0bfcc8a146afb8c525a9751",
image = "ubuntu",
platforms = ["linux/amd64"],
tag = "22.04",
)
use_repo(oci, "ubuntu_22_04")
5 changes: 4 additions & 1 deletion bazel_common/bundlers.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_files")
load("@rules_pkg//pkg:pkg.bzl", "pkg_tar")

def score_pkg_bundle(name, bins, config_data = None, package_dir = None, other_package_files = [], custom_layout = {}):
Expand Down Expand Up @@ -69,6 +69,9 @@ def score_pkg_bundle(name, bins, config_data = None, package_dir = None, other_p
srcs = bins + config_data_arr + list(custom_layout.keys()),
renames = rename_dict,
visibility = ["//visibility:public"],
attributes = pkg_attributes(
mode = "0755", # Simplify setup for now doing all executables
),
)

# Step 2: pkg_tar
Expand Down
18 changes: 18 additions & 0 deletions bazel_common/score_images.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
bazel_dep(name = "rules_oci", version = "1.8.0")

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
name = "ubuntu_22_04",
digest = "sha256:3ba65aa20f86a0fad9df2b2c259c613df006b2e6d0bfcc8a146afb8c525a9751",
image = "ubuntu",
platforms = ["linux/amd64"],
tag = "22.04",
)
oci.pull(
name = "centos_stream10",
digest = "sha256:01858c09da8f130c718c37673b83aaaf65c6493e66f4c674caffcffe9ed4c225",
image = "quay.io/centos/centos",
platforms = ["linux/amd64"],
tag = "stream10",
)
use_repo(oci, "centos_stream10", "ubuntu_22_04")
4 changes: 2 additions & 2 deletions feature_integration_tests/itf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,11 @@ py_itf_test(
":all_tests",
],
args = [
"--docker-image-bootstrap=$(location //images/linux_x86_64:docker_image_tarball)",
"--docker-image-bootstrap=$(location //images/linux_x86_64:image_tarball)",
"--docker-image=score_showcases:latest",
],
data = [
"//images/linux_x86_64:docker_image_tarball",
"//images/linux_x86_64:image_tarball",
],
plugins = [
docker,
Expand Down
33 changes: 23 additions & 10 deletions images/autosd_x86_64/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")

# *******************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
#
Expand All @@ -12,16 +14,10 @@
# *******************************************************************************
load("@rules_rpm//:defs.bzl", "rpm_package")

alias(
name = "image",
actual = "//showcases:showcases_all",
visibility = ["//visibility:public"],
)

rpm_package(
name = "score-showcases",
data = [
"//showcases:showcases_all",
"//showcases",
],
data_dir = "/usr/share/score/examples",
description = "Eclipse S-CORE Reference Integration Showcases",
Expand All @@ -33,12 +29,29 @@ sh_binary(
name = "run",
srcs = ["//runners/docker_x86_64/scripts:run_docker.sh"],
args = [
"$(location :image)",
"$(location :image_tarball)",
],
data = [
":image",
":image_tarball",
],
env = {
"OCI_IMAGE": "quay.io/centos/centos:stream10",
"OCI_IMAGE": "score_showcases_autosd:latest",
},
)

oci_image(
name = "image",
base = "@centos_stream10",
tars = [
"//showcases:showcases_pkg_tar",
],
)

oci_tarball(
name = "image_tarball",
image = ":image",
repo_tags = ["score_showcases_autosd:latest"],
visibility = [
"//feature_integration_tests/itf:__pkg__",
],
)
4 changes: 4 additions & 0 deletions images/autosd_x86_64/build/.gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,7 @@ auto-image-builder.sh

*.qcow2
*.img


!files/reference_integration/.gitkeep
files/reference_integration
Empty file.
27 changes: 14 additions & 13 deletions images/autosd_x86_64/build/image.aib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,6 @@ content:
repos:
- id: epel
baseurl: https://dl.fedoraproject.org/pub/epel/10/Everything/$arch/
# removing it for now because the image is relying on copying globs
#- id: score
# baseurl: file:///host/rpms
rpms:
# For testing the image only:
- openssh-server
Expand All @@ -37,6 +34,10 @@ content:
mode: 0755
parents: true
exist_ok: true
- path: /usr/share/score/examples
mode: 0755
parents: true
exist_ok: true
# Configure shared socket directory via tmpfiles
add_files:
- path: /usr/lib/tmpfiles.d/lola_disc.conf
Expand Down Expand Up @@ -65,36 +66,36 @@ content:
- path: /usr/bin/lola-ipc-test
source_path: files/lola-ipc-test
# showcases
- path: /usr/share/score/examples/showcases_all
source_glob: "files/showcases_all/**/*"
- path: /usr/share/score/examples
source_glob: "files/reference_integration/**/*"
preserve_path: true
max_files: 50
chmod_files:
- path: /usr/bin/lola-ipc-test
mode: "0755"
# the following is a workaround because copied files lost their permissions
- path: /usr/share/score/examples/showcases_all/bin/cli
- path: /usr/share/score/examples/showcases/bin/cli
mode: "0755"
recursive: true
- path: /usr/share/score/examples/showcases_all/bin/control_daemon
- path: /usr/share/score/examples/showcases/bin/control_daemon
mode: "0755"
recursive: true
- path: /usr/share/score/examples/showcases_all/bin/cpp_supervised_app
- path: /usr/share/score/examples/showcases/bin/cpp_supervised_app
mode: "0755"
recursive: true
- path: /usr/share/score/examples/showcases_all/bin/ipc_bridge_cpp
- path: /usr/share/score/examples/showcases/bin/ipc_bridge_cpp
mode: "0755"
recursive: true
- path: /usr/share/score/examples/showcases_all/bin/launch_manager
- path: /usr/share/score/examples/showcases/bin/launch_manager
mode: "0755"
recursive: true
- path: /usr/share/score/examples/showcases_all/bin/lifecycle_signal.sh
- path: /usr/share/score/examples/showcases/bin/lifecycle_signal.sh
mode: "0755"
recursive: true
- path: /usr/share/score/examples/showcases_all/bin/orch_per_example
- path: /usr/share/score/examples/showcases/bin/orch_per_example
mode: "0755"
recursive: true
- path: /usr/share/score/examples/showcases_all/bin/rust_supervised_app
- path: /usr/share/score/examples/showcases/bin/rust_supervised_app
mode: "0755"
recursive: true
# Required for testing the image only:
Expand Down
29 changes: 8 additions & 21 deletions images/linux_x86_64/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -14,44 +14,31 @@ load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")

alias(
name = "image",
actual = "//showcases:showcases_all",
visibility = ["//visibility:public"],
)

sh_binary(
name = "run",
srcs = ["//runners/docker_x86_64/scripts:run_docker.sh"],
args = [
"$(location :image)",
"$(location :image_tarball)",
],
data = [
":image",
":image_tarball",
],
)

pkg_tar(
name = "showcases_archive",
srcs = [
"//showcases:showcases_all",
],
symlinks = {
"showcases": "showcases_all",
env = {
"OCI_IMAGE": "score_showcases:latest",
},
)

oci_image(
name = "docker_image",
name = "image",
base = "@ubuntu_22_04",
tars = [
":showcases_archive",
"//showcases:showcases_pkg_tar",
],
)

oci_tarball(
name = "docker_image_tarball",
image = ":docker_image",
name = "image_tarball",
image = ":image",
repo_tags = ["score_showcases:latest"],
visibility = [
"//feature_integration_tests/itf:__pkg__",
Expand Down
4 changes: 2 additions & 2 deletions images/qnx_x86_64/build/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,12 @@ qnx_ifs(
":system.build",
":system_dir",
"//feature_integration_tests/configs:etc_configs",
"//showcases:showcases_all",
"//showcases",
"@score_persistency//tests/test_scenarios/cpp:test_scenarios",
],
build_file = "init.build",
ext_repo_maping = {
"BUNDLE_PATH": "$(location //showcases:showcases_all)",
"BUNDLE_PATH": "$(location //showcases:showcases)",
},
visibility = [
"//visibility:public",
Expand Down
2 changes: 1 addition & 1 deletion images/qnx_x86_64/build/system.build
Original file line number Diff line number Diff line change
Expand Up @@ -285,5 +285,5 @@ pci/pci_debug2.so # Enhanced PCI debugging support
[perms=777] /cpp_tests_persistency = ${CPP_TEST_SCENARIOS_PATH}

# Common showcases bundle
[perms=777] /showcases = ${BUNDLE_PATH}
[perms=777] / = ${BUNDLE_PATH}

19 changes: 14 additions & 5 deletions runners/docker_x86_64/scripts/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,22 @@

set -euo pipefail

OVERLAY_TREE=$1
OVERLAY_ABS_PATH=$(realpath ${OVERLAY_TREE})
OCI_IMAGE=${OCI_IMAGE:=ubuntu:22.04}
OCI_TARBALL_IMAGE_SCRIPT=$1
OCI_TARBALL_IMAGE_SCRIPT_ABS_PATH=$(realpath ${OCI_TARBALL_IMAGE_SCRIPT})

echo "Starting docker with overlay image: ${OVERLAY_ABS_PATH}"
if [ -z "${OCI_IMAGE:-}" ]; then
echo "Error: OCI_IMAGE environment variable is not set."
exit 1
fi

OCI_IMAGE=${OCI_IMAGE:=score_showcases:latest}


echo "Starting docker with OCI image tarball at: ${OCI_TARBALL_IMAGE_SCRIPT_ABS_PATH}"

${OCI_TARBALL_IMAGE_SCRIPT_ABS_PATH}

echo "Running docker with image: ${OCI_IMAGE}"
docker run --rm -it \
-v "${OVERLAY_ABS_PATH}:/showcases" \
${OCI_IMAGE} \
bash -c "/showcases/bin/cli; exec bash"
Loading