Skip to content

Commit b5106f1

Browse files
Merge branch 'main' into feature/itf-int-local
2 parents add83b4 + 1662c32 commit b5106f1

79 files changed

Lines changed: 4938 additions & 7074 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.bazelrc

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,12 @@ build:x86_64-linux --extra_toolchains=@score_gcc_x86_64_toolchain//:x86_64-linux
5151
build:x86_64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_x86_64_unknown_linux_gnu
5252
build:x86_64-linux --define config=x86_64-linux
5353

54-
# TODO arm64-linux when rust support is there
54+
# Target configuration for CPU:AArch64|OS:Linux build (do not use it in case of system toolchains!)
55+
build:arm64-linux --config=stub
56+
build:arm64-linux --config=toolchain_common
57+
build:arm64-linux --platforms=@score_bazel_platforms//:aarch64-linux-gcc_12.2.0-posix
58+
build:arm64-linux --extra_toolchains=@score_gcc_aarch64_toolchain//:aarch64-linux-gcc_12.2.0-posix
59+
build:arm64-linux --extra_toolchains=@score_toolchains_rust//toolchains/ferrocene:ferrocene_aarch64_unknown_linux_gnu
5560

5661
# Target configuration for CPU:x86-64|OS:QNX build (do not use it in case of system toolchains!)
5762
build:x86_64-qnx --config=stub

.github/workflows/build.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,10 @@ on:
2222
- main
2323
jobs:
2424
build:
25-
name: Build Bazel Code
2625
runs-on: ubuntu-latest
26+
strategy:
27+
matrix:
28+
config: [x86_64-linux, arm64-linux]
2729
steps:
2830
- name: Checkout code
2931
uses: actions/checkout@v4.2.2
@@ -32,7 +34,7 @@ jobs:
3234
uses: bazel-contrib/setup-bazel@0.18.0
3335
with:
3436
bazelisk-cache: true
35-
disk-cache: ${{ github.workflow }}
37+
disk-cache: ${{ github.workflow }}-${{ matrix.config }}
3638
repository-cache: true
3739
cache-save: ${{ github.event_name == 'push' }}
3840

@@ -46,4 +48,4 @@ jobs:
4648
4749
- name: Build with Bazel
4850
run: |
49-
bazel build --lockfile_mode=error --config x86_64-linux //src/... //examples/...
51+
bazel build --lockfile_mode=error --config ${{ matrix.config }} //src/... //examples/...

MODULE.bazel

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -79,13 +79,13 @@ use_repo(
7979
)
8080

8181
## Rust Toolchain
82-
bazel_dep(name = "score_toolchains_rust", version = "0.4.0", dev_dependency = True)
82+
bazel_dep(name = "score_toolchains_rust", version = "0.8.0", dev_dependency = True)
8383

8484
# S-CORE crates
8585
bazel_dep(name = "score_crates", version = "0.0.8")
8686
git_override(
8787
module_name = "score_crates",
88-
commit = "c56d8f4006ff1cfe5be532496225255c5ee6c2d6",
88+
commit = "90539da0fd3e7e23e01f2b4de1679f7dfadd3b6b",
8989
remote = "https://github.com/eclipse-score/score-crates.git",
9090
)
9191

@@ -125,13 +125,14 @@ python.toolchain(
125125
python_version = PYTHON_VERSION,
126126
)
127127

128-
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip", dev_dependency = True)
128+
# Python pip dependencies
129+
pip = use_extension("@rules_python//python/extensions:pip.bzl", "pip")
129130
pip.parse(
130-
hub_name = "pip_score_venv_test",
131+
hub_name = "score_lifecycle_pip",
131132
python_version = PYTHON_VERSION,
132-
requirements_lock = "//tests/integration:requirements.lock",
133+
requirements_lock = "//:requirements_lock.txt",
133134
)
134-
use_repo(pip, "pip_score_venv_test")
135+
use_repo(pip, "score_lifecycle_pip")
135136

136137
bazel_dep(name = "score_itf", version = "0.1.0", dev_dependency = True)
137138

@@ -142,7 +143,7 @@ oci.pull(
142143
tag = "bookworm",
143144
platforms = ["linux/amd64"],
144145
)
145-
use_repo(oci, "linux_runtime")
146+
use_repo(oci, "linux_runtime", "linux_runtime_linux_amd64")
146147

