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 #

@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.6.0) and connecting to it...
INFO: Invocation ID: e7af0af6-bbcc-4d43-bad1-43e8ac22302d
Computing main repo mapping: 
Computing main repo mapping: 
WARNING: For repository 'score_process', the root module requires module version score_process@1.5.4, but got score_process@1.6.0 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
WARNING: For repository 'score_crates', the root module requires module version score_crates@0.0.9, but got score_crates@0.0.10 in the resolved dependency graph. Please update the version in your MODULE.bazel or set --check_direct_dependencies=off
Computing main repo mapping: 
Computing main repo mapping: 
Loading: 
Loading: 4 packages loaded
Loading: 4 packages loaded
    currently loading: 
Loading: 4 packages loaded
    currently loading: 
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: 8.902s
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
@github-actions

Copy link
Copy Markdown

Thanks for the pull request. This thread has been quiet for 30 days, so we are marking it as stale for now. Please take a quick look and let us know whether it is still up to date, still relevant, needs review, or is ready to merge. Any new activity will remove the stale label automatically. If nothing changes in the next 10 days, we will close it to keep the backlog current.

@github-actions github-actions Bot added the stale label Jul 17, 2026
@pypingou

Copy link
Copy Markdown
Contributor Author

I still think this could be an interesting addition and am looking for feedback

@github-actions github-actions Bot removed the stale label Jul 23, 2026
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 force-pushed the feature/configurable-shm-directory branch from 6fdf3cf to 53640e1 Compare July 23, 2026 10:45
@pypingou
pypingou requested a review from rmaddikery as a code owner July 23, 2026 10:45
@pypingou
pypingou requested a deployment to workflow-approval July 23, 2026 10:45 — with GitHub Actions Waiting
@pypingou
pypingou requested a deployment to workflow-approval July 23, 2026 10:45 — with GitHub Actions Waiting
@pypingou
pypingou requested a deployment to workflow-approval July 23, 2026 10:45 — with GitHub Actions Waiting
@pypingou
pypingou requested a deployment to workflow-approval July 23, 2026 10:45 — with GitHub Actions Waiting
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