Commit Graph

11 Commits

Author SHA1 Message Date
Roman Mazur
3f5239b07f
Remove mochainon dependnecy
Change-type: patch
Signed-off-by: Roman Mazur <roman@balena.io>
2019-06-19 23:31:58 +03:00
Cameron Diver
932a6f2997
Fix supervisor tests for node v10.12.0 and above
Changes in the node engine related to streams would cause the gzip
streams flush function to be called at the wrong times. The sinon fake
timers were also interacting with this.

We use setImmediate to call the flush function, and remove sinon timers
for the logging tests.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-10 12:36:46 +01:00
Cameron Diver
e148ce0529
Report all logs from a container's runtime
We add a database table, which holds information about the last
timestamp of a log successfully reported to a backend (local or remote).
We then use this value to calculate from which point in time to start
reporting logs from the container. If this is the first time we've seen
a container, we get all logs, and for every log reported we save the
timestamp. If it is not the first time we've seen a container, we
request all logs since the last reported time, ensuring no interruption
of service.

Change-type: minor
Closes: #937
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-05 10:06:27 +01:00
Cameron Diver
82602abf8d
config: Replace supervisorOfflineMode and offlineMode with unmanaged
Change-type: major
Signed-off-by: Cameron Diver <cameron@balena.io>
2018-12-14 15:01:41 +00:00
Pagan Gazzard
d6e9283a15 Fix coffee-script lint failures 2018-11-02 14:50:12 +00:00
Pablo Carranza Velez
1e47d0c434 test: Use longer delays in logger tests
We've seen at least one case where the 10ms delay
wasn't enough, causing the tests to fail where they shouldn't.

(Ideally we should find a better way to detect when the streams
have finished propagating, but this will avoid failures in the meantime).

Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2018-10-25 16:48:06 -07:00
Cameron Diver
6e2801380b
Support local logging via standard logging interface
Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-10-10 13:02:40 +01:00
Cameron Diver
06bbf9751a
compose: Support changing the tty option for compose services
This enables the switch to be added to the compose, and the handling of
docker messages has been changed to ensure that the multiplexed logs
which result are handled properly.

Change-type: minor
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-09-24 12:04:51 +01:00
Cameron Diver
d3a18da573
Refactor: Convert logging module to typescript
Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-09-03 09:39:06 -07:00
Petros Angelatos
202362241c
logger: Add unit tests
Change-type: minor
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2018-07-18 12:31:14 -07:00
Pablo Carranza Velez
652b596c80 Add some more unit tests to the multicontainer supervisor
We add a bunch of additional unit tests, and also a coverage report using istanbul.

The tests are not meant to cover everything, but they're a first attempt at having *some* unit testing
on the supervisor. There's much to improve but hopefully it helps catch obvious errors.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-04-30 19:39:01 -07:00