Skip to content

feat: make shared memory directory configurable#83

Open
pypingou wants to merge 1 commit into
eclipse-score:mainfrom
pypingou:feature/configurable-shm-directory
Open

feat: make shared memory directory configurable#83
pypingou wants to merge 1 commit into
eclipse-score:mainfrom
pypingou:feature/configurable-shm-directory

Conversation

@pypingou

@pypingou pypingou commented Apr 9, 2026

Copy link
Copy Markdown
Contributor

Make the shared memory file location configurable via SCORE_LOG_SHM_DIR environment variable while maintaining backward compatibility (defaults to /tmp/).

This enables containerized deployments where both the datarouter and applications run in separate containers and communicate via shared memory files. By configuring a specific subdirectory (e.g., /tmp/score-logging or /dev/shm/logging), containers can share only that directory via volume mounts without exposing the entire /tmp or /dev/shm filesystem, which may be used for other purposes by other applications.

Changes:

  • Add path_utils module for shared directory path resolution
  • Update writer_factory.cpp to use configurable path
  • Update socketserver.cpp to use configurable path
  • Auto-create directory if it doesn't exist (0755 permissions)
  • Add unit tests for path utilities (6 tests, all passing)
  • Update BUILD files to integrate path_utils library

Environment variable:

  • SCORE_LOG_SHM_DIR: Directory for shared memory files (default: "/tmp/")

Example usage for containerized datarouter + application:

Both containers set:

export SCORE_LOG_SHM_DIR=/tmp/score-logging

And mount the same volume at /tmp/score-logging

The environment variable also allows flexible deployment for better performance (e.g., /dev/shm on Linux) while ensuring both application and datarouter sides use identical paths.

Notes for Reviewer

Pre-Review Checklist for the PR Author

  • PR title is short, expressive and meaningful
  • Commits are properly organized
  • Relevant issues are linked in the References section
  • Tests are conducted
  • Unit tests are added

Checklist for the PR Reviewer

  • Commits are properly organized and messages are according to the guideline
  • Unit tests have been written for new behavior
  • Public API is documented
  • PR title describes the changes

Post-review Checklist for the PR Author

  • All open points are addressed and tracked via issues

References

Closes #

Make the shared memory file location configurable via SCORE_LOG_SHM_DIR
environment variable while maintaining backward compatibility (defaults to
/tmp/).

This enables containerized deployments where both the datarouter and
applications run in separate containers and communicate via shared memory
files. By configuring a specific subdirectory (e.g., /tmp/score-logging or
/dev/shm/logging), containers can share only that directory via volume
mounts without exposing the entire /tmp or /dev/shm filesystem, which may
be used for other purposes by other applications.

Changes:
- Add path_utils module for shared directory path resolution
- Update writer_factory.cpp to use configurable path
- Update socketserver.cpp to use configurable path
- Auto-create directory if it doesn't exist (0755 permissions)
- Add unit tests for path utilities (6 tests, all passing)
- Update BUILD files to integrate path_utils library

Environment variable:
- SCORE_LOG_SHM_DIR: Directory for shared memory files (default: "/tmp/")

Example usage for containerized datarouter + application:
  # Both containers set:
  export SCORE_LOG_SHM_DIR=/tmp/score-logging
  # And mount the same volume at /tmp/score-logging

The environment variable also allows flexible deployment for better
performance (e.g., /dev/shm on Linux) while ensuring both application
and datarouter sides use identical paths.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@pypingou pypingou requested review from 4og and antonkri as code owners April 9, 2026 12:51
@pypingou pypingou had a problem deploying to workflow-approval April 9, 2026 12:51 — with GitHub Actions Failure
@pypingou pypingou had a problem deploying to workflow-approval April 9, 2026 12:51 — with GitHub Actions Failure
@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

License Check Results

🚀 The license check job ran with the Bazel command:

bazel run --lockfile_mode=error //:license-check

Status: ⚠️ Needs Review

Click to expand output
[License Check Output]
Extracting Bazel installation...
Starting local Bazel server (8.3.0) and connecting to it...
INFO: Invocation ID: cb71c52c-1854-4046-b2c7-8d097b3c4c2c
Computing main repo mapping: 
WARNING: For repository 'rules_python', the root module requires module version rules_python@1.4.1, but got rules_python@1.8.3 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'bazel_skylib', the root module requires module version bazel_skylib@1.7.1, but got bazel_skylib@1.8.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_rust', the root module requires module version rules_rust@0.61.0, but got rules_rust@0.67.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'rules_cc', the root module requires module version rules_cc@0.1.1, but got rules_cc@0.2.16 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'aspect_rules_lint', the root module requires module version aspect_rules_lint@1.0.3, but got aspect_rules_lint@2.0.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'buildifier_prebuilt', the root module requires module version buildifier_prebuilt@7.3.1, but got buildifier_prebuilt@8.2.0.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_rust_policies', the root module requires module version score_rust_policies@0.0.3, but got score_rust_policies@0.0.5 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'googletest', the root module requires module version googletest@1.17.0.bcr.1, but got googletest@1.17.0.bcr.2 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
WARNING: Target pattern parsing failed.
ERROR: Skipping '//:license-check': no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
ERROR: no such target '//:license-check': target 'license-check' not declared in package '' defined by /home/runner/work/logging/logging/BUILD
INFO: Elapsed time: 4.923s
INFO: 0 processes.
ERROR: Build did NOT complete successfully
ERROR: Build failed. Not running target

@github-actions

github-actions Bot commented Apr 9, 2026

Copy link
Copy Markdown

The created documentation from the pull request is available at: docu-html

@anmittag anmittag moved this from Backlog to Ready in LOG - Logging FT Jun 16, 2026
@anmittag anmittag moved this from Ready to Backlog in LOG - Logging FT Jun 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

2 participants