Commit Graph

1376 Commits

Author SHA1 Message Date
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
resin-io-versionbot[bot]
3211d170ca v6.2.4 2017-08-28 20:04:36 +00:00
Pablo Carranza Velez
5a369170c6 Update docker-progress to v2.6.3
2.6.2 has a serious bug which causes the js file to not be included in the published package.
Webpack gave us an unexpected workaround because it will add the .coffee file anyways, but we should
still update to the fixed version.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-08-28 10:02:50 -07:00
resin-io-versionbot[bot]
673996e2ee Auto-merge for PR #489 via VersionBot
Deploy all archs by default to Resin
2017-08-26 08:37:51 +00:00
resin-io-versionbot[bot]
8fe016362d v6.2.3 2017-08-26 08:04:47 +00:00
Akis Kesoglou
e2914012c0 Deploy all archs by default to Resin
Change-Type: patch
2017-08-25 23:36:31 +03:00
resin-io-versionbot[bot]
9b484543d7 Auto-merge for PR #491 via VersionBot
Remove a file from sqlite3 that took 30MB
2017-08-25 20:35:34 +00:00
resin-io-versionbot[bot]
282a9e38e6 v6.2.2 2017-08-25 18:42:28 +00:00
Pablo Carranza Velez
225f2318ba Remove an unnecessary directory from sqlite3 that took 30MB
node.dtps was big and useless.

See https://github.com/mapbox/node-sqlite3/issues/861

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-08-25 11:19:10 -07:00
resin-io-versionbot[bot]
2da570700d Auto-merge for PR #486 via VersionBot
Ensure /var/run/resin exists before trying to mount it as tmpfs
2017-08-18 22:26:34 +00:00
resin-io-versionbot[bot]
12e9253de6 v6.2.1 2017-08-18 21:52:43 +00:00
Pablo Carranza Velez
4ca311edbd Ensure /var/run/resin exists before trying to mount it as tmpfs
Fixes issues on systems where mount files if the target doesn't exist (seems to happen on
boards that run docker on overlayfs).

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-08-18 13:45:42 -07:00
resin-io-versionbot[bot]
05ab8ebf94 Auto-merge for PR #483 via VersionBot
Resumable deltas
2017-08-16 09:31:26 +00:00
resin-io-versionbot[bot]
4875c79703 v6.2.0 2017-08-16 08:48:18 +00:00
Akis Kesoglou
52c55a0c1b Apply a default timeout unless one is given 2017-08-09 11:55:22 +03:00
Akis Kesoglou
1412785886 Try to resume the download of a delta if it fails due to flaky network
Applying a delta update consists of two parts:

1. The request to the delta server for the delta payload (an rsync batch file, plus some prepended Docker metadata). The response is a redirect to a URL that contains the delta (currently S3).
2. The request for the actual download of the delta. The response is streamed directly to rsync, which applies it onto the mounted root filesystem of the final image.

The first step may take a while as it may trigger the generation of the delta if the request is the first one for this combination of src/dest image and the images are large. If the request times out, either because of the delta server taking too long to respond or bad network, the Supervisor automatically schedules a retry to be performed after a while.

Currently, similar behaviour applies to the second step as well -- if the request fails, we immediately bail out and the Supervisor schedules a retry of the whole process (i.e. from step 1). But in this case it means we might have downloaded and applied some or most of the delta when a socket timeout occurs causing us to start all over again, wasting time and bandwidth.

This commit splits the process into the two discreet steps and improves the behaviour on the second step. Specifically:

- makes the Supervisor try to resume the delta download request several times before it bails out and starts the process all over again.
- removes arbitrary timeout which applied over the whole process and meant some deltas would never manage to be applied (because of large delta size and low network bandwidth).
- makes sure any launched rsync processes always exit and any opened streams consumed and closed.

Most of the improvements are in the two dependencies linked below -- `resumable-request` and `node-docker-delta` -- and this commit merely combines the updated versions of these modules.

Change-Type: minor
Connects-To: #140
Depends-On: https://github.com/resin-io/node-docker-delta/pull/19
Depends-On: https://github.com/resin-io-modules/resumable-request/pull/2
2017-08-09 11:55:22 +03:00
resin-io-versionbot[bot]
b58eaf4de4 Auto-merge for PR #481 via VersionBot
Fix references in deploy-to-resin.js and use github credentials when pushing in pr-to-meta-resin.sh
2017-08-07 23:08:05 +00:00
resin-io-versionbot[bot]
24a23dece2 v6.1.4 2017-08-07 22:32:59 +00:00
Pablo Carranza Velez
925112bd13 Fix references in deploy-to-resin.js and use github credentials when pushing in pr-to-meta-resin.sh
deploy-to-resin.js had a few references to variables that are no longer defined.

In pr-to-meta-resin.sh, the passing of GitHub credentials was wrongly placed and messy.

As per @Page-'s advice, we use the credentials as part of the remote url when pushing (we don't do it when
cloning to avoid the github password being visible with a `git remote -v`).

We change GITHUB_USERNAME to GITHUB_USER as hub will automatically pick it up, avoiding the need
to pass the credentials when creating the PR.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-08-07 12:17:02 -03:00
resin-io-versionbot[bot]
bdf6214d12 Auto-merge for PR #484 via VersionBot
Avoid starting apps on startup if device has to reboot due to a config change
2017-08-03 21:20:45 +00:00
resin-io-versionbot[bot]
4d2c381e23 v6.1.3 2017-08-03 20:45:06 +00:00
Pablo Carranza Velez
6f87b1db18 Avoid starting apps on startup if device has to reboot due to a configuration change
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-08-02 20:07:13 -03:00
resin-io-versionbot[bot]
bb6652c52d Auto-merge for PR #472 via VersionBot
When the device is about to reboot or shutdown, close the API server and avoid applying updates
2017-07-28 00:35:58 +00:00
resin-io-versionbot[bot]
fdc7d49e18 v6.1.2 2017-07-27 23:59:50 +00:00
Pablo Carranza Velez
42ac7487e7 When the device is about to reboot or shutdown, close the API server and avoid applying updates
We mark when the device is rebooting and avoid some steps in the update cycle that change the device
state, similarly to when the device is in local mode, to avoid problems with non-atomic operations.
This doesn't solve *all* the potential scenarios of a reboot happening in the middle of an update, but at least
should prevent the case where we start an app container and reboot the device before saving the containerId, potentially
causing a duplicated container issue.

We also correct the API docs to reflect the 202 response when reboot or shutdown are successful.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-07-27 20:07:24 -03:00
resin-io-versionbot[bot]
bfc28a0ed4 Auto-merge for PR #469 via VersionBot
Some fixes for offline mode: don't persist uuid, and avoid an error with the missing apiEndpoint
2017-07-27 18:45:32 +00:00
resin-io-versionbot[bot]
902e31f1c0 v6.1.1 2017-07-27 18:07:56 +00:00