Commit Graph

45 Commits

Author SHA1 Message Date
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
6f42fc2036 Try to do systemd calls in gosuper 2015-10-13 13:45:04 -03:00
Pablo Carranza Vélez
3da4dae190 Add systemd interface and reboot/shutdown endpoints 2015-10-13 13:45:04 -03:00
Pablo Carranza Vélez
53ed41a4e2 Allow lockfile force to be specified in the request body 2015-10-13 13:45:04 -03:00
Pablo Carranza Vélez
d5ddad914e Add /v1/restart API endpoint 2015-10-13 13:45:04 -03:00
Pablo Carranza Vélez
4aea117330 Purge handles strings and numbers, and is tested with a table 2015-10-13 13:45:03 -03:00
Pablo Carranza Vélez
3da961d4fd Use env var for force, and don't touch lockfile on force
Also:

* Force lock when purging

* Use updateStatus object to keep update state
2015-10-13 13:45:03 -03:00
Pablo Carranza Vélez
c7c4aed746 Use rwlock together with lockfile
Select app to kill from DB within lock (otherwise, if some other part kills and restarts the app, the
containerId will have changed and the real container will not be removed).
2015-10-13 13:45:03 -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
c2496d30c2 Use Promise Disposer for lock, + cleanup 2015-10-13 13:43:36 -03:00
Pablo Carranza Vélez
6d54e6663e Lock app restart, cleanup and better testing 2015-10-13 13:43:36 -03:00
Pablo Carranza Vélez
9bc2f6212d Handle App not found in purge, + cleanup
* gosuper in dockerignored folder
* correctly handle app not found in purge
* test formatting in test-gosuper
* Fix test-gosuper
* DRY up test-integration
2015-10-13 13:43:36 -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
Pablo Carranza Vélez
dd53bbd1db Call the gosuper from node via unix socket + http. 2015-10-13 13:43:36 -03:00
Pablo Carranza Vélez
1e340f4fac Return when no appId 2015-10-13 13:43:35 -03:00
Pagan Gazzard
a97cd40b44 Close the tty.js server as well as the ngrok listener. 2015-10-13 13:39:08 -03:00
Pagan Gazzard
5f5b6f5be1 Fix stopping a tty session via the api using the wrong app id. 2015-10-13 13:39:08 -03:00
Pagan Gazzard
d578bbfba3 Use the new status/send/sendStatus style. 2015-10-13 13:39:08 -03:00
Pagan Gazzard
6144ea3aeb Update to express ^4.0.0 2015-10-13 13:39:08 -03:00
Pagan Gazzard
1784c75c57 Add secret/apikey based authentication to the supervisor. 2015-10-13 13:36:12 -03:00
Aleksis Brezas
0665054a79 no updates 2015-10-13 13:34:23 -03:00
Pagan Gazzard
f0afcb706a Separate out tty.js 2015-10-13 13:28:00 -03:00
Pagan Gazzard
e054b36d58 Use sensible defaults for the blink patterns, and make use of it for the API blink. 2015-10-13 13:27:59 -03:00
Eugene Mirotin
31a48c75f5 pass the error message in despawn as well 2015-10-13 13:10:12 -03:00
Eugene Mirotin
378913862f pass the proper error message 2015-10-13 13:10:12 -03:00
Pagan Gazzard
ad107b30ae Enable destroying a tty.js tunnel. 2015-10-13 13:10:12 -03:00
Pagan Gazzard
1b0e364322 Enable spawning a tty.js tunnel. 2015-10-13 13:10:12 -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
Petros Angelatos
3e1dd1f922 Log every mixpanel event and remove redundant logs 2015-10-13 13:06:42 -03:00
Petros Angelatos
1501cf3122 Integrate mixpanel 2015-10-13 13:06:42 -03:00
Page
a0f9219cb3 Initial version of self-updates, adds an "/v1/update-supervisor" endpoint that can be posted to in order to trigger a supervisor update, which it then fetches as the resin/rpi-supervisor repo of the registry endpoint. 2015-10-13 13:06:41 -03:00
Page
e336eaad6e Increase the blink duration to 15s 2015-10-13 13:01:25 -03:00
Page
2d6f0a7e6d Update bluebird and use the delay helper. 2015-10-13 12:58:57 -03:00
Page
b65e3fd3f9 Remove some more unnecessary parens. 2015-10-13 12:58:57 -03:00
Petros Aggelatos
637d68921f Application management code in its own module 2015-10-13 12:58:56 -03:00
Petros Aggelatos
563df5386d On update get application info from the API 2015-10-13 12:58:56 -03:00
Petros Aggelatos
f10fb532c6 Use versioned API endpoints 2015-10-13 12:58:56 -03:00
Petros Aggelatos
e5684a1c3a Promisify blink 2015-10-13 12:58:56 -03:00
Petros Aggelatos
c98a274bde Fixed syntax errors 2015-10-13 12:58:55 -03:00
Petros Aggelatos
de342a9209 Revamp/rewrite of supervisor as a docker application 2015-10-13 12:58:55 -03:00