Commit Graph

4978 Commits

Author SHA1 Message Date
8424fb44f6 Perform case-insensitive checking when converting booleans from strings
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-01 12:33:20 +01:00
558424ecee v9.14.6 v9.14.6 2019-04-25 19:27:44 +03:00
fe477d65a8 Merge pull request #966 from balena-io/fix-db-cleanup-code
fix: Run db log cleanup on init - after migrations
2019-04-25 17:25:57 +01:00
9fae4bab62 fix: Run db log cleanup on init - after migrations
Before this change the first time the cleanup code runs would be before
the migrations have had a chance to execute. This change makes it so
that the cleanup code always runs once the migrations have finished.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-25 16:56:29 +01:00
42aaf81d0b v9.14.5 v9.14.5 2019-04-25 18:13:26 +03:00
84c03f89ba Merge pull request #969 from balena-io/968-multiple-ports
Handle multiple host ports pointing to a single container port
2019-04-25 16:11:35 +01:00
9e05bc2b71 misc: Fix spurious test errors
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-25 13:48:27 +01:00
0fa47f635b fix: Correctly handle multiple hosts ports pointing to a container port
When assigning multiple host ports to a single container port before
this change, the supervisor would incorrectly take only the first host
port into consideration. This change makes it so that every host port
per container port is considered.

Closes: #986
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-25 13:48:04 +01:00
8b551ebc7b v9.14.4 v9.14.4 2019-04-11 13:07:44 +03:00
7be1fa3c08 Merge pull request #964 from balena-io/fix-double-expose
compose: Remove unique expose entries after adding all entries
2019-04-11 11:05:32 +01:00
9e3fae5852 compose: Remove unique expose entries after adding all entries
Prior to this change, we would `_.uniq` the expose value before adding
values from the port mappings. This could cause ports to get added
twice, which would cause the supervisor to think that there is a
configuration mismatch.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-11 10:20:20 +01:00
105d3889af v9.14.3 v9.14.3 2019-04-11 00:09:09 +03:00
d0191309b7 Merge pull request #962 from balena-io/fix-local-mode-exit-state-report
Don't attempt to report any state during local mode
2019-04-10 22:07:20 +01:00
892cf1961e Don't attempt to report any state during local mode
Even though this would never have attempted to report the state to the
api during local mode, it leaves behind artifacts which would cause the
state to be sometimes reported when exiting local mode. This would cause
the api to reject the update unecessarily.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-10 15:40:52 +01:00
0b1d2b7702 v9.14.2 v9.14.2 2019-04-08 14:17:09 +03:00
fe32d76f6e Merge pull request #960 from balena-io/update-dockerode-types
types: Upgrade dockerode types, and remove fixes which are superceded
2019-04-08 12:15:03 +01:00
80031b76e4 types: Upgrade dockerode types, and remove fixes which are superceded
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-08 10:46:28 +01:00
3539ad467a v9.14.1 v9.14.1 2019-04-05 16:20:12 +03:00
795d72f1b4 Merge pull request #958 from balena-io/957-remove-default-avahi-services
avahi: Remove default service definitions
2019-04-05 14:17:47 +01:00
24ba07571c avahi: Remove default service definitions
Removes default 'example' service definitions that
are included by Avahi 0.7+. These conflict with
our balenaOS advertised services, causing potential
issues.

Connects-to: #957
Change-type: patch
Signed-off-by: Heds Simons <heds@balena.io>
2019-04-05 13:33:45 +01:00
08fe5504ce v9.14.0 v9.14.0 2019-04-05 12:29:08 +03:00
eeaa2fcfc9 Merge pull request #955 from balena-io/937-better-logs
Better supervisor and container logging
2019-04-05 10:26:36 +01:00
5943d3117c Run database cleanup on startup in addition to once a day
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-05 10:06:29 +01:00
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
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
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
196f173e13 ux: Show a supervisor starting log message in dashboard
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-05 10:06:25 +01:00
0504776169 ux: Remove service already running log message
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-05 10:06:24 +01:00
b82eb6efd6 v9.13.0 v9.13.0 2019-04-03 20:08:09 +03:00
7be35d783e Merge pull request #934 from balena-io/polling-jitter
Add a random jitter to target state polls, and a config var to ignore…
2019-04-03 10:06:21 -07:00
3d0e35f2a2 Fix test for deviceConfig.getDefaults with the addition of SUPERVISOR_INSTANT_UPDATE_TRIGGER
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2019-04-03 09:15:50 -07:00
9961ebb41d In /v1/update, return 202 when we're not updating immediately
We also add a catch to any errors when getting configuration, and send 503 in this case, even if it's
unlikely.

Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2019-04-03 09:15:50 -07:00
8f07bf62de Add a random jitter to target state polls, and a config var to ignore update notifications and not poll immediately after startup
This commit does two related things:

