Skip to content
Open
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
6 changes: 4 additions & 2 deletions .github/workflows/build_and_test_autosd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,13 @@ jobs:
run: |
bazel build --config autosd-x86_64 //images/autosd_x86_64:image
working-directory: ./images/autosd_x86_64
- name: Copy showcases_all folder
- 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 -la bazel-bin/showcases
ls -la bazel-bin/
cp -R bazel-bin/showcases ./images/autosd_x86_64/build/files/
- 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__",
],
)
20 changes: 10 additions & 10 deletions images/autosd_x86_64/build/image.aib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -65,36 +65,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/showcases/**/*"
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/showcases/bin/cli
mode: "0755"
recursive: true
- path: /usr/share/score/examples/showcases_all/bin/control_daemon
- path: /usr/share/score/examples/showcases/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/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/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/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/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/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/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"
13 changes: 9 additions & 4 deletions runners/qemu_x86_64/scripts/run_qemu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,18 @@
set -euo pipefail

QNX_HOST=$1

IFS_IMAGE=$2

# Set KVM options based on QEMU_NO_KVM if user does not have kvm - like nested VMs
if [ -z "${QEMU_NO_KVM:-}" ]; then
QEMU_KVM_OPTS="-enable-kvm -smp 2 -cpu host"
else
QEMU_KVM_OPTS="-smp 2 -cpu Cascadelake-Server-v5"
fi

echo "Starting QEMU with IFS image: ${IFS_IMAGE}"
qemu-system-x86_64 \
-enable-kvm \
-smp 2 \
-cpu host\
${QEMU_KVM_OPTS} \
-m 1G \
-pidfile /tmp/qemu.pid \
-nographic \
Expand Down
3 changes: 2 additions & 1 deletion showcases/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@
load("//bazel_common:bundlers.bzl", "score_pkg_bundle")

score_pkg_bundle(
name = "showcases_all",
name = "showcases",
bins = ["//showcases/cli"],
other_package_files = [
"//showcases/standalone:comm_pkg_files",
"//showcases/standalone:kyron_pkg_files",
"//showcases/orchestration_persistency:orch_per_pkg_files",
"//showcases/simple_lifecycle:simple_lifecycle_pkg_files",
],
package_dir = "showcases",
)
Loading