Commit Graph

1602 Commits

Author SHA1 Message Date
resin-io-versionbot[bot]
eb6c4fb7c4 v6.3.9 2017-10-30 23:23:50 +00:00
Pablo Carranza Velez
ecf7e4206c Avoid fetching an image when it might be available or when starting an app because it might not be necessary
This change removes the behavior where we would try to fetch an app image when starting the app. This might cause an unintended
download of an app that is not really needed anymore because we're starting the app on boot and an update cycle would make this image unnecessary.
So now we try to inspect the image, and if this fails we will throw an error, causing the app to be soft-deleted and the next update cycle to properly trigger
a download of whatever image we need from the target state.

We also improve the error catching when fetching an image, to specifically catch an "image not found" error before trying to download - otherwise, any other
random error will cause us to try to download the image again, which will not be a noop if we're using deltas. If there's any other error, the correct behavior
is to throw and retry later.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-30 15:25:49 -07:00
Pablo Carranza Velez
0bc23df8c9 Refactor container cleanup to remove all spurious containers
We change the way container cleanup works so that it compares running
app containers with the container names for the known apps. This allows
the cleanup to effectively delete any spurious/duplicated app containers.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-30 15:25:49 -07:00
Pablo Carranza Velez
bd34a19a79 Use container name instead of id to identify apps, and avoid duplicated containers
By storing the container name before creating the container, we avoid problems
if the supervisor crashes or the device reboots between creating a container and storing its id.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-30 15:25:49 -07:00
resin-io-versionbot[bot]
15b9943f6d
Auto-merge for PR #513 via VersionBot
If a device is already provisioned but the key exchange fails, retry …
2017-10-30 22:22:23 +00:00
resin-io-versionbot[bot]
be6d44a09b v6.3.8 2017-10-30 21:43:55 +00:00
Pablo Carranza Velez
c532344dce If a device is already provisioned but the key exchange fails, retry it until it succeeds
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-27 18:40:29 -07:00
resin-io-versionbot[bot]
b809e2aa02 Auto-merge for PR #515 via VersionBot
Change the update retry to back off to the standard update check interval
2017-10-25 03:44:36 +00:00
resin-io-versionbot[bot]
dd485b06f7 v6.3.7 2017-10-25 03:11:32 +00:00
Pagan Gazzard
21712ae810 Change the update retry to back off to the standard update check interval
This means that the supervisor will be less aggressive in the case of the api experiencing issues, stopping it from compounding the issue if the api is being overloaded

Change-type: patch
2017-10-24 15:36:43 -07:00
resin-io-versionbot[bot]
b0d6ced304 Auto-merge for PR #510 via VersionBot
Ensure preloaded apps get the deviceApiKey in the env vars, and apps …
2017-10-24 05:44:25 +00:00
resin-io-versionbot[bot]
a5ee786cde v6.3.6 2017-10-24 05:07:25 +00:00
Pablo Carranza Velez
a87c6682a2 Ensure preloaded apps are properly loaded by setting their internal markedForDeletion to false, and run apps that have it set to null
Currently preloaded apps don't run because their markedForDeletion field in the database is null. In this commit we set it to false, and we
also change the startup check to also run any apps that have markedForDeletion as null (which should now never happen, but is still good as a backup
plan in case something else fails and to avoid regressions).

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-23 17:29:41 -07:00
Pablo Carranza Velez
3f198fc6aa Improve the check for when the device has been provisioned but the supervisor doesn't have knowledge of it in its local state
This change improves the check for the DuplicateUuidError that can happen if a device has been provisioned but the API's response hasn't been persisted - the error message
returned from the API has been known to have a few variations (usually an extra dot at the end), so we now use _.startsWith instead of checking for equal strings to make the
supervisor still work under these variations.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-23 17:28:36 -07:00
Pablo Carranza Velez
d98897cdcf Ensure preloaded apps get the deviceApiKey in the env vars, and apps never get the provisioning key, and improve detection of cases when the device has been pre-provisioned
It appears preloaded apps have been getting restarted because the "apiKey" configuration value was only available after provisioning succeeded. This change ensures the
deviceApiKey that the device will use is injected into the env vars of preloaded apps, ensuring the app is not restarted (unless provisioning fails and the uuid and deviceApiKey are
regenerated, but this should be rare).

We also ensure that whenever an app's RESIN_API_KEY env var is populated, it is *always* done with the deviceApiKey and never with the provisioning apiKey.

Closes #457
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-23 17:28:17 -07:00
resin-io-versionbot[bot]
99019c9034 Auto-merge for PR #509 via VersionBot
Update docker-toolbelt to fix applying deltas on overlay2 with huge images
2017-10-19 12:41:33 +00:00
resin-io-versionbot[bot]
964d0ae737 v6.3.5 2017-10-19 12:03:34 +00:00
Akis Kesoglou
95bd3f1276 Update docker-toolbelt to fix applying deltas on overlay2 with huge images
See https://github.com/resin-io-modules/docker-toolbelt/pull/21 for issue details

Change-Type: patch
2017-10-19 09:11:32 +03:00
resin-io-versionbot[bot]
8a15091c50 Auto-merge for PR #504 via VersionBot
Delta improvements
2017-10-17 09:47:44 +00:00
resin-io-versionbot[bot]
a8261d12bd v6.3.4 2017-10-17 09:10:49 +00:00
Akis Kesoglou
78f74d757d Delta improvements
- Updates resumable-request to 1.0.1
- Updates docker-progress to 2.0.3
- Removes `DEFAULT_DELTA_APPLY_TIMEOUT`; it’s not needed anymore, docker-delta reliably tracks rsync.
- Properly end the update when applying the delta results in an error.

Change-Type: patch
2017-10-17 10:43:12 +03:00
resin-io-versionbot[bot]
6ae5303c7d Auto-merge for PR #505 via VersionBot
Update docker-progress to improve identification of Balena
2017-10-17 07:41:28 +00:00
resin-io-versionbot[bot]
fc3bbce03b v6.3.3 2017-10-17 07:05:14 +00:00
Akis Kesoglou
4b5a1443fe Update docker-progress to improve identification of Balena
Change-Type: patch
2017-10-16 17:46:34 +03:00
resin-io-versionbot[bot]
ee2bfbe347 Auto-merge for PR #503 via VersionBot
Allow specifying a container name for the docker-in-docker development supervisor
2017-10-11 19:14:53 +00:00
resin-io-versionbot[bot]
06b2d09529 v6.3.2 2017-10-11 18:02:42 +00:00
Pablo Carranza Velez
6ac6f0c308 Allow specifying a config.json filename in dindctl
This is necessary to run several supervisors as they can't share a config

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-10 10:21:21 -07:00
Pablo Carranza Velez
5d88961b34 Allow specifying a container name for the docker-in-docker development supervisor
This would allow developers to run several supervisors on the same host, by choosing different container names for each.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-10 10:01:31 -07:00
resin-io-versionbot[bot]
4ba2f5f68b Auto-merge for PR #502 via VersionBot
Update docker-progress
2017-10-04 19:59:00 +00:00
resin-io-versionbot[bot]
ed0a06f974 v6.3.1 2017-10-04 19:25:31 +00:00
Akis Kesoglou
7846a17616 Update docker-progress
The updated version adds more accurate progress reporting when the underlying engine is resin-os/docker (AKA Balaena)

Change-Type: patch
2017-10-04 18:53:44 +03:00
resin-io-versionbot[bot]
c3daf0ab68 Auto-merge for PR #501 via VersionBot
Update docker-progress
2017-10-03 12:03:19 +00:00
resin-io-versionbot[bot]
79cccb1fe1 v6.3.0 2017-10-03 11:29:17 +00:00
Akis Kesoglou
4744a8957c Update docker-progress
The updated version adds compatibility with resin-os/docker for reporting progress when pulling images.

