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
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test_linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
bazel build --lockfile_mode=error --config=linux-x86_64 //images/linux_x86_64:image
- name: Integration tests
run: |
bazel test --lockfile_mode=error --config=linux-x86_64 //feature_integration_tests/itf:linux_x86_64
bazel test --lockfile_mode=error --config=linux-x86_64 //feature_integration_tests/itf
2 changes: 1 addition & 1 deletion .github/workflows/build_and_test_qnx.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
bazel build --lockfile_mode=error --config qnx-x86_64 //images/qnx_x86_64:image
- name: Run integration tests
run: |
bazel test --lockfile_mode=error --config=itf-qnx-x86_64 //feature_integration_tests/itf:qnx_x86_64
bazel test --lockfile_mode=error --config=itf-qnx-x86_64 //feature_integration_tests/itf
- name: Cleanup QNX license
if: always()
run: sudo rm -rf /opt/score_qnx
728 changes: 182 additions & 546 deletions MODULE.bazel.lock

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions bazel_common/score_basic_bazel.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************

bazel_dep(name = "platforms", version = "1.0.0")
bazel_dep(name = "rules_shell", version = "0.6.0")
bazel_dep(name = "rules_cc", version = "0.2.16")
bazel_dep(name = "rules_pkg", version = "1.2.0")
Expand Down
5 changes: 3 additions & 2 deletions bazel_common/score_images.MODULE.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
bazel_dep(name = "rules_oci", version = "1.8.0")
bazel_dep(name = "rules_oci", version = "2.2.7")

oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
oci.pull(
Expand All @@ -15,4 +15,5 @@ oci.pull(
platforms = ["linux/amd64"],
tag = "stream10",
)
use_repo(oci, "centos_stream10", "ubuntu_22_04")
use_repo(oci, "centos_stream10", "centos_stream10_linux_amd64")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@odra which image shall be used centos_stream10 or entos_stream10_linux_amd64?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With new rules_oci both needs to be use_repo'ed, otherwise module system complains, we can still use the generic version.

use_repo(oci, "ubuntu_22_04", "ubuntu_22_04_linux_amd64")
4 changes: 2 additions & 2 deletions bazel_common/score_modules_tooling.MODULE.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ git_override(
bazel_dep(name = "score_itf")
git_override(
module_name = "score_itf",
commit = "e1243f3818fd78b72f79741082016fd3d7c85329",
commit = "44c75debab696a9c967455110a2c32f201159cdd",
remote = "https://github.com/eclipse-score/itf.git",
)

Expand All @@ -45,7 +45,7 @@ git_override(
bazel_dep(name = "score_bazel_platforms")
git_override(
module_name = "score_bazel_platforms",
commit = "2286de89c35d5660ad183906a6f010b33fcac8db",
commit = "b72a5c3510ca423efc71fef9a93d82f974b089a4",
remote = "https://github.com/eclipse-score/bazel_platforms.git",
)

Expand Down
88 changes: 62 additions & 26 deletions feature_integration_tests/itf/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,24 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@score_itf//:defs.bzl", "py_itf_test")
load("@score_itf//score/itf/plugins:plugins.bzl", "docker", "qemu")

config_setting(
name = "config_linux_x86_64",
constraint_values = [
"@platforms//os:linux",
"@platforms//cpu:x86_64",
"@score_bazel_platforms//runtime_es:posix",
],
)

config_setting(
name = "config_qnx_x86_64",
constraint_values = [
"@platforms//os:qnx",
"@platforms//cpu:x86_64",
"@score_bazel_platforms//runtime_es:posix",
],
)

filegroup(
name = "all_tests",
Expand All @@ -22,42 +39,61 @@ filegroup(
)

py_itf_test(
name = "linux_x86_64",
name = "itf",
srcs = [
":all_tests",
],
args = [
"--docker-image-bootstrap=$(location //images/linux_x86_64:image_tarball)",
"--docker-image=score_showcases:latest",
],
data = [
"//images/linux_x86_64:image_tarball",
],
plugins = [
docker,
args = select(
{
":config_linux_x86_64": [
"--docker-image-bootstrap=$(location //images/linux_x86_64:image_load)",
"--docker-image=score_showcases:latest",
],
":config_qnx_x86_64": [
"--qemu-config=$(location //feature_integration_tests/configs:qemu_bridge_config.json)",
"--qemu-image=$(location //images/qnx_x86_64:image)",
],
},
no_match_error = "Unsupported platform",
),
data = select({
":config_linux_x86_64": [
"//images/linux_x86_64:image_load",
],
":config_qnx_x86_64": [
"//feature_integration_tests/configs:qemu_bridge_config.json",
"//images/qnx_x86_64:image",
],
}),
plugins = select(
{
":config_linux_x86_64": [
"@score_itf//score/itf/plugins:docker_plugin",
],
":config_qnx_x86_64": [
"@score_itf//score/itf/plugins:qemu_plugin",
],
},
no_match_error = "Unsupported platform",
),
tags = [
"manual",
],
)

# Backward compatible aliases for CI jobs - these should be removed once the CI jobs are updated to use the new target names
test_suite(
name = "linux_x86_64",
tags = [
"manual",
],
tests = [":itf"],
)

py_itf_test(
test_suite(
name = "qnx_x86_64",
srcs = [
":all_tests",
],
args = [
"--qemu-config=$(location //feature_integration_tests/configs:qemu_bridge_config.json)",
"--qemu-image=$(location //images/qnx_x86_64:image)",
],
data = [
"//feature_integration_tests/configs:qemu_bridge_config.json",
"//images/qnx_x86_64:image",
],
plugins = [
qemu,
],
tags = [
"manual",
],
tests = [":itf"],
)
14 changes: 7 additions & 7 deletions images/autosd_x86_64/BUILD.bazel
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")

# *******************************************************************************
# Copyright (c) 2024 Contributors to the Eclipse Foundation
Expand Down Expand Up @@ -27,12 +27,12 @@ rpm_package(

sh_binary(
name = "run",
srcs = ["//runners/docker_x86_64/scripts:run_docker.sh"],
srcs = ["//runners/docker_x86_64/scripts:run_docker"],
args = [
"$(location :image_tarball)",
"$(location :image_load)",
],
data = [
":image_tarball",
":image_load",
],
env = {
"OCI_IMAGE": "score_showcases_autosd:latest",
Expand All @@ -41,14 +41,14 @@ sh_binary(

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

oci_tarball(
name = "image_tarball",
oci_load(
name = "image_load",
image = ":image",
repo_tags = ["score_showcases_autosd:latest"],
visibility = [
Expand Down
16 changes: 9 additions & 7 deletions images/linux_x86_64/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,18 +10,20 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_load")
load("@rules_pkg//pkg:tar.bzl", "pkg_tar")
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")

sh_binary(
name = "run",
srcs = ["//runners/docker_x86_64/scripts:run_docker.sh"],
srcs = [
"//runners/docker_x86_64/scripts:run_docker",
],
args = [
"$(location :image_tarball)",
"$(location :image_load)",
],
data = [
":image_tarball",
":image_load",
],
env = {
"OCI_IMAGE": "score_showcases:latest",
Expand All @@ -30,14 +32,14 @@ sh_binary(

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

oci_tarball(
name = "image_tarball",
oci_load(
name = "image_load",
image = ":image",
repo_tags = ["score_showcases:latest"],
visibility = [
Expand Down
4 changes: 2 additions & 2 deletions known_good.json
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@
},
"score_itf": {
"repo": "https://github.com/eclipse-score/itf.git",
"hash": "e1243f3818fd78b72f79741082016fd3d7c85329"
"hash": "44c75debab696a9c967455110a2c32f201159cdd"
},
"score_tooling": {
"repo": "https://github.com/eclipse-score/tooling.git",
Expand All @@ -130,7 +130,7 @@
},
"score_bazel_platforms": {
"repo": "https://github.com/eclipse-score/bazel_platforms.git",
"hash": "2286de89c35d5660ad183906a6f010b33fcac8db"
"hash": "b72a5c3510ca423efc71fef9a93d82f974b089a4"
},
"score_test_scenarios": {
"repo": "https://github.com/eclipse-score/testing_tools.git",
Expand Down
12 changes: 0 additions & 12 deletions runners/docker_x86_64/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,3 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
load("@rules_shell//shell:sh_binary.bzl", "sh_binary")

# sh_binary(
# name = "docker_x86_64",
# srcs = ["scripts/run_docker.sh"],
# args = [
# "$(location //linux_x86_64:image)",
# ],
# data = [
# "//linux_x86_64:image",
# ],
# )
13 changes: 12 additions & 1 deletion runners/docker_x86_64/scripts/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,15 @@
#
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************
exports_files(["run_docker.sh"])

load("@rules_shell//shell:sh_library.bzl", "sh_library")

sh_library(
name = "run_docker",
srcs = ["run_docker.sh"],
visibility = [
"//images/auto_x86_64:__pkg__",
"//images/linux_x86_64:__pkg__",
],
deps = ["@rules_shell//shell/runfiles"],
)
22 changes: 22 additions & 0 deletions runners/docker_x86_64/scripts/run_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,30 @@
# SPDX-License-Identifier: Apache-2.0
# *******************************************************************************


# --- begin runfiles.bash initialization v3 ---
# Copy-pasted from the Bazel Bash runfiles library v3.
# https://github.com/bazelbuild/rules_shell/blob/main/shell/runfiles/runfiles.bash
set -uo pipefail; set +e; f=bazel_tools/tools/bash/runfiles/runfiles.bash
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" 2>/dev/null | cut -f2- -d' ')" 2>/dev/null || \
{ echo>&2 "ERROR: cannot find $f"; exit 1; }; f=; set -e
# --- end runfiles.bash initialization v3 ---

set -euo pipefail

# Export the runfiles environment variables (RUNFILES_DIR, RUNFILES_MANIFEST_FILE, etc.)
# into the process environment so that child scripts inherit them. This is required because
# the OCI_TARBALL_IMAGE_SCRIPT (oci_load.sh) is itself a Bazel-generated runfiles-aware
# script that relies on these variables to locate the OCI image tarball within the runfiles
# tree at runtime. Without exporting them here, oci_load.sh would be unable to resolve its
# own runfiles paths and would fail to find the image.
# This might be related to a bug ticket in rules_oci https://github.com/bazel-contrib/rules_oci/issues/874
runfiles_export_envvars

OCI_TARBALL_IMAGE_SCRIPT=$1
OCI_TARBALL_IMAGE_SCRIPT_ABS_PATH=$(realpath ${OCI_TARBALL_IMAGE_SCRIPT})

Expand Down