Commit Graph

1623 Commits

Author SHA1 Message Date
resin-io-versionbot[bot]
5613801219
Auto-merge for PR #518 via VersionBot
Use balena 17.06 and resin-base v2.9.2 for the docker-in-docker supervisor
2017-11-03 21:26:40 +00:00
resin-io-versionbot[bot]
8a2852eda6 v6.4.3 2017-11-03 20:57:09 +00:00
Pablo Carranza Velez
e75c331aa3 Use balena 17.06 and resin-base v2.9.2 for the docker-in-docker supervisor
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-11-03 09:57:28 -07:00
resin-io-versionbot[bot]
bb350eca92
Auto-merge for PR #480 via VersionBot
Avoid an indefinite recursion that grows the call stack when reporting the current state fails
2017-11-03 03:59:23 +00:00
resin-io-versionbot[bot]
a3b5b0370b v6.4.2 2017-11-03 02:31:04 +00:00
Pablo Carranza Velez
51d6ab01c9 Avoid an indefinite recursion that grows the call stack when reporting the current state fails
We used to have a recursion based on Promises and Promise.delay, which caused the promise never to resolve
so eventually the stack would be exhausted.

This fixes it by using a simpler way to check if reporting the state is in progress and using a setImmediate to
call applyState outside of the Promise chain.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-11-02 15:54:09 -07:00
resin-io-versionbot[bot]
a212d9b7ef
Auto-merge for PR #520 via VersionBot
automation: Always try to cache using the latest master build
2017-11-02 22:09:06 +00:00
resin-io-versionbot[bot]
219dc2874b v6.4.1 2017-11-02 21:44:14 +00:00
Pablo Carranza Velez
ab1be2c12d Improve caching when building gosuper
It seems that the ARG ARCH causes a cache miss in the next RUN statement (for some reason our use of cache-from in the other stages of the build works better, but here it always causes a miss).
We move the ARG statement to later in the Dockerfile, just before actually using it. Hopefully this will improve caching for most supervisor builds.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-11-01 19:04:10 -07:00
Pablo Carranza Velez
acf3771ea8 automation: Always try to cache using the latest master build
This change makes us always try to use the latest master builds of the intermediate images
for the --cache-from option in our docker build of the supervisor.

This prevents cache misses when we're rebasing a branch and a PR has been merged that modifies a component that we're not modifying
in the current branch.
For example:
Branch 1 modifies the base image. Branch 2 only modifies the nodejs code. Branch 1 gets merged before Branch 2, so in our Branch2 PR we
rebase from master - in the next build for Branch 2, we'll have a cache miss on the base image, unless we're using the last master for caching.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-11-01 18:15:33 -07:00
resin-io-versionbot[bot]
a1a020b074
Auto-merge for PR #512 via VersionBot
Fixes #511, add support for new supervisor image for IOT2000 board
2017-11-01 21:45:44 +00:00
resin-io-versionbot[bot]
81fac24c99 v6.4.0 2017-11-01 21:08:51 +00:00
Trong Nghia Nguyen
01c39f33b5 Fixes #511, add support for new supervisor image for x86 with quark cpu
boards.

Change-Type: minor
Signed-off-by: Trong Nghia Nguyen <nghiant2710@gmail.com>
2017-11-01 03:33:43 -07:00
resin-io-versionbot[bot]
89607fa2bc
Auto-merge for PR #500 via VersionBot
Mixpanel tunneling through resin API, and extra hiding of properties
2017-11-01 10:29:42 +00:00
resin-io-versionbot[bot]
087e335467 v6.3.11 2017-11-01 09:33:20 +00:00
Pablo Carranza Velez
20d95ff024 Add whitelist-based filtering to mixpanel events
When sending events to mixpanel, we now use an explicit whitelist for the properties sent with the event, to avoid accidental leakage of any sensitive information.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-31 23:22:38 -07:00
Pablo Carranza Velez
34d37814c9 Tunnel all mixpanel events through the resin API
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-31 23:22:38 -07:00
resin-io-versionbot[bot]
4c5fd68aea
Auto-merge for PR #517 via VersionBot
Use a custom webpack loader to avoid uncaught exceptions from JSONStream
2017-10-31 22:06:50 +00:00
resin-io-versionbot[bot]
75034ab1b5 v6.3.10 2017-10-31 21:23:03 +00:00
Pablo Carranza Velez
c422c91b66 Use a custom webpack loader to avoid uncaught exceptions from JSONStream
JSONStream is a hybrid executable-library that doesn't get along well with webpack: it tries to run its binary code
which can throw uncaught exceptions. So we use a custom loader for it - which replaces remove-hashbang-loader, as it only
affected JSONStream too.

(I tried replacing JSONStream altogether, but turns out dockerode uses it too)

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-10-31 13:29:59 -07:00
resin-io-versionbot[bot]
0b86a60618
Auto-merge for PR #507 via VersionBot
Better container management to avoid duplicated/spurious containers
2017-10-31 00:26:07 +00:00
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