Commit Graph

69 Commits

Author SHA1 Message Date
Praneeth Bodduluri
ea0b058721 Change APIResponse to a struct with a Data Interface 2015-10-13 13:45:05 -03:00
Praneeth Bodduluri
e1957def25 Address style fixes in app.coffee 2015-10-13 13:45:05 -03:00
Praneeth Bodduluri
f86f5881d9 Implement and use golang endpoint for getting ipaddress' of the device 2015-10-13 13:45:05 -03:00
Pablo Carranza Vélez
8de173f6c3 Use crypto.randomBytes for API secret 2015-10-13 13:45:05 -03:00
Pablo Carranza Vélez
0373607c56 Refactor bootstrapper. Run preloaded supervisor dind. Change dind configs to be ignored and document how to populate them. 2015-10-13 13:45:05 -03:00
Pablo Carranza Vélez
9d2c142c36 Put preloaded apps in DB, and use promise for when boostrap is done 2015-10-13 13:45:05 -03:00
Pablo Carranza Vélez
0bfd329ebc change the bootstrap process 2015-10-13 13:45:05 -03:00
Pablo Carranza Vélez
d1b317399e Updates by appId and use Promise.using for lock
Change the update cycle to go by appId instead of imageId.
Use Promise.using for lockFile locks and unlocks.
Now updates shouldn't stop if one of the apps fails to update
(it's a step towards better supporting multiple apps).

Forcing the lock now works.

Remove unnecessary require fs

Nicer assignment for s in joinErrorMessages
2015-10-13 13:45:03 -03:00
Pablo Carranza Vélez
c52c2c0bd9 First attempt at locking updates with files 2015-10-13 13:45:03 -03:00
Praneeth Bodduluri
a8e1d476e3 Change to use 204 for API, Remove extra space in upscript.sh and Make fswatch start only on EEXIST error 2015-10-13 13:43:37 -03:00
Praneeth Bodduluri
0213916b90 Style changes 2015-10-13 13:43:37 -03:00
Praneeth Bodduluri
03299d77f5 API to pause TCP checks 2015-10-13 13:43:37 -03:00
Pablo Carranza Vélez
53668647c8 Integration test is now working.
* More work on the integration test
* Correctly get supervisor IP
* Use Fatal for test errors
* test-integration working separate from run-supervisor
* Use jenkins' JOB_NAME to identify and remove containers with their volumes
* Document testing procedure
* Document the assume-unchanged tip
* Use /mnt/root for data path
* Nicer secret assignment
2015-10-13 13:43:36 -03:00
Pablo Carranza Vélez
513cc24d1c Purge restarts app, and first attempt at integration testing
* Restart app when purging
* Use log.Fatal to exit with status 1
* Quotes in entry.sh
* Use JSON for request body
* Handle errors for parseJsonBody
* Better error printing in main
* First attempt at testing nodesuper from Go
* Cleaner build
* Use ARCH to differentiate concurrent tests/builds
* Use --rm to autoremove containers
2015-10-13 13:43:36 -03:00
Pagan Gazzard
b8ecdb3ce2 Rename state module to device and use sensible function names for the new module name. 2015-10-13 13:43:35 -03:00
Pagan Gazzard
0917a46a2d Separate the device state updating into its own module. 2015-10-13 13:43:35 -03:00
Pagan Gazzard
0063eaf7e7 Reset download progress to null when starting up the supervisor. 2015-10-13 13:39:38 -03:00
Pagan Gazzard
48c21e9275 Keep track of target and actual device state, and make sure we keep updating the api with any differences until the two match. 2015-10-13 13:39:08 -03:00
Aleksis Brezas
af89179886 reset provisioning progress to null when supervisor starts 2015-10-13 13:36:12 -03:00
Pagan Gazzard
2d5dca2171 Make sure the supervisor version update is also retried until succeeding. 2015-10-13 13:36:12 -03:00
Pagan Gazzard
1784c75c57 Add secret/apikey based authentication to the supervisor. 2015-10-13 13:36:12 -03:00
Pagan Gazzard
fafef6cc6f Post the supervisor api port to the resin api. 2015-10-13 13:36:12 -03:00
Pagan Gazzard
c8023e0780 Add a config var to determine what port for the api to listen on. 2015-10-13 13:36:12 -03:00
Pagan Gazzard
3f94b353f5 Remove VPN from the supervisor 2015-10-13 13:36:12 -03:00
Aleksis Brezas
c667b55025 move uncaught exception to the top of app.coffee 2015-10-13 13:36:12 -03:00
Aleksis Brezas
0665054a79 no updates 2015-10-13 13:34:23 -03:00
Pagan Gazzard
b1d16da9fa Separate out the pubnub logging functionality. 2015-10-13 13:29:40 -03:00
Pagan Gazzard
9673ae40d9 Remove some unneeded dependencies. 2015-10-13 13:28:00 -03:00
Pagan Gazzard
c5506d4566 Separate vpn connecting. 2015-10-13 13:28:00 -03:00
Pagan Gazzard
a7f5689873 Separate vpn bootstrapping. 2015-10-13 13:28:00 -03:00
Pagan Gazzard
5e380fb66a Turn the connectivity check into a singleton, so we only have one running. 2015-10-13 13:27:59 -03:00
Pagan Gazzard
2557ebcfc2 Move the connectivity check into utils. 2015-10-13 13:27:59 -03:00
Pagan Gazzard
53196208b0 Start the connectivity check straight away, rather than waiting for bootstrapping to succeed. 2015-10-13 13:27:59 -03:00
Pagan Gazzard
b9675de9e0 Change IP address update interval from 5m to 30s 2015-10-13 13:27:58 -03:00
Aleksis Brezas
cdca01eed1 Use require to parse package.json for supervisor version 2015-10-13 13:27:58 -03:00
Aleksis Brezas
523a8b5637 update device supervisor_version 2015-10-13 13:27:58 -03:00
Pagan Gazzard
c8a7c49cd5 Move the application update poll interval to an env var and reduce to 60s. 2015-10-13 13:27:57 -03:00
Aleksis Brezas
c4f9fd853d require config is needed to retry bootstrap 2015-10-13 13:27:56 -03:00
Pagan Gazzard
7f38248cfa Let the new supervisor handle tagging itself as a working supervisor, this means that the check that a supervisor update is a working update will not be nullified by a reboot. 2015-10-13 13:19:45 -03:00
Pagan Gazzard
5efcde7922 Start the supervisor update check ASAP, it allows us to push (and automatically update to) new supervisor images that fix issues in earlier stages. 2015-10-13 13:19:44 -03:00
Pagan Gazzard
5bb552f065 Make mixpanelTrack nicely handle errors being passed in and use it for logging bootstrapping errors. 2015-10-13 13:19:44 -03:00
Pagan Gazzard
f43afd4a95 Retry the bootstrap process if it fails - this means that we remove a point of failure (the previous connectivity check barrier merely reduced the chance of hitting that failure point) 2015-10-13 13:19:44 -03:00
Lorenzo Stoakes
f39b51885d Syntax cleanup pass. 2015-10-13 13:10:12 -03:00
Aleksis Brezas
aab2a3b3d3 missing require 2015-10-13 13:10:12 -03:00
Aleksis Brezas
69e2af5aa1 wait for an ok from next supervisor before exit 2015-10-13 13:10:11 -03:00
Praneeth Bodduluri
b790e4e304 Blink interval of 200ms was too slow to be seen - reverting to 400ms used in api.coffee 2015-10-13 13:10:11 -03:00
Praneeth Bodduluri
e7216618ad Make Blinkable LED configurable + Move blink to utils + Check connectivity before bootstrap + Blink LED on loss of connection 2015-10-13 13:10:11 -03:00
Pagan Gazzard
d07c6abe99 Store and make use of container ids.
This stores the container id for an app when creating that app, using it when it is necessary to stop/remove the app and when attempting to start it again (rather than creating a new container each time, eg restarting the pi does not create a new container any more)
2015-10-13 13:10:11 -03:00
Pagan Gazzard
a47022a0b4 Report the host ip address to the API on startup and every 5mins after. 2015-10-13 13:06:43 -03:00
Petros Angelatos
3e1dd1f922 Log every mixpanel event and remove redundant logs 2015-10-13 13:06:42 -03:00