1
0
mirror of https://github.com/ohwgiles/laminar.git synced 2024-09-28 14:30:45 +00:00
Commit Graph

40 Commits

Author SHA1 Message Date
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
Jan-Benedict Glaw
7e77ec1211 Allow subdirs in artifacts directory
Extend populateArtifacts() with a subdir parameter (default initialized to ".")
to allow for recursive calls. With subdirs encountered, call recursively.
2021-03-08 20:30:59 +13:00
Oliver Giles
ec237f475e deprecate custom css
replaced by custom index html page
2020-12-05 13:54:35 +13:00
Oliver Giles
4fb95fcb4f allow contexts to specify accepted jobs
using a glob expression, the same way jobs can specify
contexts. This allows more flexibility in situations where
there are many jobs sharing limited contexts because it
may obviate the need to create a conf file for each job.

resolves #124
2020-11-13 13:47:02 +13:00
Oliver Giles
9862affd98 fix warnings under clang++ 2020-09-26 11:33:36 +12:00
Cameron Eagans
2e54773e83
Add the ability to customize index.html (#113)
User may provide a custom index.html template file to be used instead
of the built-in version. Changes to this file are watched by laminard
using inotify in order to load and compress the custom file for gzip
delivery, reusing the existing method for serving static assets.

This feature obviates the custom css feature, so remove references from
the manual and add a deprecation warning if it is used.

Add a section to the UserManual describing how to use this feature and
including a link to an example using Semantic UI.
2020-03-10 19:40:14 +02:00
Oliver Giles
2bf04d8157 allow setting a job description
adding DESCRIPTION=foo to $JOBNAME.conf will display "foo"
in the job overview page on the frontend

Resolves #97
2019-12-25 14:37:16 +02: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
0384fc9a0a
Replace nodes/tags with contexts
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.
2019-12-13 10:42:22 +02:00
Oliver Giles
39ca7e86cf replace websockets with sse and refactor
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.
2019-10-05 20:06:35 +03:00
Oliver Giles
cec4721e52 resolves #79: serve logs over plain chunked http 2019-02-15 19:05:44 +02: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
08b3f25a22 Replace boost/filesystem with kj/filesystem
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
2018-09-28 12:43:40 +03:00
Oliver Giles
132d40e6a3 resolves #50: badge url
Implements serving of an SVG badge at the url /badge/JOB.svg which
prettily shows the job's current status
2018-09-10 14:51:43 +03:00
Oliver Giles
a81492e5bc use kj's onChildExit mechanism
This reduces code and allows for more idiosyncratic use of Promises.
Requires latest capnproto git.

Part of #49 refactor
2018-08-03 14:36:24 +03:00
Oliver Giles
4ffc22c657 use promises to control job runs
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
2018-07-20 17:40:56 +03:00
Oliver Giles
758b5f2e46 resolves #37: closed connection on large files
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
2018-07-06 13:18:04 +03:00
Oliver Giles
083f136186 resolves #41: strange behaviour of limits
On a configuration change, update existing Nodes in Laminar's NodeMap
rather than replacing it with a new map.
2018-04-20 14:18:10 +03:00
Oliver Giles
216ecee7c5 resolves #34: watch for configuration changes
Reload the configuration if a change is detected
without requiring a server restart
2018-04-06 18:04:50 +03:00
Oliver Giles
9c256815e4 resolves #29: graceful shutdown
on SIGINT/SIGTERM:
1. stop accepting new connections
2. send SIGTERM to all child tasks
3. wait for processes to end
4. drop all websockets
2018-02-24 18:53:11 +02:00
Oliver Giles
93b428529e webui may be modified with custom style.css 2017-12-29 11:14:20 +02:00
Oliver Giles
3129f0e73b fix pedantic compiler warnings 2017-12-21 08:19:45 +02:00
Oliver Giles
e0a130f33d add named getters to RunSet
this improves readability by removing the index-based
get<> methods in favour of explicitly named methods
2017-12-20 09:02:15 +02:00
Oliver Giles
bb9486e066 use compliant include guards 2017-12-20 08:24:25 +02:00
Oliver Giles
ff42dae7cc read remaining data in run pipe when reaping
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
2017-12-09 20:27:08 +02:00
Oliver Giles
76e0e9e62a resolves #22: allow keeping N rundirs
This replaces LAMINAR_KEEP_RUNDIR (bool) with LAMINAR_KEEP_RUNDIRS (int)
2017-12-09 20:23:24 +02: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
Oliver Giles
32426ee34f rundir could not be kept, use consistent naming 2017-10-14 17:51:24 +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
4e911756bc update copyright year 2016-07-25 15:00:49 +03:00
Oliver Giles
2ea27d46ed implement proper child cleanup 2016-07-25 14:59:45 +03:00
Oliver Giles
82b39c2961 compress logs in database 2015-12-06 13:47:43 +01:00
Oliver Giles
d44d5ba0e6 boost compatibility 2015-11-19 21:43:08 +01:00
Oliver Giles
e140221c72 cleanup, dynamically present artifacts 2015-11-01 11:28:22 +01:00
Oliver Giles
0df97e95fd support for job and node tags 2015-09-24 22:02:11 +02:00
Oliver Giles
a729a6782e implement display and serving of archived artifacts 2015-09-19 17:24:20 +02:00
Oliver Giles
dbc75000a5 readability: move runFinished into its own function 2015-09-19 15:41:19 +02:00
Oliver Giles
ae59da1245 implement LAMINAR_KEEP_WORKDIR 2015-09-19 15:29:07 +02:00
Oliver Giles
f260b7813c remove iniparser, laminar.conf must be sourced 2015-09-19 14:36:03 +02:00
Oliver Giles
a2701dcfd9 Initial commit 2015-09-13 22:25:26 +02:00