1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2026-02-10 01:50:07 +00:00
Commit Graph

30 Commits

Author SHA1 Message Date
Renny Koshy
a91ebc610c Add on-disk log preservation, configurable install prefix, and log output 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
2025-12-28 05:31:03 -05:00
Oliver Giles
41ddd8fe4f allow adding job to front of queue
laminarc now supports {queue,start,run} --next to place the job at the
front of the queue instead of at the end.

resolves #162
2022-01-22 15:18:43 +13:00
Oliver Giles
e1686d454b display run number for queued jobs
in the frontend and in laminarc queue/show-queued. This makes
it much easier to abort/unqueue runs which have not yet started.

resolves #155
2021-12-05 13:42:27 +13:00
Alex Myczko
882978fa77
Update client.cpp (#137)
fix typo
2020-12-09 07:48:29 +13:00
Oliver Giles
1a5292f141 remove old trigger command
it has been deprecated for a while now
2020-12-05 13:55:11 +13:00
Oliver Giles
06a5f3d8ef assign run numbers at queue time
This allows build chains to be traced in the common case where
an upstream job calls `laminarc queue' instead of `laminarc start'.
Incomplete job runs now have database entries, which requires
some adjustments in queries. Queued jobs can now be viewed in
the frontend and there is a corresponding status icon.
2020-09-25 15:29:30 +12:00
Oliver Giles
7f7e8d2455 downstream link signal only within job
only add the private ANSI sequence to the output of laminarc
start/run commands used for adding a hyperlink to the frontend if
we are within a job execution (tested with __LAMINAR_SETENV_PIPE).
this makes parsing the output easier, which is likely to be more
common when laminarc is invoked externally
2020-07-03 18:11:29 +12:00
Oliver Giles
d6be7f5079 fix minor compile warnings 2020-07-03 17:31:44 +12:00
Oliver Giles
09a208ebeb report version and usage messages
add -h|--help usage messages to laminarc and laminard

add a mechanism to compile in a version number, and display the
version in the help messages and in the frontend.

resolves #119
2020-07-03 15:13:11 +12:00
Oliver Giles
081becf23a laminarc: correct variable lifetime of show-jobs etc
the one-liner used to iterate on the results of the RPC
calls for show-jobs, show-queued and show-running meant
that the result collection was destroyed before we
finished with it. Hoist it out of the loop.

resolves #127
2020-06-14 07:49:02 +12:00
Oliver Giles
eadcdbdf9c laminarc: improve exit codes and errors
- return non-zero when failed to connect to laminard
- only output trigger links on successful trigger
- better error messages

Resolves #121
2020-04-25 08:49:39 +12:00
Oliver Giles
3fde38c6b8 job leader process
Implement a separate process, the "leader", which runs all the
scripts for a job run, instead of directly from the main laminard
process. This makes for a cleaner process tree view, where the
owning job for a given script is clear; also the leader process
acts as a subreaper to clean up any wayward descendent processes.

Resolves #78.
2019-12-23 07:56:37 +02:00
Oliver Giles
7b418a546c add uint typedef
Needed for musl
2019-07-04 12:28:33 +03:00
Oliver Giles
bcb8b438f3 laminarc: more explicit return codes 2019-04-11 21:00:00 +03:00
Oliver Giles
7cee824cee resolves #67: laminarc list jobs
Implements the following laminarc commands:
- show-jobs
- show-running
- show-queued
- abort
2018-10-12 17:22:21 +03:00
Oliver Giles
63301c73d9 resolves #61: clickable up/downstream triggers
Recognises triggers in build logs and converts them to
hyperlinks. Also separates upstream job from reason string
and allows both to be provided
2018-09-30 09:04:17 +03:00
Oliver Giles
18012a8d7a resolves #63: remove locks
Add an example to the User Manual for using flock instead
2018-09-28 12:43:46 +03:00
Oliver Giles
f1e4d10be3 resolves #36: queue/start/run 2018-05-12 17:56:56 +03:00
Oliver Giles
a5d8b985f1 laminarc: replace start with run 2018-04-06 13:43:38 +03:00
Oliver Giles
4d2388c271 resolves #33: laminar start output should reference run number 2018-04-06 13:35:02 +03:00
Oliver Giles
74443c292a Fix copyright years
This reverts commit 4e911756bc.

In addition, copyright years are now expressed in the form of
(year file added)-(year file last changed)
2017-12-09 12:21:34 +02:00
palica
3c658abb27
typo 2017-11-07 01:37:21 +01:00
Oliver Giles
636dfb8651 use shorter build vars in traditional style 2017-08-16 09:08:57 +03:00
Oliver Giles
0b9fb54b02 laminarc: read LAMINAR_BIND_RPC 2017-08-15 08:41:53 +03:00
Oliver Giles
56d2f30976 align abstract socket address syntax to new capnp 2017-08-15 08:33:07 +03:00
Oliver Giles
eda906b805 refactor: remove transport knowledge from Laminar class
Improve the boundary between RpcImpl and LaminarInterface such
that the Laminar class doesn't require any types from kj/async.h.
The necessary logic moved from Laminar to RpcImpl and the notification
now happens by abstract virtual callback instead of kj::Promise.
Also remove the fairly useless 'wait' RPC call and drop the wrappers
around kj::PromiseFulfillerPair
2017-08-10 08:25:20 +03:00
Oliver Giles
ab99af7ca7 implement general-purpose locks 2017-08-10 07:40:30 +03:00
Oliver Giles
4e911756bc update copyright year 2016-07-25 15:00:49 +03:00
Oliver Giles
b3cd9929b7 client: when job fails, still wait for others to complete 2015-11-01 11:25:43 +01:00
Oliver Giles
a2701dcfd9 Initial commit 2015-09-13 22:25:26 +02:00