Commit Graph

1239 Commits

Author SHA1 Message Date
Page-
82dce6186d Merge pull request #428 from resin-io/dind-aufs-tools
Add aufs-tools to the dind supervisor for use when running on aufs
2017-04-28 00:35:59 -07:00
Pagan Gazzard
67b022e434 Add aufs-tools to the dind supervisor for use when running on aufs
Change-Type: patch
2017-04-27 23:43:46 -07:00
Pablo Carranza Velez
0799fc1173 4.2.2
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-04-27 21:19:36 -07:00
Pablo Carranza Vélez
ac2531368c Merge pull request #427 from resin-io/dont-update-deviceconfig-if-unchanged
Avoid writing target device config to DB if it hasn't changed
2017-04-27 21:18:38 -07:00
Pablo Carranza Vélez
00dc9e8654 Merge pull request #431 from resin-io/only-delete-apikey-if-os-supports-it
Only delete the provisioning key if the supervisor is running on an OS that supports using the deviceApiKey
2017-04-27 21:17:53 -07:00
Pablo Carranza Velez
c251de1cd3 Only delete the provisioning key if the supervisor is running on an OS that supports using the deviceApiKey
This avoids problems when updating the supervisor on an older OS, where the VPN and other
host services still require config.json to have an apiKey field to authenticate.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-04-27 13:31:25 -07:00
Pablo Carranza Velez
e36fa601ad Avoid writing target device config to DB if it hasn't changed
This helps avoid unnecessary writes to the DB which may cause disk wearout.

We also change the error message in this section to show that the error might have happened
when fetching the device config as much as when setting it.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-04-27 09:42:41 -07:00
Pagan Gazzard
8a1d17a697 4.2.1 2017-04-26 15:14:39 -07:00
Page-
111d32f94f Merge pull request #430 from resin-io/device-key-fixes
Device key fixes
2017-04-26 15:10:41 -07:00
Pagan Gazzard
42cd3a6b01 Fix an infinite loop that could happen when trying to bootstrap if the key exchange fails
Change-Type: patch
2017-04-26 13:54:15 -07:00
Pagan Gazzard
89ccb6480d Fix the case of being registered with a version of the cli/sdk that does not support device api keys.
Change-Type: patch
2017-04-26 13:52:43 -07:00
Pagan Gazzard
6a7ff91180 4.2.0 2017-04-24 12:59:38 -07:00
Page-
26fb0b4f64 Merge pull request #424 from resin-io/improve-key-exchange
Improve key exchange by first checking if an existing device api key is valid.
2017-04-24 12:42:51 -07:00
Pagan Gazzard
d31ee452d0 Deduplicate the device fetching logic 2017-04-24 12:09:50 -07:00
Pagan Gazzard
1002629a5e Improve key exchange by first checking if an existing device api key is valid. 2017-04-22 15:17:00 -07:00
Page-
fdcb5f3dff Merge pull request #224 from resin-io/new-device-registering
Use the new device registration endpoint
2017-04-22 14:58:19 -07:00
Pagan Gazzard
477184d72d Add handling for duplicate UUIDs and key exchanging for old user-api-keys
Change-Type: minor
2017-04-20 21:37:27 -07:00
Pagan Gazzard
03ec97ab8d Change to the new device registration method to exchange our provisioning key with a dedicated api key for the device.
Change-Type: minor
2017-04-20 21:37:27 -07:00
Pablo Carranza Vélez
2710a05d18 Merge pull request #417 from horia-delicoti/master
docs/API.md: Fix documentation command sent via the API proxy for POST /v1/update
2017-04-13 18:05:21 -07:00
Horia Delicoti
ff632e811c docs/API.md: Fix documentation command sent via the API proxy for POST /v1/update.
Change-Type: patch
Signed-off-by: Horia Delicoti <horia.delicoti@gmail.com>
2017-04-11 08:09:27 +02:00
Pablo Carranza Velez
d2c5ca4fdb 4.1.2
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-04-10 14:23:56 -07:00
Pablo Carranza Vélez
1dda2a5810 Merge pull request #421 from resin-io/420-memoize-then
Issue #420: Avoid supervisor crash without connection by properly memoizing promise-returning functions
2017-04-10 16:17:25 +02:00
Pablo Carranza Velez
4d322c72a0 Issue #420: Avoid supervisor crash without connection by properly memoizing promise-returning functions
device.getID caused a fatal error when connection was down, as the memoization with `promise: true` throws
synchronously. Changing memoizee to use `promise: 'then'` makes the memoization work as expected.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-04-05 14:51:26 -07:00
Pablo Carranza Vélez
962c5c138b Merge pull request #418 from resin-io/variant-report
Report the OS variant as a separate field and not as part of the OS version
2017-04-05 23:50:52 +02:00
Pablo Carranza Velez
0e288d75ab Report the OS variant as a separate field and not as part of the OS version
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-04-03 09:32:28 -07:00
Pablo Carranza Velez
dbd4c62f29 4.1.1
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-30 14:14:32 -03:00
Pablo Carranza Vélez
583344dc1d Merge pull request #415 from resin-io/413-fix-bw-control
Issue #413: Fix an error applying the connectivity check config var
2017-03-30 14:13:26 -03:00
Pablo Carranza Velez
99c9b96ed3 Issue #413: Fix an error applying the connectivity check config var
There was a ReferenceError from a leftover variable, introduced in #398.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-30 12:04:38 -03:00
Pablo Carranza Vélez
d139f9d21c Merge pull request #411 from resin-io/410-cleanup-when-locked
Issue #410: Cleanup images when the update lock is set
2017-03-30 12:03:54 -03:00
Pablo Carranza Velez
5412e766da Issue #410: Cleanup images before running an update, preserving the ones that will be used in the target state
We add an extra image/container cleanup before applying updates, allowing any unwanted images to be deleted.
When doing this, we take care not to delete images that will be used when the target state is applied.

