Skip to content
Draft
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
1 change: 1 addition & 0 deletions integration/.bazelrc
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ build:linux-x86_64 --platforms=@score_bazel_platforms//:x86_64-linux-gcc_12.2.0-

build:eb-aarch64 --config=_common
build:eb-aarch64 --extra_toolchains=@gcc_toolchain//:aarch64_gcc_13
build:eb-aarch64 --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_linux_gnu
build:eb-aarch64 --platforms=@score_toolchains_gcc//platforms:aarch64-linux
build:eb-aarch64 --spawn_strategy=local

Expand Down
2 changes: 1 addition & 1 deletion integration/bazel_common/score_basic_tools.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ bazel_dep(name = "score_crates", version = "0.0.6")
git_override(
module_name = "score_crates",
remote = "https://github.com/eclipse-score/score-crates.git",
commit = "ff8f312cd8ac221ff7562496c7f4d6b9b5c8ebb9",
commit = "e153184db91e0644c8f10e6206d18f2665aed6c4",
)


Expand Down
3 changes: 1 addition & 2 deletions integration/bazel_common/score_gcc_toolchains.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ git_override(
remote = "https://github.com/odra/inc_os_autosd.git",
branch = "repo-new-structure",
strip_prefix = "toolchain"

)
autosd_10_gcc = use_extension("@os_autosd_toolchain//autosd_10_gcc:extensions.bzl", "autosd_10_gcc_extension")
use_repo(autosd_10_gcc, "autosd_10_gcc_repo")
Expand All @@ -83,4 +82,4 @@ use_repo(eb, "gcc_toolchain", "gcc_toolchain_gcc")
use_repo(
gcc,
"score_gcc_x86_64_toolchain",
)
)
4 changes: 2 additions & 2 deletions integration/bazel_common/score_rust_toolchains.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
bazel_dep(name = "rules_rust", version = "0.61.0")
bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True)
bazel_dep(name = "score_toolchains_rust", version = "0.7.0", dev_dependency = True)
git_override(
module_name = "rules_rust",
remote = "https://github.com/pawelrutkaq/rules_rust.git", # To be fixed once rule_rust is in score bazel registry
commit = "293337fd6402ec3dfbeb8f2d589f38ad9124dadd",
)
)
21 changes: 20 additions & 1 deletion integration/images/ebclfsa_aarch64/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,24 @@
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0

# *******************************************************************************
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")

alias(
name = "image",
actual = "//images/ebclfsa_aarch64/build:fastdev-image",
visibility = ["//visibility:public"],
)

sh_binary(
name = "run",
srcs = ["//runners/qemu_ebclfsa_aarch64/scripts:run_qemu.sh"],
env = {"RUNFILES_LIB_DEBUG": "1"},
args = [
"$(locations :image)",
],
data = [
":image",
],
use_bash_launcher = True,
)
80 changes: 80 additions & 0 deletions integration/images/ebclfsa_aarch64/build/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# *******************************************************************************
# Copyright (c) 2025 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 Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

filegroup(
name = "scripts",
srcs = [
"//integration/images/ebclfsa_aarch64/persistency_integration/scripts:startup.sh",
],
visibility = ["//visibility:private"],
)

filegroup(
name = "configs",
srcs = [
"//integration/images/ebclfsa_aarch64/scrample_integration/etc:logging.json",
"//integration/images/ebclfsa_aarch64/scrample_integration/etc:mw_com_config.json",
],
visibility = ["//visibility:private"],
)

genrule(
name = "fetch-fastdev-archive",
srcs = [],
outs = ["fastdev-archive.tgz"],
cmd = "wget -O $@ https://github.com/elektrobit-contrib/eclipse-score_toolchains_gcc/releases/download/0.5.0-beta/fastdev-ubuntu-ebcl-deb-qemu-arm64.tgz"
)

genrule(
name = "extract-fastdev-image",
srcs = [":fetch-fastdev-archive"],
outs = [
"ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic",
"ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64-vmlinux"
],
cmd = "tar xzf $(location :fetch-fastdev-archive) -C $(RULEDIR) && chmod +w $(RULEDIR)/ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic && ls -lah $(RULEDIR)/ebcl-qemuarm64/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic > /tmp/foo",
visibility = [
"//visibility:public",
],
)