147148
local_path_override(
148149
module_name = "score_itf",

MODULE.bazel.lock

Lines changed: 38 additions & 5758 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
#
1111
# SPDX-License-Identifier: Apache-2.0
1212
# *******************************************************************************
13-
def get_process_index_range(process_count: int, process_group_index: int):
14-
# Every ProcessGroup gets the same number of processes
15-
# The Process Index is a globally unique increasing number
16-
return range(
17-
process_group_index * process_count,
18-
(process_group_index * process_count) + process_count,
19-
)
13+
14+
"""Unified entrypoint for lifecycle Bazel macros & rules."""
15+
16+
# --- Launch Manager Configuration ---
17+
load("//scripts/config_mapping:config.bzl", _launch_manager_config = "launch_manager_config")
18+
19+
launch_manager_config = _launch_manager_config

examples/BUILD

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
load("//:defs.bzl", "launch_manager_config")
14+
15+
launch_manager_config(
16+
name = "example_config",
17+
config = "//examples/config:lifecycle_demo_config",
18+
)
19+
20+
filegroup(
21+
name = "example_apps",
22+
srcs = [
23+
"//examples:example_config",
24+
"//examples/control_application:control_daemon",
25+
"//examples/control_application:lmcontrol",
26+
"//examples/cpp_lifecycle_app",
27+
"//examples/cpp_supervised_app",
28+
"//examples/rust_supervised_app",
29+
],
30+
)
31+
32+
filegroup(
33+
name = "lm_binaries",
34+
srcs = [
35+
"//src/control_client_lib",
36+
"//src/launch_manager_daemon:launch_manager",
37+
"//src/launch_manager_daemon/lifecycle_client_lib:lifecycle_client",
38+
"//src/launch_manager_daemon/process_state_client_lib:process_state_client",
39+
],
40+
)
41+
42+
sh_binary(
43+
name = "run_examples",
44+
srcs = ["run.sh"],
45+
data = [
46+
":example_apps",
47+
":lm_binaries",
48+
],
49+
)

examples/README.md

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,23 +2,20 @@
22

33
## Building & Running the demo setup
44

5-
1. Build launch_manager and health_monitor, in the parent folder, first.
6-
2. Then start run.sh script in this folder: `cd demo && ./run.sh`
5+
Execute `bazel run //examples:run_examples --config=<...>`. This will build all dependences and run the run.sh script
76

87
The run.sh script will:
98

10-
- Copy the required binaries to a temporary directory demo/tmp
11-
- Compile the json configuration to flatbuffer using flatc
129
- Build a docker image for execution with the required artifacts inside
1310
- Start the docker container that runs launch_manager
1411

1512
## Interacting with the Demo
1613

17-
### Changing ProcessGroup States
14+
### Changing RunTargets
1815

19-
There is a CLI application that allows to request transition to a certain ProcessGroup State.
16+
There is a CLI application that allows to request transition to a certain RunTarget.
2017

21-
Example: `lmcontrol ProcessGroup1/Startup`
18+
Example: `lmcontrol Startup`
2219

2320
### Triggering Supervision Failure
2421

@@ -31,4 +28,4 @@ Example: `fail <PID>`
3128
There is an interactive mode that walks you through two demo scenarios.
3229
This mode requires the run.sh script to be executed **in an active tmux** session.
3330

34-
`cd demo && ./run.sh tmux`
31+
`bazel run //examples:run_examples --config=<...> -- tmux`

examples/config/BUILD

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
# *******************************************************************************
2+
# Copyright (c) 2026 Contributors to the Eclipse Foundation
3+
#
4+
# See the NOTICE file(s) distributed with this work for additional
5+
# information regarding copyright ownership.
6+
#
7+
# This program and the accompanying materials are made available under the
8+
# terms of the Apache License Version 2.0 which is available at
9+
# https://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# SPDX-License-Identifier: Apache-2.0
12+
# *******************************************************************************
13+
exports_files(
14+
["lifecycle_demo.json"],
15+
visibility = ["//examples:__subpackages__"],
16+
)
17+
18+
filegroup(
19+
name = "lifecycle_demo_config",
20+
srcs = ["lifecycle_demo.json"],
21+
visibility = ["//examples:__subpackages__"],
22+
)

0 commit comments

Comments
 (0)