Commit Graph

3135 Commits

Author SHA1 Message Date
Matthew McGinn
acb38dfcfa docs: make headers consistent
Change-type: patch
Signed-off-by: Matthew McGinn <matthew@balena.io>
2019-05-07 00:41:58 +08:00
Resin CI
23039b6513 v9.14.8 2019-05-03 14:39:34 +03:00
xginn8
6c1f3bb6a0
Merge pull request #972 from balena-io/stray-resin-refs
docs: fix up some stray resin references
2019-05-03 19:37:22 +08:00
Matthew McGinn
331b109a64 docs: fix up some stray resin references
Change-type: patch
Signed-off-by: Matthew McGinn <matthew@balena.io>
2019-05-03 18:58:56 +08:00
Resin CI
ac0bfaaa1f v9.14.7 2019-05-03 13:56:52 +03:00
CameronDiver
6b5da8ba1e
Merge pull request #971 from balena-io/case-insensitive-validation
Perform case-insensitive checking when converting booleans from strings
2019-05-03 11:55:23 +01:00
Cameron Diver
76e0361b0e Fix dockerode type failures
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-03 11:31:13 +01:00
Cameron Diver
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
Resin CI
558424ecee v9.14.6 2019-04-25 19:27:44 +03:00
CameronDiver
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
Cameron Diver
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
Resin CI
42aaf81d0b v9.14.5 2019-04-25 18:13:26 +03:00
CameronDiver
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
Cameron Diver
9e05bc2b71
misc: Fix spurious test errors
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-04-25 13:48:27 +01:00
Cameron Diver
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
Resin CI
8b551ebc7b v9.14.4 2019-04-11 13:07:44 +03:00
CameronDiver
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
Cameron Diver
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
Resin CI
105d3889af v9.14.3 2019-04-11 00:09:09 +03:00
CameronDiver
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
Cameron Diver
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
Resin CI
0b1d2b7702 v9.14.2 2019-04-08 14:17:09 +03:00
CameronDiver
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
Cameron Diver
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
Resin CI
3539ad467a v9.14.1 2019-04-05 16:20:12 +03:00
Heds Simons
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
Heds Simons
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
Resin CI
08fe5504ce v9.14.0 2019-04-05 12:29:08 +03:00
CameronDiver
eeaa2fcfc9
Merge pull request #955 from balena-io/937-better-logs
Better supervisor and container logging
2019-04-05 10:26:36 +01:00
Cameron Diver
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
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
Cameron Diver
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
Cameron Diver
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
Resin CI
b82eb6efd6 v9.13.0 2019-04-03 20:08:09 +03:00
Pablo Carranza Vélez
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
Pablo Carranza Velez
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
Pablo Carranza Velez
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
Pablo Carranza Velez
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
Resin CI
77d5c10aee v9.12.7 2019-04-03 15:39:32 +03:00
CameronDiver
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
Cameron Diver
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
Pablo Carranza Vélez
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
Pablo Carranza Velez
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
Resin CI
4e5d9df717 v9.12.6 2019-03-29 20:04:35 +02:00
Pablo Carranza Vélez
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
Pablo Carranza Velez
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
Resin CI
32bdd1e397 v9.12.5 2019-03-29 02:13:23 +02:00
Pablo Carranza Vélez
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