Skip to content

Commit a5e3eab

Browse files
pawelrutkaqodra
andauthored
Use showcase from single place and adapt docker runner (#165)
* Use showcase from single place and adapt docker runner * Bring qemu setup readme * fix showcases path Signed-off-by: Leonardo Rossetti <lrossett@redhat.com> --------- Signed-off-by: Leonardo Rossetti <lrossett@redhat.com> Co-authored-by: Leonardo Rossetti <lrossett@redhat.com>
1 parent 52b737b commit a5e3eab

17 files changed

Lines changed: 179 additions & 78 deletions

File tree

.github/workflows/build_and_test_autosd.yml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,13 +41,12 @@ jobs:
4141
sudo apt-get install -y podman curl qemu-system createrepo-c
4242
- name: Build Showcases
4343
run: |
44-
bazel build --config autosd-x86_64 //images/autosd_x86_64:image
45-
working-directory: ./images/autosd_x86_64
46-
- name: Copy showcases_all folder
44+
bazel build --config autosd-x86_64 //images/autosd_x86_64:score-showcases
45+
- name: Copy showcases folder
4746
run: |
4847
set -e
49-
mkdir -p ./images/autosd_x86_64/build/rpms
50-
cp -R bazel-bin/showcases/showcases_all ./images/autosd_x86_64/build/files/
48+
ls ./bazel-bin/showcases/showcases/showcases
49+
cp -R ./bazel-bin/showcases/showcases/showcases ./images/autosd_x86_64/build/files/reference_integration/
5150
- name: Install AIB Tools
5251
run: |
5352
curl -o auto-image-builder.sh "https://gitlab.com/CentOS/automotive/src/automotive-image-builder/-/raw/main/auto-image-builder.sh?ref_type=heads"

.vscode/settings.json

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,10 @@
99
"feature_integration_tests"
1010
],
1111
"python.testing.unittestEnabled": false,
12-
"python.testing.pytestEnabled": true
12+
"python.testing.pytestEnabled": true,
13+
"search.exclude": {
14+
"./build/**": true,
15+
"./bazel-*/**": true,
16+
"**/*.orig": true,
17+
}
1318
}

MODULE.bazel

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ include("//bazel_common:score_modules_tooling.MODULE.bazel")
3737
# Score modules
3838
include("//bazel_common:score_modules_target_sw.MODULE.bazel")
3939

