Commit Graph

1314 Commits

Author SHA1 Message Date
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
Pablo Carranza Velez
f7c702b845 Issue #386: Allow forcing updates when an update was already scheduled
The logic for updateStatus.forceNext is changed so that its value is checked when the scheduled update is run, instead
of when the update is scheduled. And when an update is already scheduled and a new request comes in,
we mark forceNext as true if the new request requires a force update.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-03-07 17:06:10 +02:00
Pablo Carranza Velez
3b5906a307 3.0.1 2017-02-15 17:52:15 -08:00
Pablo Carranza Vélez
ca5d2a8fd2 Merge pull request #384 from resin-io/381-preloaded-deviceconfig
Issue #381: Set target deviceConfig values from preloaded apps
2017-02-03 11:05:00 -03:00
Pablo Carranza Velez
e8fbadb8d6 Issue #381: Set target deviceConfig values from preloaded apps
Also split out deviceConfig set and get to a separate module to avoid circular dependencies.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-19 13:56:20 -03:00
Pablo Carranza Velez
1e2d3d1af7 3.0.0
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-18 14:27:44 -03:00
Pablo Carranza Vélez
97d7a20fb7 Merge pull request #383 from resin-io/382-validate-delta-timeouts
Issue #382: Validate delta timeout variables
2017-01-18 14:26:31 -03:00
Pablo Carranza Velez
0d870954ef Issue #382: Validate delta timeout variables
Also take validation functions into a module, and use that in all cases where
we need to check for an integer or string.

Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-18 12:28:24 -03:00
Pablo Carranza Vélez
0e76b540ea Merge pull request #379 from resin-io/378-delta-timeout
Increase delta timeouts, and provide nicer message when the delta server times out
2017-01-17 18:49:19 -03:00
Pablo Carranza Vélez
60ef2af3a5 Merge pull request #380 from resin-io/versionist-2.8.0
Update versionist to v2.8.0
2017-01-17 16:02:41 -03:00
Pablo Carranza Velez
9c8ac58128 Issue #378: Increase delta timeouts (to avoid ESOCKETTIMEOUT errors), make them configurable, and provide nicer message when the delta server times out
Current delta timeouts are too limiting, so we increase the request timeout to 30 minutes which is big enough that
the server will time out first and we can provide a nice message letting the user know we'll retry; and we increase
the total timeout to 24 hours to account for really big deltas over slower connections (the rsync calls will time out anyways
if something else goes wrong, as they have a 5 minute I/O timeout).

The timeouts are now configurable with the RESIN_SUPERVISOR_DELTA_REQUEST_TIMEOUT and RESIN_SUPERVISOR_DELTA_TOTAL_TIMEOUT
configuration variables.

Change-Type: minor
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-17 14:21:10 -03:00
Pablo Carranza Velez
6a94782a1d Update versionist to v2.8.0
Also remove versionist.conf.js as it's no longer necessary (versionist now
defaults to its internal versionist.conf).

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-16 22:41:28 -03:00
Pablo Carranza Vélez
6ab2b45104 Merge pull request #370 from resin-io/359-kmod-only-in-resinos1
[Breaking] Do not bind mount kmod if the host is not Resin OS 1.X
2017-01-16 12:51:08 -03:00
Pablo Carranza Vélez
f4fa159a22 Merge pull request #377 from resin-io/375-throttle-updatestate
Add a delay between successive updates of device state to the API
2017-01-12 18:21:56 -03:00
Pablo Carranza Velez
f8d3ea1a22 Add a delay between successive updates of device state to the API
We add a 1s delay between requests to the API to apply state changes,
as this will throttle it to a point that it has a reasonable rate while
preventing too many unnecessary requests to the API.

Closes #375

Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-12 15:57:09 -03:00
Pablo Carranza Vélez
9b7c3ce1f1 Merge pull request #376 from resin-io/374-docker-progress-2.3.3
Update docker-progress to v2.3.3
2017-01-12 15:54:41 -03:00
Pablo Carranza Velez
c2544afe47 Update docker-progress to v2.3.3
Closes #374

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-12 15:51:37 -03:00
Pablo Carranza Vélez
8d02d49e98 Merge pull request #369 from resin-io/368-dind-aufs
Switch to aufs for the docker-in-docker development supervisor
2017-01-12 15:50:17 -03:00
Pablo Carranza Velez
58af4f7094 Switch to aufs for the docker-in-docker development supervisor
Also update a few details about the dind on the README.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-06 15:45:41 -03:00
Pablo Carranza Velez
458add1759 Do not bind mount kmod if the host is not Resin OS 1.X
Resin OS 2.X removes the use of compressed modules, which was the initial
motivation for us to bind mount kmod into user containers (as Debian distros
don't include support for compressed modules).

This is a breaking change, but we still keep bind mounting on devices that are
on 1.X to ensure we don't break apps currently relying on the feature.

Implementation note: some functions in device.coffee have been refactored to
extract (DRY) a memoization procedure for Promise-returning functions.
`device.getOSVersion()` now also memoizes its result.

Change-Type: major
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-01-04 18:48:45 -03:00
Pablo Carranza Velez
e419ea32d2 2.9.0
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2016-12-20 21:09:20 -03:00
Pablo Carranza Vélez
c553efc1db Merge pull request #371 from resin-io/355-deltas-aufs-mount
Bump docker-delta to v1.0.1 to fix deltas on aufs when there's many layers
2016-12-20 21:07:37 -03:00
Pablo Carranza Velez
dd708ac3f9 Bump docker-delta to v1.0.1 to fix deltas on aufs when there's many layers
Fixes #355
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2016-12-20 17:48:38 -03:00
Carlo Maria Curinga
d1e8be2ae3 Merge pull request #288 from resin-io/dependent-apps-docs
document dependent apps feature
2016-12-20 20:46:12 +01:00
Pablo Carranza Velez
68e89fbded 2.8.5
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2016-12-20 15:10:19 -03:00
Pablo Carranza Vélez
e7388d6338 Merge pull request #354 from resin-io/353-deviceconfig-populate
If there's no entries in deviceConfig table, always create one.
2016-12-20 14:18:43 -03:00