Commit Graph

47 Commits

Author SHA1 Message Date
Petros Angelatos
c7a7ba93fb gosuper: support i386 platforms without MMX instructions
The intel quark and the gallileo have an x86 CPU that does not have MMX
extensions. Use a patched go that does not require those instructions for
atomics, and also enable the GO386=387 flag.

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2016-10-20 20:52:33 -07:00
Pablo Carranza Velez
3cbe56c978 Fix disabling logs to display on newer OS with different service name 2016-10-05 19:04:47 +00:00
Praneeth Bodduluri
81cb27a876 Add resin-vpn interface IP filtering to gosupervisor 2016-09-23 18:46:28 +05:30
Petros Angelatos
ca91fd179b compress gosuper with upx
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2016-09-14 01:38:37 +00:00
Petros Angelatos
83393c04e3 switch to golang 1.6 to make the binary upx-able
https://github.com/golang/go/issues/13974
5e7110b92b

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2016-09-14 01:38:36 +00:00
Petros Angelatos
488ca41621 build: implement multi-Dockerfile build process
This build strategy lends itself to how Rockerfiles work. In the build
Dockerfile all the build utilities (e.g gcc, python) are installed and
run the build process to produce some build artifacts. There are two
build Dockerfiles, one for the nodejs part and one for the golang part.
The build artifacts of these are combined into the runtime Dockerfile.
For all this to work there is some minimal glue implemented in the
Makefile.

Part of this commit is a switch of the base image the runtime is based
on to the minimal OpenEmbedded one produced by #198

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2016-09-14 01:38:35 +00:00
Pablo Carranza Velez
164d565283 Make the data path configurable 2016-06-14 13:50:50 -03:00
Pablo Carranza Velez
eddc58ee86 Finish log to display setting. Add logging to host config. Save host config before rebooting. Allow applying boot config to RPi3. 2016-03-23 12:21:15 -03:00
Praneeth Bodduluri
6d391703e2 BugFix - OOMAdjust wrongly runs on all PIDs without a name match 2016-01-20 02:20:36 +05:30
Praneeth Bodduluri
fb47f73907 Add missing container filtering + Address PR Comments by removing regexp and making more idiomatic choices 2016-01-12 17:58:07 +05:30
Praneeth Bodduluri
b28e6c7648 Change the openvpn and connmand OOM adjust to only happen if existing value is 0 2016-01-08 18:30:14 +05:30
Praneeth Bodduluri
1bc53ebc8d Add protection for connman and openvpn every 5 minutes 2016-01-08 18:30:14 +05:30
Praneeth Bodduluri
34dcae78de Fix formatting tests to exclude Godeps 2016-01-08 18:30:14 +05:30
Praneeth Bodduluri
7ac0323de3 Move the OOM protection code to a function 2016-01-08 18:30:14 +05:30
Praneeth Bodduluri
6231b952bc Use psutils to set OOM adj score for this container to -800 2016-01-08 18:30:14 +05:30
Praneeth Bodduluri
53ebc1ef7f Use OOM Score Adjust 2016-01-08 18:30:14 +05:30
Praneeth Bodduluri
b0001c049f Initial helper functions for adjusting OOM adj value of process' and Docker containers 2016-01-08 18:30:14 +05:30
Pagan Gazzard
4a829b851f Ignore all godeps workspace diffs 2016-01-08 12:45:11 +00:00
Praneeth Bodduluri
1bab2c6a83 Do not report the tun addresses to API 2015-12-10 22:21:40 +05:30
Lorenzo Stoakes
849a8c848b Prevent non-fatal errors from closing the supervisor.
This patch fixes a couple of cases where `log.Fatalf` would cause the supervisor
to exit immediately when it's inappropriate to do so. `log.Fatalf` and
co. should not be used unless the supervisor utterly cannot run without
whatever's being checked being in place.

This patch also adjusts the code that relied on the module's values being
created here being available, they now check and send an appropriate error
message if they're not there.
2015-10-15 18:14:42 +01:00
Praneeth Bodduluri
96d4aebb76 Refactor api.go to use abstracted sendResponse and sendError - Also fix most go doc complaints 2015-10-13 13:45:08 -03:00
Praneeth Bodduluri
1890c0bc0d Refactor api.go and systemd.go based on PR comments 2015-10-13 13:45:08 -03:00
Praneeth Bodduluri
50a804683d Use Promises for requests+ Add better console logs 2015-10-13 13:45:08 -03:00
Praneeth Bodduluri
b91cb78eea Allow control of VPN + TCP check + Pub nub logs with Device Environment variables 2015-10-13 13:45:07 -03:00
Praneeth Bodduluri
cd9daa8a8b Add GO api for openvpn control 2015-10-13 13:45:07 -03:00
Praneeth Bodduluri
1848a819da Fix Typo in ipAddresses 2015-10-13 13:45:05 -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
bc0afb0032 Catch all kind docker interfaces 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
feb4d74d28 Use regex to finely detect docker and rce interfaces and address style fixes 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
94d8703eef Sleep before shutting down 2015-10-13 13:45:05 -03:00
Pablo Carranza Vélez
8585ad718f Use go-systemd/login1 for Reboot/Shutdown 2015-10-13 13:45:04 -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
82f87527c8 Add godbus package 2015-10-13 13:45:04 -03:00
Praneeth Bodduluri
27a8ee2b19 Use golang 1.5.1 for compiling 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
c2496d30c2 Use Promise Disposer for lock, + cleanup 2015-10-13 13:43:36 -03:00
Pablo Carranza Vélez
685af77007 Reorganize files, and purge sends 404 when there's no directory.
* 404 when no directory
* fix go-supervisor.conf location
* Use /var/run/resin for gosuper socket
* Remove potential spurious gosuper binaries
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
300067febe Correctly integrate Go unit tests with Jenkins 2015-10-13 13:43:36 -03:00
Pablo Carranza Vélez
0587858f69 First API implementation with purge and unit testing. 2015-10-13 13:43:36 -03:00
Pablo Carranza Vélez
ed8adcdda9 Initial structure with Godeps and build Dockerfile 2015-10-13 13:43:36 -03:00