Commit Graph

61 Commits

Author SHA1 Message Date
Cameron Diver
67c3055fd4 Use livepush commands for copying and running dev specific steps
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2020-04-14 10:50:03 +01:00
Cameron Diver
826eec2e4f 🚀 Update supervisor to node12
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2020-04-13 14:36:59 +01:00
Cameron Diver
37feb7e325 Move from dbus-native to dbus
Closes: #1049
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2020-04-13 10:07:14 +01:00
Cameron Diver
b6dde69c4f Link sqlite with a system sqlite for quicker builds
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2020-04-08 13:03:45 +00:00
Cameron Diver
8ab63656bd Update synchronisation scripts for supervisor development
We move the old sync.js script to tools/, and delete the now-broken
sync-debug.js.

We add a command `npm run sync`, which starts a livepush process
with the supervisor on a device.

Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2020-04-06 13:05:38 +01:00
Cameron Diver
3690acbd70 🔧 Move to an alpine base image and drop i386-nlp support
We also remove the Makefile to go to a simpler build system, as long with
the retry_docker_push.sh file. We remove the rest of the automation tools
as they're no longer used and update the circle.yml file.

We also remove debug builds, as these aren't needed moving forward, and were
only to enable livepush builds.

Change-type: major
Signed-off-by: Cameron Diver <cameron@balena.io>
2020-04-06 10:50:00 +01:00
Pagan Gazzard
7945bb5a77 Add a precheck that linting/tests work on node 10
This allows us to avoid re-linting for every arch

Change-type: patch
2020-03-24 09:28:13 +00:00
Pagan Gazzard
1366abc7b1 Minimise the amount of cache busted by a changed ARG
Change-type: patch
2019-07-19 16:54:06 +01:00
Cameron Diver
92aa9b40ab Use jessie base images for i386-nlp
This fixes potential SIGILL errors with the supervisor on i386-nlp.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-06-27 17:09:31 +01:00
Cameron Diver
557f88965a Ensure that all architectures use a node version that supports ci
We do this by using the standalone installer pinned at v6.9.0. We use
the standalone installer because npm itself fails to upgrade on the
i386-nlp build (npm v3). The standalone installer is installed in /tmp,
and then to avoid mysterious CI errors, we use the original npm to run
the tests.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-06-27 17:09:31 +01:00
Cameron Diver
9dab00d156
Allow writing test files in typescript
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-06-19 10:55:15 +01:00
Cameron Diver
a4563a78c3
Update balena-supervisor-base to v1.4.7
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-29 10:03:27 +01:00
Cameron Diver
99c08c807b Fix regression where node_modules stayed in resulting image
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-27 13:40:43 +01:00
Cameron Diver
6bfeaf7ae7 Change install step to not mask errors
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-15 12:41:29 +01:00
Cameron Diver
3ff9c5a9b1 Use balenalib base image for i386 base
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-15 12:41:28 +01:00
Cameron Diver
2e6f030063 Upgrade debug builds to node 10 for supported architectures
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-15 12:41:28 +01:00
Cameron Diver
56bac3a7ea Upgrade to node 10 for supported architectures
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-15 12:41:26 +01:00
Cameron Diver
b84f354ded Upgrade to node 8 for supported architectures
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-05-15 12:41:26 +01:00
Cameron Diver
1191b39ee5
misc: Update build stages to debian stretch
Jessie recently had the jessie-updates repos dropped. We upgrade to
stretch to avoid a 404 on update (and to update things anyway).

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-03-27 14:18:34 +00:00
Cameron Diver
b3a07da8e4
Revert "Upgrade to node 8 for supported architectures"
This reverts commit 338ba4cdd7.

This is to unblock the release of the supervisor version, pending the
fix of the introduction of the race condition currently affecting v2
deltas.

Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-02-19 14:48:19 +00:00
Cameron Diver
a92d9cef3d
Build: Respect package-lock when building
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-02-04 11:44:58 +00:00
Cameron Diver
338ba4cdd7
Upgrade to node 8 for supported architectures
Change-type: minor
Signed-off-by: Cameron Diver <cameron@balena.io>
2019-01-25 18:10:06 +00:00
Cameron Diver
34e5a7b048
misc: Exclude typescript files from resulting image
Change-type: patch
Signed-off-by: Cameron Diver <cameron@balena.io>
2018-12-21 09:26:11 +00:00
Pablo Carranza Velez
fd5ca76752 Remove a deprecated debian repository from the aarch64 node image (used only at build-time)
Change-type: patch
Signed-off-by: Pablo Carranza Velez <pablo@balena.io>
2018-11-01 14:59:41 -07:00
Heds Simons
f716624f89
network: Add MDNS support for .local domains
This requires the initialisation of both DBus and
Avahi in the `entry.sh` script to allow resolution
via libc.

