Skip to content

Add module showcases#17

Draft
Subramanian-K812 wants to merge 11 commits into
mainfrom
Subramanian-K812_add_module_showcases
Draft

Add module showcases#17
Subramanian-K812 wants to merge 11 commits into
mainfrom
Subramanian-K812_add_module_showcases

Conversation

@Subramanian-K812

@Subramanian-K812 Subramanian-K812 commented Jun 10, 2026

Copy link
Copy Markdown

PR: Add module showcases

Summary

This PR expands the showcase portfolio to cover additional SCORE modules

High-level scope:

  • Adds new standalone showcases for Orchestrator, Persistency KVS (Rust), Communication Rust,
    Logging Rust, Persistency KVS C++, and Logging C++.
  • Adds new complex showcases for Orchestrator IPC and a full-stack Orchestration + Persistency
    • Lifecycle health-monitoring flow.
  • Extends Kyron standalone showcase with MPMC example.
  • Adds lifecycle health-monitoring supervision thread to full_stack showcase.
  • Improves showcase CLI path resolution and process lifecycle handling (timeout_secs).
  • Adds module patches to expose upstream files/targets needed for bundling.
  • Aligns known_good.json as the single source of truth for Bazel patches
    (patch entries now declared under bazel_patches in known_good.json).
  • Updates CI showcase target list to include all new showcase bundles.

Detailed Changes

1. Showcase bundle expansion

Updated showcases/BUILD to include all new packages:

  • standalone:comm_rust_pkg_files
  • standalone:persistency_pkg_files
  • standalone:logging_rust_pkg_files
  • standalone:persistency_cpp_pkg_files
  • standalone:logging_cpp_pkg_files
  • orchestrator_ipc:orchestrator_ipc_pkg_files
  • full_stack:full_stack_pkg_files

Updated showcases/standalone/BUILD:

  • kyron bundle: added @score_kyron//examples:mpmc
  • New orchestrator bundle
  • New comm_rust bundle
  • New persistency bundle (Rust KVS)
  • New logging_rust bundle
  • New persistency_cpp bundle
  • New logging_cpp bundle

Updated ci/showcase_targets_run.txt: added all new bundle targets including
//showcases/standalone:persistency_cpp and //showcases/standalone:logging_cpp.

2. New standalone showcase: Persistency KVS Rust

  • showcases/standalone/persistency_kvs/BUILD
  • showcases/standalone/persistency_kvs/main.rs
  • showcases/standalone/persistency.score.json

Behavior: 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/BUILD
  • showcases/standalone/persistency_kvs_cpp/main.cpp
  • showcases/standalone/persistency_cpp.score.json

Behavior: C++ twin of the Rust persistency showcase using KvsBuilder /
Kvs::set_value / Kvs::flush. Writes speed_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.json

Demonstrates the SCORE structured logging
stack initialized from a C++ entrypoint.

5. New standalone showcase descriptors

  • showcases/standalone/com_rust.score.json
  • showcases/standalone/logging_rust.score.json
  • showcases/standalone/orchestrator.score.json

6. New complex showcase: Orchestrator IPC

  • showcases/orchestrator_ipc/BUILD
  • showcases/orchestrator_ipc/orchestrator_ipc.score.json

Bundles 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/BUILD
  • showcases/full_stack/full_stack.score.json
  • showcases/full_stack/main.rs

Behavior:

  • Runs a timer-driven orchestration loop on the Kyron runtime (5 cycles).
  • Spawns a dedicated OS thread that registers a DeadlineMonitor (50 ms–500 ms window)
    and brackets each sleep interval with deadline.start() / handle.stop().
  • When launched by the launch manager (detected via the IDENTIFIER env var),
    connects to the supervisor with HealthMonitor::start() and reports
    ExecutionState::Running via the lifecycle client FFI.
  • Persists the final counter value in the stop action into a JSON-backed KVS.
  • Supervision thread is safe standalone (no LM env) and supervised (with LM).

Validation Notes

# Build all three CI-verifiable image targets
bazel build --config=linux-x86_64   //images/linux_x86_64:image
bazel build --config=eb-aarch64     //images/ebclfsa_aarch64:run
bazel run  --config=autosd-x86_64   //images/autosd:image_load

# Showcase bundle only (faster)
bazel build --config=linux-x86_64   //showcases:showcases
bazel build --config=eb-aarch64     //showcases:showcases
bazel build --config=autosd-x86_64  //showcases:showcases

# Run all 21 showcases (linux-x86_64 extracted bundle)
# See docs/ci_local_reproduction_guide.md for extraction steps
/showcases/bin/cli --examples all

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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, /showcases path 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.

Comment thread showcases/cli/main.rs
Comment on lines +311 to +335
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))?
};
Comment thread showcases/standalone/persistency_kvs/main.rs Outdated
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.
Comment thread patches/logging/BUILD Outdated
@@ -0,0 +1,12 @@
# *******************************************************************************
# Copyright (c) 2026 Qorix GmbH

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

score

Comment thread patches/baselibs_rust/BUILD Outdated
@@ -0,0 +1,12 @@
# *******************************************************************************
# Copyright (c) 2026 Qorix GmbH

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

score

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we shouldnt use patches on main branch. Those changes should be introduced and merged to respective modules

Comment thread showcases/cli/main.rs Outdated

// 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";

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

it should ne SCORE_CLI_INIT_DIR or?

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Comment thread showcases/full_stack/BUILD Outdated
@@ -0,0 +1,57 @@
# *******************************************************************************
# Copyright (c) 2026 Qorix GmbH

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

all headers need to be score, pls check all files

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

Fixed.

@@ -26,5 +26,16 @@ if running_on_qnx
then
slay -s $signal -f $process_name

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

qnx didnt need the update?

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

the idea of standalones is to use module examples, not create and maintain them here. Please use examples from pers or move them there.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

same here

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

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.

Comment thread .bazelrc
# 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

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

we really shouldnt use copts in ref_int, why is it needed?

@Subramanian-K812 Subramanian-K812 changed the title Subramanian k812 add module showcases Add module showcases Jun 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants