We add an endpoint to the supervisor API that checks the following conditions to determine whether the supervisor is healthy:
* That the update cycle has run fully, in a time that's less than twice the poll interval. Unless we're downloading an image, in which case
we assume it's healthy (otherwise we'd get into the issue of determining a reasonable timeout for the image download, which is already done in a configurable way with delta options and the like).
* That the current state report to the Resin API hasn't failed more than 3 times. Unless the device has no connectivity, or the connectivity check is disabled, in which case we don't know
if the report failed simply because there's no network.
* That the gosuper component is working (since we periodically hit its API to get the IP addresses, we mark it as not working if this API call fails).
We need this endpoint to be unauthenticated for the docker daemon to be able to hit it (though, as the rest of the API, it is protected with iptables rules).
Change-Type: minor
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
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>
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>
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>
Up to now, a new debian:jessie build would invalidate the cache for the base and gosuper images, slowing down Circle builds.
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>