Pablo Carranza Vélez
65df89aab6
Give extra environment variables to preloaded apps. Ensures the app is not unnecessarily restarted as soon as we gain connectivity.
2015-10-13 13:45:06 -03:00
Pablo Carranza Vélez
d25447d539
Promisify executeSpecialActionsAndBootConfig and remount /boot rw
2015-10-13 13:45:06 -03:00
Pablo Carranza Vélez
c136793cdd
Blacklist certain config.txt entries, Update node to 0.10.40 everywhere
...
Use board-specific images until we have new arch based ones
2015-10-13 13:45:06 -03:00
Pablo Carranza Vélez
39a07b8cd4
Remove the RPi /boot bind mount
2015-10-13 13:45:06 -03:00
Pablo Carranza Vélez
0e283e8e72
Actually apply config.txt changes and reboot
...
Keep the original statements where possible. (to ensure same config keys under different filters are not overwritten with always the same value)
2015-10-13 13:45:06 -03:00
Pablo Carranza Vélez
8b4d1e9f75
Ensure special env vars are persistent and add placeholder for device.setBootConfig
2015-10-13 13:45:06 -03:00
Praneeth Bodduluri
38df4651cb
Change to using _.has
2015-10-13 13:45:06 -03:00
Praneeth Bodduluri
173d5ee651
Execute the callback function associated with the specialActionVars only once and remove unused parts
2015-10-13 13:45:06 -03:00
Pablo Carranza Vélez
941d3b15af
Allow special env vars with a callback which don't cause an app restart
2015-10-13 13:45:06 -03:00
Praneeth Bodduluri
66a4bf4ab3
Remove unused config.supervisorContainer in config.coffee
2015-10-13 13:45:06 -03:00
Pablo Carranza Vélez
bd889e06a1
Bind mount /boot in RPi
2015-10-13 13:45:06 -03:00
Praneeth Bodduluri
391a141843
Change ipAddress to IPAddresses and add error message on unknown ip addr type
2015-10-13 13:45:05 -03:00
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
8eb1c3ea7b
Ensure we have the deviceId by GETting it from the Resin API
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
909e193cea
Update resin-register-device to 2.0.0
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
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
Praneeth Bodduluri
a15c9e636e
Add additional mount for the host's docker.sock
2015-10-13 13:45:04 -03:00
Praneeth Bodduluri
efc272533c
Also mount the host dbus on host_run/dbus
2015-10-13 13:45:04 -03:00
Pablo Carranza Vélez
6e62366541
Always unlock the lockfile when killing the app.
...
Otherwise, we have a deadlock whenever the lock is forced: the app
will be restarted, and will find the lockfile is already there so it won't be
able to lock/unlock it. The supervisor will have the same problem.
So the solution is that, whenever we kill the app, that is the lock owner, we also unlock the file.
2015-10-13 13:45:04 -03:00
Pablo Carranza Vélez
233004d130
Download/update/remove/install all apps in a map
2015-10-13 13:45:03 -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
1eb31ce5f6
Apply coffeelint everywhere
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
7b8ca9fd73
Start the fs watch after the VPN directory has been created - Use finally and not then
2015-10-13 13:43:37 -03:00
Praneeth Bodduluri
ac545ccc52
Change the EEXIST to a function
2015-10-13 13:43:37 -03:00
Praneeth Bodduluri
a57c723e8a
Remove inotify and lint changes
2015-10-13 13:43:37 -03:00
Praneeth Bodduluri
a4966a798a
Change the fs functions to promise
2015-10-13 13:43:37 -03:00
Praneeth Bodduluri
0213916b90
Style changes
2015-10-13 13:43:37 -03:00
Praneeth Bodduluri
8642371094
Pause TCP Pings on VPN connection
2015-10-13 13:43:37 -03:00
Praneeth Bodduluri
d6b6d2d73b
Distinguish betweek - permanent TCP check disable and pausing tcp check
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
c250ff483c
Fix double app start (app.id = null after kill)
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