{"id":47795023,"url":"https://github.com/eclipse-score/scrample","last_synced_at":"2026-04-03T16:13:53.073Z","repository":{"id":322420925,"uuid":"1062432771","full_name":"eclipse-score/scrample","owner":"eclipse-score","description":"Repository for example component","archived":false,"fork":false,"pushed_at":"2026-03-14T00:15:51.000Z","size":3976,"stargazers_count":3,"open_issues_count":7,"forks_count":10,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-03-14T02:57:54.751Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://eclipse-score.github.io/scrample","language":"C++","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/eclipse-score.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":"NOTICE","maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-09-23T08:49:11.000Z","updated_at":"2026-03-13T14:52:02.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/eclipse-score/scrample","commit_stats":null,"previous_names":["eclipse-score/scrample"],"tags_count":3,"template":false,"template_full_name":"eclipse-score/module_template","purl":"pkg:github/eclipse-score/scrample","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-score%2Fscrample","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-score%2Fscrample/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-score%2Fscrample/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-score%2Fscrample/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/eclipse-score","download_url":"https://codeload.github.com/eclipse-score/scrample/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/eclipse-score%2Fscrample/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31362716,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-03T15:19:21.178Z","status":"ssl_error","status_checked_at":"2026-04-03T15:19:20.670Z","response_time":107,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-03T16:13:52.288Z","updated_at":"2026-04-03T16:13:53.060Z","avatar_url":"https://github.com/eclipse-score.png","language":"C++","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SCRAMPLE\n\n[![Build Status](https://github.com/eclipse-score/scrample/actions/workflows/build.yml/badge.svg)](https://github.com/eclipse-score/scrample/actions/workflows/build.yml)\n[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)\n\n**SCRAMPLE** (S-CORE + Sample) is a demonstration application showcasing the inter-process communication (IPC) capabilities of the [Eclipse S-CORE](https://projects.eclipse.org/projects/automotive.score) platform for Software Defined Vehicles (SDVs).\n\n## Overview\n\nThis application demonstrates a producer-consumer pattern using S-CORE's middleware communication layer. It illustrates:\n\n- **Event-based communication** using the S-CORE middleware (`score::mw::com`)\n- **Shared memory IPC** for high-performance data transfer between processes\n- **Type-safe serialization** of complex automotive data structures\n- **Skeleton-Proxy pattern** following AUTOSAR Adaptive Platform concepts\n\nThe sample exchanges `MapApiLanesStamped` messages containing lane information data structures, simulating real-world automotive HD map data exchange scenarios.\n\n## Architecture\n\nSCRAMPLE consists of two operational modes:\n\n### Skeleton (Publisher/Server)\n- Offers a service instance identified by `score/MapApiLanesStamped`\n- Generates and publishes lane data samples at a configurable cycle rate\n- Populates complex nested data structures with randomized values\n- Computes hash values for data integrity verification\n\n### Proxy (Subscriber/Client)\n- Discovers and connects to the skeleton service\n- Subscribes to receive lane data events\n- Validates received samples for ordering and data integrity\n- Supports both event-driven callbacks and polling modes\n\n## Prerequisites\n\n- **Bazel** 8.3.0 or higher (see `.bazelversion`)\n- **QNX SDP** (for cross-compilation to QNX targets)\n- **C++17** compatible compiler\n- **Rust toolchain** (automatically managed by Bazel for Rust tests)\n- **Dependencies** (automatically managed via Bazel):\n  - S-CORE Base Libraries (`score_baselibs`)\n  - S-CORE Communication (`score_communication`)\n  - Boost.Program_Options\n  - GoogleTest (for C++ tests)\n  - Rust toolchain (for Rust tests)\n\n## Building\n\n### Standard Build (Host Platform)\n```bash\nbazel build --config=host //src:scrample\n```\n\n### QNX Cross-Compilation\n```bash\nbazel build --config=x86_64-qnx //src:scrample\n```\n\n### Build All Tests\n```bash\nbazel test --config=host //tests/...\n```\n\n**Note:** Always use a build configuration (`--config=host` or `--config=x86_64-qnx`) to ensure proper dependency settings.\n\n## Running\n\nAfter building with `--config=host`, the binary will be in `bazel-bin/src/scrample`.\n\n### Quick Start (Two Terminals)\n\nTo see the IPC communication in action, open two terminals:\n\n**Terminal 1 - Start Skeleton (Publisher):**\n```bash\n./bazel-bin/src/scrample \\\n  --mode skeleton \\\n  --cycle-time 1000 \\\n  --num-cycles 10 \\\n  --service_instance_manifest src/etc/mw_com_config.json\n```\n\n**Terminal 2 - Start Proxy (Subscriber):**\n```bash\n./bazel-bin/src/scrample \\\n  --mode proxy \\\n  --cycle-time 500 \\\n  --num-cycles 20 \\\n  --service_instance_manifest src/etc/mw_com_config.json\n```\n\nYou should see the proxy discover the skeleton service, subscribe, and receive `MapApiLanesStamped` samples. The proxy validates data integrity and ordering for each received sample.\n\n### Start Skeleton (Publisher)\n```bash\n./bazel-bin/src/scrample \\\n  --mode skeleton \\\n  --cycle-time 1000 \\\n  --num-cycles 10 \\\n  --service_instance_manifest src/etc/mw_com_config.json\n```\n\n### Start Proxy (Subscriber)\n```bash\n./bazel-bin/src/scrample \\\n  --mode proxy \\\n  --cycle-time 500 \\\n  --num-cycles 20 \\\n  --service_instance_manifest src/etc/mw_com_config.json\n```\n\n### Command-Line Options\n\n| Option | Description | Required |\n|--------|-------------|----------|\n| `--mode, -m` | Operation mode: `skeleton`/`send` or `proxy`/`recv` | Yes |\n| `--cycle-time, -t` | Cycle time in milliseconds for sending/polling | Yes |\n| `--num-cycles, -n` | Number of cycles to execute (0 = infinite) | Yes |\n| `--service_instance_manifest, -s` | Path to communication config JSON | Optional |\n| `--disable-hash-check, -d` | Skip sample hash validation in proxy mode | Optional |\n\n## Configuration\n\nThe communication behavior is configured via `src/etc/mw_com_config.json`:\n\n- Service type definitions and bindings\n- Event definitions with IDs\n- Instance-specific configuration (shared memory settings, subscriber limits)\n- ASIL level and process ID restrictions\n\n## Project Structure\n\n```\nscrample/\n├── src/\n│   ├── main.cpp                  # Entry point and CLI argument parsing\n│   ├── sample_sender_receiver.cpp # Core skeleton/proxy logic\n│   ├── datatype.h                # Data type definitions\n│   ├── assert_handler.cpp        # Custom assertion handling\n│   └── etc/\n│       ├── mw_com_config.json    # Communication configuration\n│       └── logging.json          # Logging configuration\n├── tests/\n│   ├── cpp/                      # C++ unit tests (GoogleTest)\n│   └── rust/                     # Rust tests\n├── scorex/                       # CLI tool for generating S-CORE projects\n│   ├── main.go                   # Entry point\n│   ├── cmd/                      # Cobra CLI commands\n│   ├── internal/                 # Internal packages\n│   └── README.md                 # scorex documentation\n├── docs/                         # Sphinx documentation\n└── BUILD                         # Bazel build definitions\n```\n\n**For information about the scorex CLI tool, see [scorex/README.md](scorex/README.md).**\n\n## Development\n\n### Code Formatting\nApply automatic formatting fixes:\n```bash\nbazel run //:format.fix\n```\n\n### Check Formatting\nCheck if code formatting is correct:\n```bash\nbazel test //:format.check\n```\n\n### Copyright Checking\nVerify copyright headers are present:\n```bash\nbazel run //:copyright.check\n```\n\n### Build Documentation\nBuild Sphinx documentation:\n```bash\nbazel build //:docs\n```\n\n**Note:** Formatting and documentation commands don't require `--config` flags.\n\n## Testing\n\nThe project includes example tests demonstrating the testing infrastructure:\n\n- **C++ Tests**: GoogleTest-based unit tests in `tests/cpp/`\n- **Rust Tests**: Rust test framework in `tests/rust/`\n\nRun all tests:\n```bash\nbazel test --config=host //tests/...\n```\n\nRun all tests and format checks:\n```bash\nbazel test --config=host //tests/... //:format.check\n```\n\n## Contributing\n\nSCRAMPLE is part of the Eclipse S-CORE project. Contributions are welcome!\n\n1. Read the [Contributing Guide](CONTRIBUTION.md)\n2. Sign the [Eclipse Contributor Agreement (ECA)](https://www.eclipse.org/legal/ECA.php)\n3. Follow the [Developer Certificate of Origin (DCO)](https://www.eclipse.org/legal/dco/)\n4. Submit pull requests via GitHub\n\nFor questions and discussions:\n- Mailing list: [score-dev](https://accounts.eclipse.org/mailing-list/score-dev)\n- Chat: [Eclipse S-CORE Matrix Room](https://chat.eclipse.org/#/room/#automotive.score:matrix.eclipse.org)\n\n## License\n\nThis project is licensed under the [Apache License 2.0](LICENSE).\n\nCopyright © 2025 Contributors to the Eclipse Foundation.\n\n## Related Projects\n\n- [Eclipse S-CORE](https://projects.eclipse.org/projects/automotive.score) - Main project\n- [S-CORE Documentation](https://eclipse-score.github.io) - Full platform documentation\n- [S-CORE Communication](https://github.com/eclipse-score/communication) - IPC middleware\n- [S-CORE Base Libraries](https://github.com/eclipse-score/baselibs) - Core utilities\n\n## Troubleshooting\n\n### Runtime Warnings\nWhen running the application, you may see:\n```\nmw::log initialization error: Error No logging configuration files could be found.\nFallback to console logging.\n```\nThis is expected and harmless. The application falls back to console logging when the optional logging configuration isn't found at the expected system location.\n\n### Build Warnings\nYou may see deprecation warnings during compilation related to:\n- `string_view` null-termination checks\n- `InstanceSpecifier::Create()` API deprecations\n\nThese are intentional warnings from the S-CORE libraries and do not prevent successful builds. They are addressed in the `.bazelrc` configuration with `-Wno-error=deprecated-declarations`.\n\n### Build Configuration Required\nAlways use a build configuration (`--config=host` or `--config=x86_64-qnx`). Building without a config flag will fail with missing dependency errors because the required S-CORE library flags (like `tracing_library=stub`) won't be set.\n\n### QNX Builds\nQNX cross-compilation requires:\n- QNX SDP installation and license\n- Proper credential setup (see `.github/workflows/build.yml` for CI example)\n\n## Roadmap\n\nFuture extensions planned for SCRAMPLE:\n\n- Additional S-CORE platform module demonstrations\n    - [FEO demo application](feo/ad-demo/README.md)\n- More complex communication patterns\n- Performance benchmarking utilities\n- Integration with other S-CORE components\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipse-score%2Fscrample","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Feclipse-score%2Fscrample","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Feclipse-score%2Fscrample/lists"}