Due to issues with Avahi's `init.d` script, the previous
PIDfile is explicitly removed.

Connects-to: #712
Change-type: minor
Signed-off-by: Heds Simons <heds@resin.io>
2018-08-23 18:41:55 +01:00
Petros Angelatos
bba1da370b
logger: Remove pubnub leftovers
Change-type: minor
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2018-07-18 12:31:10 -07:00
Cameron Diver
273224547c
Convert blink module to typescript
Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-05-02 09:36:21 +01:00
Cameron Diver
cfddbf65e4
Start initial typescript conversion, and add validation debugging
Add webpack config and dependencies to have typescript built, and also
convert src/lib/validation.coffee to typescript.

In this conversion I also added a lot of debugging which should help the
upcoming local mode development.

Change-type: minor
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-04-27 16:09:50 +01:00
Heds Simons
4eb796b9f4 Move to Node 6.13.1.
Connects-to: #623
Change-type: minor
2018-04-09 11:54:55 +01:00
Cameron Diver
f625a1bcb0
Run test suite on CI
Change-type: patch
Signed-off-by: Cameron Diver <cameron@resin.io>
2018-04-04 14:47:04 +01:00
Pablo Carranza Velez
348ff66cee
Replace the gosuper component with a node module that handles communication with systemd, and stop using an init system in the supervisor container
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-03-22 15:55:15 +00:00
Pablo Carranza Velez
2f0fcff8ef Start using an externally built resin/$ARCH-supervisor-base:v1.1.0 as base image, which adds the verbatim option to dns.lookup
Depends-on: https://github.com/resin-io/resin-supervisor-base/pull/5
Change-Type: minor
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-03-07 07:01:43 -08:00
Pablo Carranza Velez
b003f48d7b Switch to using knex migrations to set up the database, and change the database format to use integers for ids instead of strings.
Also includes various improvements and bugfixes to services and the migration from legacy /data to volumes.

The switch ti migrations involves a dirty hack for webpack to properly resolve the paths to the migrations js files - it uses an expression
that webpack can't resolve, so we hardcode it to a value and use the ContextReplacementPlugin to make that value resolve to the migrations folder.

The downsides to this approach are:
- a change in knex code would break this
- the migration code is added twice to the supervisor image: once in the migrations folder (because knex needs to loop through the directory to find the files),
and once inside app.js (because I can't make webpack treat them as external)

Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-03-06 10:32:28 -08:00
Pablo Carranza Velez
c463f7fa5b Since armel builds are disabled, do not pull an armel node base image, and ensure we never deploy an armel supervisor
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2018-02-27 08:40:43 -08:00
Pablo Carranza Velez
64372e9cc9 Do the webpack build in an amd64 image to improve build times
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-12-14 03:06:19 -08:00
Pablo Carranza Velez
12ab5c16ea Dockerfile: improve caching by installing devDependencies before copying the code
This should help avoid having to run the npm install for devDependencies (which are actually most of the modules)
every time there's a change in the code.

Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-12-11 12:44:08 -08:00
Pablo Carranza Velez
a118609256 Add interval and options for the healthcheck
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-12-11 00:11:56 -08:00
Pablo Carranza Velez
95bbe6ea49 Add a /v1/healthy endpoint that fails if the supervisor is unhealthy, and a HEALTHCHECK command to the Dockerfile that uses it
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>
2017-12-11 00:11:56 -08: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
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
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
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
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
Pablo Carranza Velez
7746d6be99 Use a pinned build of the debian image to build base and gosuper, to avoid unnecessary rebuilds
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>
2017-07-25 10:52:40 -03:00
Pablo Carranza Velez
8d84facff5 Add a single Dockerfile to build the supervisor as a multi-stage build
Change-Type: patch
Signed-off-by: Pablo Carranza Velez <pablo@resin.io>
2017-07-20 21:22:25 -03:00
Praneeth Bodduluri
dba752f6b3 Use ARCH= to define the architecture to build. Embedd version into builds 2015-10-13 13:27:57 -03:00
Pagan Gazzard
5e869f50a3 Switch the supervisor-base image to include the deps we require, allowing make builds to work correctly (and faster, caching more) now that the deps have been removed from deps.sh 2015-10-13 13:27:56 -03:00
Aleksis Brezas
3cb5cb9571 one line apt-get 2015-10-13 13:19:45 -03:00
Aleksis Brezas
712647b69e move package installations to dockerfiles 2015-10-13 13:19:45 -03:00
Praneeth Bodduluri
05a3cba65f apt-get clean everywhere. 2015-10-13 13:19:43 -03:00