This prevents the problem of stale images being stored while the update lock is set, potentially
leaving the device out of space.

Running the cleanup *before* applying the update ensures that only one target image is downloaded: if a stale one
had been downloaded previously, it will be deleted before starting the update for the new one. This can have a slight
impact on delta performance, since the delta is potentially done from an older (and more different) version of the app,
but can have a big impact on storage usage, as not doing this would duplicate the required free storage space when
the update lock is set.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-29 16:50:12 -03:00
Pablo Carranza Velez
d9b421a574 4.1.0
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-29 12:43:53 -03:00
Andreas Fitzek
5c207dc4b3 Merge pull request #405 from resin-io/404_authentication_for_registry_and_delta
404 authentication for registry and delta
2017-03-29 17:41:30 +02:00
Andreas Fitzek
55a1742b1f Merge branch 'master' into 404_authentication_for_registry_and_delta 2017-03-29 11:08:03 +02:00
Andreas Fitzek
ff01d27b7a Authentication credentials for registry and delta server
Hand over authentication credentials to the docker engine
Fetch an access token from the API if possible and hand it over to the delta server

Change-Type: minor
Signed-off-by: Andreas Fitzek <andreas@resin.io>
2017-03-29 01:11:16 +02:00
Pablo Carranza Vélez
68ac688609 Merge pull request #403 from resin-io/402-ensure-no-null-app-configs
Issue #402: Ensure that app configs are non-null and valid json objects
2017-03-28 19:22:04 -03:00
Pablo Carranza Velez
147abe8a76 Issue #402: Ensure that app configs are non-null and valid json objects
This prevents duplicated containers when updating from older supervisors before the config column
was introduced.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-28 14:13:22 -03:00
Pablo Carranza Vélez
64fc60bf77 Merge pull request #407 from resin-io/report-os-variant
Report OS variant to the API together with the OS version
2017-03-28 14:12:55 -03:00
Pablo Carranza Velez
8c59c2d768 Report OS variant to the API together with the OS version
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-23 20:29:52 -03:00
Pablo Carranza Velez
b2a2ca0246 Issue #230: Add a custom User-Agent header to all requests
Header is in the format Supervisor/X.Y.Z (Linux; Resin OS v2.A.B.revC; Dev) - omitting any fields
that are not available depending on the OS.