* We make the poll interval a random time between 0.5 and 1.5 times the configured interval.
* We introduce the BALENA_SUPERVISOR_INSTANT_UPDATE_TRIGGER configuration variable, that defaults to true. If this variable is set
to false, then calls to /v1/update are ignored, and on startup the supervisor waits for a poll interval before getting the target state.

This will help especially on cases where there's a large number of devices on a single network. By disabling instant updates and setting a large
poll interval, we can now achieve a sitation where not all devices apply an update at the same time, which can help avoid
overwhelming the network.

Change-type: minor
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2019-04-03 09:15:49 -07:00
77d5c10aee v9.12.7 v9.12.7 2019-04-03 15:39:32 +03:00
e0db04e6a9 Merge pull request #956 from balena-io/fix-service-comparison
Fix service comparison when starting a stopped service
2019-04-03 13:37:23 +01:00
9a343316b2 Fix service comparison when starting a stopped service
When comparing a stopped container after a start request, the container
ID will be present in the target state (where usually it is not). We
were already filtering this value out of the current state, but
neglected to do so for the target state. This change now ensures we
remove it from both alias lists if it exists.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-03 13:08:22 +01:00
1d7e5b40d2 Merge pull request #954 from balena-io/changelog-fix-9.11.4
CHANGELOG.md: Add entry for 9.11.4 that was skipped by versionbot
2019-03-29 14:20:50 -07:00
9fc25da1a6 CHANGELOG.md: Add entry for 9.11.4 that was skipped by versionbot
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2019-03-29 11:30:41 -07:00
4e5d9df717 v9.12.6 v9.12.6 2019-03-29 20:04:35 +02:00
8a430b6b84 Merge pull request #910 from balena-io/fix-legacy-migration-2-apps
Fix migration of legacy apps when there's more than one app
2019-03-29 11:02:26 -07:00
c902706600 Fix migration of legacy apps when there's more than one app in the local DB
In an edge case observed in the field, a supervisor's database held two applications
because the device had been moved and the update lock was set in the old app. This causes
the updated supervisor to be unable to start, logging "No compatible releases found in API",
because it can't fetch the release for the app it was moved from.

This commit changes the migration code to iterate through all apps, and remove any for which
we can't get a release.

Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2019-03-28 17:14:06 -07:00
32bdd1e397 v9.12.5 v9.12.5 2019-03-29 02:13:23 +02:00
114a62606c Merge pull request #943 from balena-io/test-device-config-defaults
test: Add a test case for deviceConfig.getDefaults
2019-03-28 17:11:33 -07:00
ea6ebf8223 test: Add a test case for deviceConfig.getDefaults
This would help avoid bugs like the one fixed in 9.11.1.

Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2019-03-28 16:01:00 -07:00
e5fee8d277 v9.12.4 v9.12.4 2019-03-28 20:39:07 +02:00
0f943dba1b Merge pull request #924 from balena-io/only-modprobe-ip6tables-if-needed
Only modprobe ip6_tables if it's necessary
2019-03-28 11:36:52 -07:00
de05165316 Only modprobe ip6_tables if it's necessary
If the kernel was built with support for ip6tables, there's no need to load the module. This is the case when running
balenaOS in a container in Mac OS, which also can't do modprobes easily.

Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2019-03-28 11:12:10 -07:00
efdd3e817b v9.12.3 v9.12.3 2019-03-28 16:47:23 +02:00
6fe04f8a0e Merge pull request #951 from balena-io/faster-builds
Parallelise cache pulling for builds
2019-03-28 14:45:14 +00:00
9af416c7c0 Parallelise cache pulling for builds
Change-type: patch
2019-03-28 13:39:16 +00:00