Commit Graph

11 Commits

Author SHA1 Message Date
Cameron Diver
e44c7073f9
Fix retrieval of container log timestamp from db
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-11-20 11:23:11 -08:00
Theodor Gherzan
54e9c2edd8
Run new prettier on code base
Signed-off-by: Theodor Gherzan <theodor@balena.io>
2019-11-15 14:51:24 +00:00
Cameron Diver
7d1da38184 Catch and report cloud stream writing errors
If an error fires when writing to the cloud stream, it can stop any
calling processes from completing. Given that a logging failure should
not cause other processes to cancel, we catch and report the error but
otherwise do nothing else.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-09-18 08:48:26 +01:00
Cameron Diver
37945b4aa5 Don't attempt to setup a log stream to the cloud before provision
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-07-09 13:21:05 +01:00
Cameron Diver
2276dd54e1 Standardise all supervisor output logging
Also use the supervisor's own container logging monitoring code when
running livepush on the supervisor container.

Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-06-10 11:38:45 +01:00
Cameron Diver
8279678052
Add wrapper around container logs saving, to reduce db load
Changes are collected together and exist in memory, for querying and
saving. Once every 10 mins, every changed timestamp is flushed to the
database.

Change-type: patch
Closes: #987
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-28 15:56:11 +01:00
Cameron Diver
2a27b1d51f Move to resin-lint 3 and fix lint errors
This is a massive commit, but nothing related to runtime has actually
changed, only the lint errors have changed.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-26 18:54:09 +01: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
760b18dd2a
fix: Fix non-tty container message parsing
This had a bug where it was using the `in` operator on a list. It may
have worked for some cases, but would have failed for others.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-05 10:06:28 +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
25fd11bed3
Refactor container logging interface and rename logging-backends
Container logging is now handled by a class which attaches and emits
information from the container. We add these to the directory
logging-backends/, and rename it to logging/.

Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-05 10:06:26 +01:00