Change-Type: minor
2017-10-03 12:27:39 +03:00
resin-io-versionbot[bot]
432db71e02 Auto-merge for PR #499 via VersionBot
Explicitly define the source for deltas and allow cross-app deltas
2017-09-15 20:21:51 +00:00
resin-io-versionbot[bot]
62140b1a38 v6.2.9 2017-09-15 19:50:10 +00:00
Pablo Carranza Velez
31d09e70e4 Explicitly define the source for deltas, allow cross-app deltas, and iterate serially through apps when updating
This commit changes the way the source for a delta is determined. We used to do
it by comparing the available tags with the one we want and relying on the format that
includes the app in the image name. Now we explicitly choose a delta source from the previous app
version if we have one, and otherwise use the image from any available app - which will allow us
to have a valid source when moving a device between apps.

For this to work consistently if there's an unexpected reboot, we now avoid deleting an app from the db
until the full update has succeeded. Instead, we mark the app for deletion so that we still have the image stored after the reboot.

This commit also changes a .map to .mapSeries when iterating over appIds for removal/install/update - this avoids parallel treatment
of apps which can cause inconsistencies in the status reported to the API.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-09-14 14:52:06 -07:00
resin-io-versionbot[bot]
bf83fc3ec1 Auto-merge for PR #496 via VersionBot
Fix problem catching errors when killing a container that doesn't exist
2017-09-12 02:17:10 +00:00
resin-io-versionbot[bot]
a2bdfdbed3 v6.2.8 2017-09-12 01:34:50 +00:00
Pablo Carranza Velez
81a6c2f344 Fix problem catching errors when killing a container that doesn't exist
We've been using `.catch Promise.OperationalError, ...` to catch errors when stopping a container and
detecting whether the error means that the container has already been stopped of removed.

Apparently, after the recent dockerode upgrade these errors are not typed as OperationalError anymore, causing error
messages like "No such container: null" when applying an update. This commit makes us catch all errors and check for their statusCode.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-09-05 20:17:43 -07:00
resin-io-versionbot[bot]
64eb5f4f24 Auto-merge for PR #490 via VersionBot
Prefer err.message when reporting errors from dockerode
2017-09-02 00:35:34 +00:00
resin-io-versionbot[bot]
2924a05be3 v6.2.7 2017-09-01 23:57:38 +00:00
Pablo Carranza Velez
dbb4fd8292 Prefer err.message when reporting errors from dockerode, then err.json and err.reason
Errors from docker-modem that are passed from dockerode can have a "json" or "reason" property,
but that is generally less descriptive than the more standard "message", and can show up in the logs
as `[object Object]`. This commit changes it so that we log err.message if it is non-empty, and otherwise
look for json and reason.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-09-01 15:08:10 -07:00
resin-io-versionbot[bot]
a8e11b51a0 Auto-merge for PR #494 via VersionBot
Add a sync.js script to allow syncing a running supervisor container on a local device
2017-08-29 20:37:45 +00:00
resin-io-versionbot[bot]
507506920a v6.2.6 2017-08-29 19:56:51 +00:00
Pablo Carranza Velez
9cc2e47e70 Add a sync.js script to allow syncing a running supervisor container on a local device
This handy tool uses the resin-sync module to rsync javascript changes into the running container
on a device in the local network. It allows rapid iterations when testing the supervisor on a real device.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-08-29 08:24:46 -07:00
resin-io-versionbot[bot]
2be9e18e25 Auto-merge for PR #492 via VersionBot
Forward resume options
2017-08-28 22:37:53 +00:00
resin-io-versionbot[bot]
3ed7687bf2 v6.2.5 2017-08-28 22:02:50 +00:00
Akis Kesoglou
a5980918b4 Forward resume options
Change-Type: patch
2017-08-29 00:02:26 +03:00
resin-io-versionbot[bot]
66f1be7d19 Auto-merge for PR #493 via VersionBot
Update docker-progress to v2.6.3
2017-08-28 20:39:34 +00:00