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.
The nodes/tags system has not been particularly successful, it's not as
intuitive as it could be, and in an attempt to be a single feature to address
many use cases, ends up addressing none of them particularly well.
This commit replaces nodes and tags with contexts.
Each job may define which context(s) the job may be associated with.
Laminar will only pop the job off the waiting queue when it can be assigned
to a context. A context defines an integer number of executors, which
represents how many runs can be simultaneously assigned to it. A context
may provide extra environment variables.
Essentially, a context replaces a node, and tags are gone. You just assign
jobs to contexts directly, and you can use a glob expression. This should be
more intuitive.
For grouping jobs in the WebUI, a separate mechanism called "groups" is provided.
Large refactor that more closely aligns the codebase to the kj async
style, more clearly exposes an interface for functional testing and
removes cruft. There is a slight increase in coupling between the
Laminar and Http/Rpc classes, but this was always an issue, just until
now more obscured by the arbitrary pure virtual LaminarInterface class
(which has been removed in this change) and the previous lumping
together of all the async stuff in the Server class (which is now
more spread around the code according to function).
This change replaces the use of Websockets with Server Side Events
(SSE). They are simpler and more suitable for the publish-style messages
used by Laminar, and typically require less configuration of the
reverse proxy HTTP server.
Use of gmock is also removed, which eases testing in certain envs.
Resolves#90.
Fix all hrefs and vue routes to correctly operate against the
<base href> tag. Add a configuration parameter to override the
content of the href attribute, and describe its use.
As discussed in #88, nginx will buffer the chunked transfer-encoding
unless the proxy_buffering directive is disabled, or the
X-Accel-Buffering header is set to no. Do the latter to reduce
configuration burden on frontend reverse-proxy setups.
fix a missing js function call that broke log output in the
webui, and replace TextDecoderStream with TextDecoder because
the former isn't supported in Firefox
Query did not always return the last run as required due to
implementation-defined behaviour of mixing aggregate and
non-aggregate columns with group-by
Lose the boost dependency since recent versions of capnproto's kj
also provide a nice filesystem library. Take the opportunity to
refactor the Run object to become more than POD and to encapsulate
some of the functionality that was done in the Laminar class
Part of #49 refactor
- regressions and recoveries: list of jobs whose run status changed,
ordered first by currently failing jobs, secondly by count of jobs
since the status change, descending for currently failing jobs and
ascending for currently passing jobs
- low pass rates: list of the jobs with the worst pass rates calculated
over all time
- run time changes: jobs with the largest changes in build time. This
is calculated as the difference between the range and the standard
deviation over the past 10 runs.
- average run time distribution: shows the number of jobs in the
system divided into buckets based on their average runtime
The computed list of filtered jobs wasn't updated when a notification
was received from the server. Switch to using a method rather than a
computed property to fix this. Also add tags to jobs reported in
job_started and job_completed notifications
This feature allows runs to be sorted by result, number, start time
or duration, in ascending or descending order, on the Job page. Request
is processed server-side so that the correct page division can be done.
Currently running jobs are not sorted.
This is a refactor that more cleanly uses the kj framework for handling
processes spawned by Runs. This obviates the workaround introduced back in
ff42dae7cc, and incidentally now requires c++14.
Part of #49 refactor
The old implementation slurped the whole artefact into memory, and
did not ensure it remained allocated beyond the first call to write().
The new implementation uses mmap and ensures the mapping lasts until
the file has been delivered
The previous implementation meant that messages could get lost if
both sending and receiving were scheduled to be processed in the
same event loop cycle. This commit separates the two channels
more clearly, while still allowing the close event in the receive
side to cancel the whole pipeline
Part of #49 refactor
Now that capnp/kj provides http and websocket functions, replace
the excellent websocketpp library with the kj functions. This
removes a dependency and allows for more consistent idiomatic
code. Thanks websocketpp, it was great to have you along!
This should enable parts of the refactor described in #49
Caddy (and probably other webservers) add a Content-Type header
when one was not supplied by the application backend. Under Chromium,
the css file is not interpreted if the webserver delivers it with
Content-Type: text/plain, althugh it does work if no Content-Type
header is set. To prevent the frontend proxy from adding the wrong
header, set it correctly in the first place
Read or writes to bad file descriptors threw exceptions, just log
this instead. Also make sure that LaminarClients are removed from
the list of clients when a connection is aggressively dropped, and
add test
On 32-bit Linux, time_t is a long. Laminar extensively uses
time_t but provided only int and int64 db access, making the
use of long ambiguous. Since there is no explicit use of int64,
and because on 32-bit Linux long and int are recognized as
different types despite being the same width, replacing the
int64 handlers with long handlers fixes the compile error
This implements web notifications on job completion. Opt-in
by default, the preference is saved in js localStorage and
can be toggled directly on any page
Now explicitly closed connections on the client side are
closed with a clean error code. This is motivated by upcoming
work to detect broken websockets and automatically reconnect
This fixes a bug where the last pieces of console output were lost. In that
case, the event loop scheduled the ended child process's SIGCHLD handler
before the handler to read the last of the process's output. We work around
that by doing an additional (non-blocking) read in the SIGCHLD handler
reading into a static buffer is a race condition that is only
manifested under load. There's no guarantee the clause in then()
will run before another task overwrites the buffer. Allocating
a local string is the only correct solution