40+
# Score test images
41+
include("//bazel_common:score_images.MODULE.bazel")
42+
4043
bazel_dep(name = "rules_boost", repo_name = "com_github_nelhage_rules_boost")
4144
archive_override(
4245
module_name = "rules_boost",
@@ -68,15 +71,3 @@ toolchains_qnx.sdp(
6871
)
6972
use_repo(toolchains_qnx, "toolchains_qnx_sdp")
7073
use_repo(toolchains_qnx, "toolchains_qnx_ifs")
71-
72-
bazel_dep(name = "rules_oci", version = "1.8.0")
73-
74-
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
75-
oci.pull(
76-
name = "ubuntu_22_04",
77-
digest = "sha256:3ba65aa20f86a0fad9df2b2c259c613df006b2e6d0bfcc8a146afb8c525a9751",
78-
image = "ubuntu",
79-
platforms = ["linux/amd64"],
80-
tag = "22.04",
81-
)
82-
use_repo(oci, "ubuntu_22_04")

bazel_common/bundlers.bzl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13-
load("@rules_pkg//pkg:mappings.bzl", "pkg_files")
13+
load("@rules_pkg//pkg:mappings.bzl", "pkg_attributes", "pkg_files")
1414
load("@rules_pkg//pkg:pkg.bzl", "pkg_tar")
1515

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

7477
# Step 2: pkg_tar
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
bazel_dep(name = "rules_oci", version = "1.8.0")
2+
3+
oci = use_extension("@rules_oci//oci:extensions.bzl", "oci")
4+
oci.pull(
5+
name = "ubuntu_22_04",
6+
digest = "sha256:3ba65aa20f86a0fad9df2b2c259c613df006b2e6d0bfcc8a146afb8c525a9751",
7+
image = "ubuntu",
8+
platforms = ["linux/amd64"],
9+
tag = "22.04",
10+
)
11+
oci.pull(
12+
name = "centos_stream10",
13+
digest = "sha256:01858c09da8f130c718c37673b83aaaf65c6493e66f4c674caffcffe9ed4c225",
14+
image = "quay.io/centos/centos",
15+
platforms = ["linux/amd64"],
16+
tag = "stream10",
17+
)
18+
use_repo(oci, "centos_stream10", "ubuntu_22_04")

feature_integration_tests/itf/BUILD

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ py_itf_test(
2727
":all_tests",
2828
],
2929
args = [
30-
"--docker-image-bootstrap=$(location //images/linux_x86_64:docker_image_tarball)",
30+
"--docker-image-bootstrap=$(location //images/linux_x86_64:image_tarball)",
3131
"--docker-image=score_showcases:latest",
3232
],
3333
data = [
34-
"//images/linux_x86_64:docker_image_tarball",
34+
"//images/linux_x86_64:image_tarball",
3535
],
3636
plugins = [
3737
docker,

images/autosd_x86_64/BUILD.bazel

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
load("@rules_oci//oci:defs.bzl", "oci_image", "oci_tarball")
2+
13
# *******************************************************************************
24
# Copyright (c) 2024 Contributors to the Eclipse Foundation
35
#
@@ -12,16 +14,10 @@
1214
# *******************************************************************************
1315
load("@rules_rpm//:defs.bzl", "rpm_package")
1416

15-
alias(
16-
name = "image",
17-
actual = "//showcases:showcases_all",
18-
visibility = ["//visibility:public"],
19-
)
20-
2117
rpm_package(
2218
name = "score-showcases",
2319
data = [
24-
"//showcases:showcases_all",
20+
"//showcases",
2521
],
2622
data_dir = "/usr/share/score/examples",
2723
description = "Eclipse S-CORE Reference Integration Showcases",
@@ -33,12 +29,29 @@ sh_binary(
3329
name = "run",
3430
srcs = ["//runners/docker_x86_64/scripts:run_docker.sh"],
3531
args = [
36-
"$(location :image)",
32+
"$(location :image_tarball)",
3733
],
3834
data = [
39-
":image",
35+
":image_tarball",
4036
],
4137
env = {
42-
"OCI_IMAGE": "quay.io/centos/centos:stream10",
38+
"OCI_IMAGE": "score_showcases_autosd:latest",
4339
},
4440
)
41+
42+
oci_image(
43+
name = "image",
44+
base = "@centos_stream10",
45+
tars = [
46+
"//showcases:showcases_pkg_tar",
47+
],
48+
)
49+
50+
oci_tarball(
51+
name = "image_tarball",
52+
image = ":image",
53+
repo_tags = ["score_showcases_autosd:latest"],
54+
visibility = [
55+
"//feature_integration_tests/itf:__pkg__",
56+
],
57+
)

images/autosd_x86_64/build/.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,7 @@ auto-image-builder.sh
55

66
*.qcow2
77
*.img
8+
9+
10+
!files/reference_integration/.gitkeep
11+
files/reference_integration

images/autosd_x86_64/build/files/reference_integration/.gitkeep

Whitespace-only changes.

images/autosd_x86_64/build/image.aib.yml

Lines changed: 14 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,6 @@ content:
2020
repos:
2121
- id: epel
2222
baseurl: https://dl.fedoraproject.org/pub/epel/10/Everything/$arch/
23-
# removing it for now because the image is relying on copying globs
24-
#- id: score
25-
# baseurl: file:///host/rpms
2623
rpms:
2724
# For testing the image only:
2825
- openssh-server
@@ -37,6 +34,10 @@ content:
3734
mode: 0755
3835
parents: true
3936
exist_ok: true
37+
- path: /usr/share/score/examples
38+
mode: 0755
39+
parents: true
40+
exist_ok: true
4041
# Configure shared socket directory via tmpfiles
4142
add_files:
4243
- path: /usr/lib/tmpfiles.d/lola_disc.conf
@@ -65,36 +66,36 @@ content:
6566
- path: /usr/bin/lola-ipc-test
6667
source_path: files/lola-ipc-test
6768
# showcases
68-
- path: /usr/share/score/examples/showcases_all
69-
source_glob: "files/showcases_all/**/*"
69+
- path: /usr/share/score/examples
70+
source_glob: "files/reference_integration/**/*"
7071
preserve_path: true
7172
max_files: 50
7273
chmod_files:
7374
- path: /usr/bin/lola-ipc-test
7475
mode: "0755"
7576
# the following is a workaround because copied files lost their permissions
76-
- path: /usr/share/score/examples/showcases_all/bin/cli
77+
- path: /usr/share/score/examples/showcases/bin/cli
7778
mode: "0755"
7879
recursive: true
79-
- path: /usr/share/score/examples/showcases_all/bin/control_daemon
80+
- path: /usr/share/score/examples/showcases/bin/control_daemon
8081
mode: "0755"
8182
recursive: true
82-
- path: /usr/share/score/examples/showcases_all/bin/cpp_supervised_app
83+
- path: /usr/share/score/examples/showcases/bin/cpp_supervised_app
8384
mode: "0755"
8485
recursive: true
85-
- path: /usr/share/score/examples/showcases_all/bin/ipc_bridge_cpp
86+
- path: /usr/share/score/examples/showcases/bin/ipc_bridge_cpp
8687
mode: "0755"
8788
recursive: true
88-
- path: /usr/share/score/examples/showcases_all/bin/launch_manager
89+
- path: /usr/share/score/examples/showcases/bin/launch_manager
8990
mode: "0755"
9091
recursive: true
91-
- path: /usr/share/score/examples/showcases_all/bin/lifecycle_signal.sh
92+
- path: /usr/share/score/examples/showcases/bin/lifecycle_signal.sh
9293
mode: "0755"
9394
recursive: true
94-
- path: /usr/share/score/examples/showcases_all/bin/orch_per_example
95+
- path: /usr/share/score/examples/showcases/bin/orch_per_example
9596
mode: "0755"
9697
recursive: true
97-
- path: /usr/share/score/examples/showcases_all/bin/rust_supervised_app
98+
- path: /usr/share/score/examples/showcases/bin/rust_supervised_app
9899
mode: "0755"
99100
recursive: true
100101
# Required for testing the image only:

0 commit comments

Comments
 (0)