genrule(
name = "fastdev-image",
srcs = [
"//showcases:showcases_all",
#"@score_persistency//tests/test_scenarios/cpp:test_scenarios",
"//feature_integration_tests/configs:etc_configs",
":extract-fastdev-image",
"cpp_tests_persistency.sh",
"etc/mw_com_config.json",
"etc/logging.json",
"run_qemu.sh",
],
cmd = " \
mkdir -p $(RULEDIR)/ebcl-qemuarm64-deployed &&\
cp $(RULEDIR)/ebcl-qemuarm64/* $(RULEDIR)/ebcl-qemuarm64-deployed/ &&\
$(location run_qemu.sh) $(RULEDIR)/ebcl-qemuarm64-deployed -pidfile $(RULEDIR)/qemu.pid > $(RULEDIR)/qemu_deployment.log &\
sleep 30 ; \
sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location cpp_tests_persistency.sh) root@localhost:/usr/bin/ &&\
sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location etc/mw_com_config.json) root@localhost:/etc/ &&\
sshpass -p linux scp -o StrictHostKeyChecking=no -P 2222 $(location etc/logging.json) root@localhost:/etc/ &&\
sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost sync &&\
sshpass -p linux ssh -o StrictHostKeyChecking=no -p 2222 root@localhost crinit-ctl poweroff || true \
sleep 5 \
",
outs = [
"ebcl-qemuarm64-deployed/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64.wic",
"ebcl-qemuarm64-deployed/fastdev-ubuntu-ebclfsa-ebcl-qemuarm64-vmlinux",
"qemu_deployment.log",
],
)
Empty file.
29 changes: 29 additions & 0 deletions integration/runners/qemu_ebclfsa_aarch64/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# *******************************************************************************
# Copyright (c) 2025 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 Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")
load("@score_itf//:defs.bzl", "py_itf_test")


# sh_binary(
# name = "qemu_x86_64",
# srcs = ["scripts/run_qemu.sh"],
# args = [
# "$(location @toolchains_qnx_sdp//:host_dir)",
# "$(location //:image)",
# ],
# data = [
# "//:image",
# "@toolchains_qnx_sdp//:host_all",
# "@toolchains_qnx_sdp//:host_dir",
# ],
# )
1 change: 1 addition & 0 deletions integration/runners/qemu_ebclfsa_aarch64/scripts/BUILD
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
exports_files(["run_qemu.sh"])
61 changes: 61 additions & 0 deletions integration/runners/qemu_ebclfsa_aarch64/scripts/run_qemu.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
#!/bin/bash

# *******************************************************************************
# Copyright (c) 2025 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 Version 2.0 which is available at
# https://www.apache.org/licenses/LICENSE-2.0
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

# # --- begin runfiles.bash initialization v3 ---
# # Copy-pasted from the Bazel Bash runfiles library v3.
# set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash
# # shellcheck disable=SC1090
# source "${RUNFILES_DIR:-/dev/null}/$f" 2>/dev/null || \
# source "$(grep -sm1 "^$f " "${RUNFILES_MANIFEST_FILE:-/dev/null}" | cut -f2- -d' ')" 2>/dev/null || \
# source "$0.runfiles/$f" 2>/dev/null || \
# source "$(grep -sm1 "^$f " "$0.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
# source "$(grep -sm1 "^$f " "$0.exe.runfiles_manifest" | cut -f2- -d' ')" 2>/dev/null || \
# { echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e
# # --- end runfiles.bash initialization v3 ---

set -euox pipefail

#BASEFOLDER=$1

echo "Image: ${2}"
echo "Kernel: ${1}"

IMAGE="$(rlocation _main/$2)"
KERNEL="$(rlocation _main/$1)"

echo "Image: ${IMAGE}"
echo "Kernel: ${KERNEL}"

# Make the image file writable, as QEMU needs to write to it.
find -L "$(dirname "${IMAGE}")" -samefile "${IMAGE}" -exec chmod +w {} \;

MACHINE="virt,virtualization=true,gic-version=3"
CPU="cortex-a53"
SMP="8"
MEM="4G"
KERNEL_ARGS=("-append" "root=/dev/vda1 sdk_enable lisa_syscall_whitelist=2026 rw sharedmem.enable_sharedmem=0 init=/usr/bin/ebclfsa-cflinit")
DISK_ARGS="-device virtio-blk-device,drive=vd0 -drive if=none,format=raw,file=${IMAGE},id=vd0"
NETWORK_ARGS="-netdev user,id=net0,net=192.168.7.0/24,dhcpstart=192.168.7.2,dns=192.168.7.3,host=192.168.7.5,hostfwd=tcp::2222-:22,hostfwd=tcp::3333-:3333 -device virtio-net-device,netdev=net0 "

if ! command -v qemu-system-aarch64 > /dev/null; then
echo "Please install qemu-system-aarch64"
exit 1
fi

echo "pwd=$(pwd)"

qemu-system-aarch64 -m "${MEM}" -machine "${MACHINE}" -cpu "${CPU}" \
-smp "${SMP}" -kernel "${KERNEL}" "${KERNEL_ARGS[@]}" ${DISK_ARGS} \
${NETWORK_ARGS} -nographic -pidfile qemu.pid > qemu_upload.log < /dev/null
2 changes: 1 addition & 1 deletion integration/score_starter
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import argparse
mEntries = [
("Run QNX x86_64 QEMU", "bazel run --config qnx-x86_64 //images/qnx_x86_64:run", "qnx-x86_64"),
("Run Linux x86_64 Docker", "bazel run --config linux-x86_64 //images/linux_x86_64:run", "linux-x86_64"),
("Run Elektrobit Corbos aarch64 QEMU",
("Run Elektrobit corbos Linux for Safety Applications aarch64 QEMU",
"bazel build --config eb-aarch64 //images/ebclfsa_aarch64/scrample_integration:run", "eb-aarch64"),
("Build Autosd x86_64 RPM",
"bazel build --config autosd-x86_64 //images/autosd_x86_64:lola-demo", "autosd-x86_64"),
Expand Down
Loading