Add on-disk log preservation, configurable install prefix, and log output command#232
Closed
rkoshy wants to merge 1 commit intoohwgiles:masterfrom
Closed
Add on-disk log preservation, configurable install prefix, and log output command#232rkoshy wants to merge 1 commit intoohwgiles:masterfrom
rkoshy wants to merge 1 commit intoohwgiles:masterfrom
Conversation
…tput command
This PR adds three related features that improve troubleshooting and
integration with command-line workflows:
1. On-Disk Log Preservation (LAMINAR_ON_DISK_LOGS)
- Adds optional uncompressed log files alongside database storage
- Controlled by LAMINAR_ON_DISK_LOGS=N environment variable
- Writes logs to ${LAMINAR_HOME}/archive/JOB/RUN/log
- Keeps N most recent logs per job with automatic rotation
- Independent of LAMINAR_KEEP_RUNDIRS (for remote build scenarios)
- Backward compatible (disabled by default when N=0)
2. Configurable Default LAMINAR_HOME
- Uses CMAKE_INSTALL_PREFIX to set default LAMINAR_HOME
- Enables self-contained installations (e.g., /opt/laminar)
- Falls back to /var/lib/laminar if not set
- Reduces configuration needed for non-standard installations
3. Log Output Command (laminarc output-log)
- New command: laminarc output-log JOB [RUN]
- Outputs build logs to stdout for command-line use
- Defaults to latest run if RUN not specified
- Shows header with actual run number
- Enables integration with grep, less, AI coding assistants, etc.
Motivation:
- Database-only logs require SQL queries and decompression for access
- Standard Unix tools (grep, tail, less) cannot be used directly
- AI coding assistants and automated tools need simple log access
- Custom installation paths require manual LAMINAR_HOME configuration
Benefits:
- Direct log access with standard Unix tools
- Better troubleshooting workflow for CI/CD debugging
- Easier integration with log analysis tools and AI assistants
- More flexible installation options
- No breaking changes to existing deployments
Owner
Logs are already on-disk in a simple sqlite database
You can already use curl to get the logs, this is very command-line friendly. Sorry, I don't think this is a useful addition
I don't think setting
Use curl Low effort AI-generated PRs are unwelcome here. Read the documentation and engage succinctly as a human being if you would like to participate. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR adds three related features that improve troubleshooting workflows and make Laminar more accessible to command-line tools and AI coding assistants.
Features
1. On-Disk Log Preservation (
LAMINAR_ON_DISK_LOGS)LAMINAR_ON_DISK_LOGS=Nenvironment variable${LAMINAR_HOME}/archive/JOB/RUN/logLAMINAR_KEEP_RUNDIRS(important for remote build scenarios)2. Configurable Default
LAMINAR_HOMELAMINAR_HOMEis hardcoded to/var/lib/laminar, requiring manual configuration for custom installationsCMAKE_INSTALL_PREFIXto set intelligent default${CMAKE_INSTALL_PREFIX}/var(e.g.,/opt/laminar/var)/var/lib/laminarif not set3. Log Output Command (
laminarc output-log)laminarc output-log JOB [RUN]Motivation
Command-Line CI/CD Workflows
When running builds from command line (not through web UI):
grep,tail,less) cannot be used directlyAI Coding Assistant Integration
Modern AI coding assistants (Claude, GitHub Copilot, etc.) work best with:
This PR makes Laminar logs accessible through standard patterns these tools understand.
Example Usage
Enable on-disk logs (in
/etc/laminar.conf):LAMINAR_ON_DISK_LOGS=4 # Keep 4 most recent logs per jobView logs from command line:
Custom installation path:
cmake .. -DCMAKE_INSTALL_PREFIX=/opt/laminar make install # Now /opt/laminar/var is the default LAMINAR_HOMEImplementation Details
LAMINAR_ON_DISK_LOGS > 0)/opt/laminarinstallationBenefits
✅ Direct log access with standard Unix tools
✅ Better troubleshooting workflow for CI/CD debugging
✅ Easier integration with log analysis tools and AI assistants
✅ More flexible installation options
✅ No breaking changes to existing deployments
✅ Self-contained installations without manual configuration
Related Discussion
This addresses the common need for easier log access in command-line workflows, particularly for: