Add module showcases#17
Conversation
…ency, kyron mpmc, comm rust, logging rust, and full-stack complex showcase
There was a problem hiding this comment.
Pull request overview
This PR expands the repository’s SCORE showcase portfolio by adding new standalone and complex module showcases (Orchestrator, Persistency KVS, Communication Rust, Logging Rust) and updates Bazel packaging/CI so these bundles can be built and executed reliably both from extracted bundles and via bazel run (including improved CLI path resolution and lifecycle handling).
Changes:
- Added new standalone showcase descriptors and bundles (comm_rust, orchestrator, persistency, logging_rust) plus Kyron MPMC example inclusion.
- Added new complex showcases for Orchestrator IPC and a full-stack Orchestration + Persistency flow (with new Rust binaries and Bazel targets).
- Improved CLI execution reliability: root-dir discovery,
/showcasespath rewriting, aggregated failures, and per-app timeout support; updated CI showcase target list accordingly.
Reviewed changes
Copilot reviewed 21 out of 21 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| showcases/standalone/persistency.score.json | Adds SCORE descriptor for the persistency KVS standalone example. |
| showcases/standalone/persistency_kvs/main.rs | Implements a Rust persistency KVS round-trip (write/flush/reload/verify) showcase binary. |
| showcases/standalone/persistency_kvs/BUILD | Adds Bazel rust_binary target for the persistency KVS example. |
| showcases/standalone/orchestrator.score.json | Adds standalone Orchestrator example descriptors (including timeout for signal shutdown example). |
| showcases/standalone/logging_rust.score.json | Adds standalone descriptor for Rust logging builtin backend example. |
| showcases/standalone/kyron.score.json | Extends Kyron standalone descriptor with an MPMC example entry. |
| showcases/standalone/com_rust.score.json | Adds standalone descriptor for the Communication Rust com-api example. |
| showcases/standalone/BUILD | Adds new standalone bundles (orchestrator, comm_rust, persistency, logging_rust) and includes Kyron MPMC binary. |
| showcases/simple_lifecycle/lifecycle_signal.sh | Fixes Linux signalling to avoid self-kill when matching by full command line. |
| showcases/orchestrator_ipc/orchestrator_ipc.score.json | Adds complex descriptor running receiver then sender with a delay. |
| showcases/orchestrator_ipc/BUILD | Adds Bazel bundle target for orchestrator IPC complex showcase. |
| showcases/full_stack/main.rs | Adds full-stack Rust showcase combining orchestration timer ticks with persistency on stop. |
| showcases/full_stack/full_stack.score.json | Adds descriptor for the full-stack example binary. |
| showcases/full_stack/BUILD | Adds Bazel rust_binary and bundle for the full-stack showcase. |
| showcases/cli/main.rs | Improves root dir resolution, rewrites hard-coded /showcases paths, aggregates failures, and adds timeout_secs handling. |
| showcases/BUILD | Expands top-level showcases bundle to include newly added bundles. |
| patches/communication/004-expose-comm-rust-example-config.patch | Exposes the comm Rust example’s config file for bundling. |
| patches/baselibs_rust/BUILD | Adds Bazel package for baselibs_rust patches. |
| patches/baselibs_rust/001-expose-log-examples.patch | Makes Rust logging example binary publicly visible for bundling. |
| ci/showcase_targets_run.txt | Updates CI run list to include the expanded showcase target set. |
| bazel_common/score_modules_target_sw.MODULE.bazel | Applies new patches to external modules (baselibs_rust, communication). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| let status = if let Some(secs) = timeout { | ||
| // Poll until timeout, then send SIGTERM | ||
| let deadline = std::time::Instant::now() + Duration::from_secs(secs); | ||
| loop { | ||
| match child | ||
| .try_wait() | ||
| .with_context(|| format!("Failed to poll app {}: {}", i, path))? | ||
| { | ||
| Some(s) => break s, | ||
| None if std::time::Instant::now() >= deadline => { | ||
| println!("App {}: timeout reached, sending SIGTERM to {}", i, path); | ||
| terminated_by_timeout = true; | ||
| let _ = child.kill(); | ||
| break child | ||
| .wait() | ||
| .with_context(|| format!("Failed to wait after kill for app {}: {}", i, path))?; | ||
| }, | ||
| None => std::thread::sleep(Duration::from_millis(100)), | ||
| } | ||
| } | ||
| } else { | ||
| child | ||
| .wait() | ||
| .with_context(|| format!("Failed to wait for app {}: {}", i, path))? | ||
| }; |
log_builtin in score_baselibs_rust transitively requires Rust >= 1.80 (via score_log_fmt which uses NonNull::from_ref). The CI toolchain (Ferrocene for aarch64, rules_rust default for x86_64) is older, causing build failures on all platforms. Remove logging_rust_pkg_files from the image bundle (same treatment as comm_rust_pkg_files). The standalone target //showcases/standalone:logging_rust remains available for direct use when a compatible toolchain is present. Also apply rustfmt formatting to the SIGTERM grace-period block added to showcases/cli/main.rs in the previous commit.
| @@ -0,0 +1,12 @@ | |||
| # ******************************************************************************* | |||
| # Copyright (c) 2026 Qorix GmbH | |||
| @@ -0,0 +1,12 @@ | |||
| # ******************************************************************************* | |||
| # Copyright (c) 2026 Qorix GmbH | |||
There was a problem hiding this comment.
we shouldnt use patches on main branch. Those changes should be introduced and merged to respective modules
|
|
||
| // Rewrite app paths that were authored with the hard-coded Docker deployment | ||
| // prefix (/showcases) so they resolve correctly under any root_dir. | ||
| let showcases_prefix = "/showcases"; |
There was a problem hiding this comment.
it should ne SCORE_CLI_INIT_DIR or?
There was a problem hiding this comment.
Not the same — SCORE_CLI_INIT_DIR is a runtime override (used when running outside the OCI image), while DEPLOY_PREFIX = "/showcases" is the baked‑in mount path referenced in every .score.json descriptor. If the CLI isn’t running from that path (extracted bundle, bazel run, or explicit SCORE_CLI_INIT_DIR), it rewrites all descriptor paths from DEPLOY_PREFIX to the actual root. Their roles are distinct, and the latest commit makes this clear by hoisting the literal into DEPLOY_PREFIX with a clarifying comment.
| @@ -0,0 +1,57 @@ | |||
| # ******************************************************************************* | |||
| # Copyright (c) 2026 Qorix GmbH | |||
There was a problem hiding this comment.
all headers need to be score, pls check all files
| @@ -26,5 +26,16 @@ if running_on_qnx | |||
| then | |||
| slay -s $signal -f $process_name | |||
There was a problem hiding this comment.
qnx didnt need the update?
There was a problem hiding this comment.
the idea of standalones is to use module examples, not create and maintain them here. Please use examples from pers or move them there.
There was a problem hiding this comment.
Once that PR merges, the persistency bundle here will be repointed to
@score_persistency//src/rust/rust_kvs:basic and the local
showcases/standalone/persistency_kvs/ directory will be removed.
There was a problem hiding this comment.
The upstream persistency PR
(https://github.com/qorix-group/persistency/tree/Subramanian-K812_add_kvs_example_targets)
will include a C++ example target as well. Once merged, the
persistency_cpp bundle will point to the upstream target and
showcases/standalone/persistency_kvs_cpp/ will be deleted from this repo.
| # default. When Ferrocene rustc drives the final link of mixed Rust+C++ | ||
| # binaries it passes -nodefaultlibs, so libgcc.a is never pulled in and the | ||
| # helpers stay unresolved. Inline atomics avoid the dependency entirely. | ||
| build:eb-aarch64 --copt=-mno-outline-atomics |
There was a problem hiding this comment.
we really shouldnt use copts in ref_int, why is it needed?
PR: Add module showcases
Summary
This PR expands the showcase portfolio to cover additional SCORE modules
High-level scope:
Logging Rust, Persistency KVS C++, and Logging C++.
full_stackshowcase.timeout_secs).known_good.jsonas the single source of truth for Bazel patches(patch entries now declared under
bazel_patchesinknown_good.json).Detailed Changes
1. Showcase bundle expansion
Updated
showcases/BUILDto include all new packages:standalone:comm_rust_pkg_filesstandalone:persistency_pkg_filesstandalone:logging_rust_pkg_filesstandalone:persistency_cpp_pkg_filesstandalone:logging_cpp_pkg_filesorchestrator_ipc:orchestrator_ipc_pkg_filesfull_stack:full_stack_pkg_filesUpdated
showcases/standalone/BUILD:kyronbundle: added@score_kyron//examples:mpmcorchestratorbundlecomm_rustbundlepersistencybundle (Rust KVS)logging_rustbundlepersistency_cppbundlelogging_cppbundleUpdated
ci/showcase_targets_run.txt: added all new bundle targets including//showcases/standalone:persistency_cppand//showcases/standalone:logging_cpp.2. New standalone showcase: Persistency KVS Rust
showcases/standalone/persistency_kvs/BUILDshowcases/standalone/persistency_kvs/main.rsshowcases/standalone/persistency.score.jsonBehavior: creates a JSON-backed KVS, writes typed values (
f64,bool,String),flushes, recreates instance, and verifies round-trip persistence. Exits non-zero on failure.
3. New standalone showcase: Persistency KVS C++ (dual-language pair)
showcases/standalone/persistency_kvs_cpp/BUILDshowcases/standalone/persistency_kvs_cpp/main.cppshowcases/standalone/persistency_cpp.score.jsonBehavior: C++ twin of the Rust persistency showcase using
KvsBuilder/Kvs::set_value/Kvs::flush. Writesspeed_kmh(double),engine_running(bool),and
vehicle_id(string), reopens the store, and asserts round-trip correctness.4. New standalone showcase: Logging C++ (dual-language pair)
showcases/standalone/logging_cpp.score.jsonDemonstrates the SCORE structured logging
stack initialized from a C++ entrypoint.
5. New standalone showcase descriptors
showcases/standalone/com_rust.score.jsonshowcases/standalone/logging_rust.score.jsonshowcases/standalone/orchestrator.score.json6. New complex showcase: Orchestrator IPC
showcases/orchestrator_ipc/BUILDshowcases/orchestrator_ipc/orchestrator_ipc.score.jsonBundles sender/receiver inter-process orchestrator examples; starts receiver before
sender (delay) to reduce startup race risk.
7. New complex showcase: Full-stack (Orchestration + Persistency + Lifecycle health)
showcases/full_stack/BUILDshowcases/full_stack/full_stack.score.jsonshowcases/full_stack/main.rsBehavior:
DeadlineMonitor(50 ms–500 ms window)and brackets each sleep interval with
deadline.start()/handle.stop().IDENTIFIERenv var),connects to the supervisor with
HealthMonitor::start()and reportsExecutionState::Runningvia the lifecycle client FFI.Validation Notes