Change-Type: minor
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-23 20:28:50 -03:00
Sabith
adb4669b81 Update waffle badge
Replace space with ` %20 `

Change-Type: patch
Signed-off-by: Sabith <sabithksme@gmail.com>
2017-03-22 13:09:06 -03:00
Pablo Carranza Velez
4c2d2b8256 4.0.0
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-09 20:21:01 -03:00
Pablo Carranza Velez
c2fe956967 Issue #396: Log when we're rebooting due to a device config change
We also add a 1s delay before rebooting to ensure logs are published.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-10 01:19:56 +02:00
Pablo Carranza Velez
27690e0c30 Issue #20: Change the update lock to a temporary filesystem
The lock is now located at `/tmp/resin-supervisor/<appId>/` on the host, and `/tmp/resin/`
on the user container. The old lock location is supported only in Resin OS 1.X (and both locks are
taken in that case).

This fixes the race condition when the app is started before the supervisor, and takes a lock that is
cleared on supervisor startup.

Change-Type: major
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-10 01:19:35 +02:00
Pablo Carranza Velez
208b799c4b Make local mode only work in development OS, and make it remove app containers and allow unauthenticated API requests
Local mode makes the API accept unauthenticated requests.
Local mode now also removes app containers when stopping them.

Local mode only works on a host OS that has `VARIANT_ID = "dev"` in /etc/os-release.

Also add more explicit logging when stopping an app and it was already stopped
or the container was already removed.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-10 01:19:19 +02:00
Pablo Carranza Velez
72f6b2cea5 Restore default value when clearing a special action config variable
Up to now we've only been running the "special actions" (like vpn on/off, logs on/off)
when the target state includes a current value for the corresponding config variable.
We now also check if there was a *previous* value, and in that case also call the action function.
These functions are prepared to reset to a default when they're called with an undefined value.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-10 01:19:19 +02:00
Pablo Carranza Velez
538e384442 Allow all config variables to take truthy or falsy values
Config variables now use a checkTruthy validation function,
and can be "1", "on", "true" or true to be considered true, or
"0", "off", "false" or false to be considered false.

Change-Type: minor
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-10 01:19:19 +02:00
Pablo Carranza Velez
9ae4f02bc5 Allow setting the supervisor to a "local mode" which stops apps and prevents cleanup
A RESIN_SUPERVISOR_LOCAL_MODE variable is introduced. When this variable is "1", all apps
are stopped and the update cycle stops executing changes other than deviceConfig changes
and the proxyvisor.

Change-Type: minor
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-10 01:19:19 +02:00
Pablo Carranza Velez
9d36064bdb Quick fix: unindent the definition for dockerUtils.createContainer
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-09 08:57:26 -03:00
Pablo Carranza Velez
b6206f9012 Issues #23 and #236: Use docker logs to get all logs from the container, including those before supervisor start
We've been using docker attach, which only gives us the logs since we attach. This change allows getting the
full logs from the beginning.
We also use the timestamps that come with the logs from docker, as they will be more precise and are more relevant now
that we're getting previous logs from history.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-07 17:26:38 +02:00
Pablo Carranza Velez
b64ed9568c Issues #389 and #390: Remove /host_run/dbus and /host/var/lib/connman bind mounts for non-ResinOS-1.X devices
On ResinOS 2.X the default mounts should not include the previously deprecated host_run, and there's no connman which makes the connman mount confusing.
This is a breaking change as it is not backwards-compatible on non-ResinOS instances of the supervisor.

Change-Type: major
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-07 17:26:23 +02:00