Commit Graph

478 Commits

Author SHA1 Message Date
Pablo Carranza Vélez
08d74b578b Fix preloaded apps by passing appId to extendEnvVars 2016-07-06 17:56:51 -03:00
Pagan Gazzard
6cb4b090c5 Rename pullImage to pullAndProtectImage to make it a bit clearer that it isn't a simple pull 2016-06-24 21:08:47 +00:00
Pagan Gazzard
707ed7e1f6 Deduplicate compose command running logic. 2016-06-24 21:08:47 +00:00
Pagan Gazzard
a371e35d5c Deduplicate knex app fetching logic. 2016-06-24 21:08:47 +00:00
Pablo Carranza Velez
4278b6baf1 Add endpoints for docker-compose up and down 2016-06-24 21:08:46 +00:00
Kostas Lekkas
d64d413838 Remove unused vars and fix linting issues 2016-06-16 18:47:12 +03:00
Pablo Carranza Velez
164d565283 Make the data path configurable 2016-06-14 13:50:50 -03:00
Pablo Carranza Velez
a8677a4401 Add listener for container events and reattach on restart 2016-06-11 11:55:22 -03:00
Pablo Carranza Velez
6e39128f3a fix deltas by not using the supervisor as source 2016-06-10 17:22:52 -03:00
Petros Angelatos
573cf31514 fix delta error handling by listening for the 'error' event
Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2016-06-10 19:19:23 +00:00
Alexios Theodoros Brezas
e3f480c217 Container restart policy specificiation.
Allow users to set container restart policy using environment variables.

RESIN_APP_RESTART_POLICY sets the name of the policy, and
if policy is "on-failure", optionally, RESIN_APP_RESTART_RETRIES
sets the maximum number of retries.

More information on docker docs:
https://docs.docker.com/engine/reference/run/#restart-policies-restart

One major change we introduce here is that the default policy is set
to always while we used to have the default "no".

We validate the arguments and pass retries parameter only for the case
of "on-failure" as specified in Docker API as of v1.19.
We could let docker handle the arguments directly, gaining
forwards-compatibility with any new features, but I opted
for an implementation that is as well-defined as possible.
2016-06-07 12:49:30 -03:00
Petros Angelatos
20419bee3b Switch to docker-delta library to use deltas v2
This npm library implements the new delta format and also works with
docker 1.10.

Signed-off-by: Petros Angelatos <petrosagg@gmail.com>
2016-06-04 01:04:34 +00:00
Pablo Carranza Velez
7104806ad1 Correctly compare container image name on cleanup
Docker 1.10 sends containerInfo.Image without the ":latest", so
the image name doesn't match the app's imageId.
This fix first splits the image name into repo and tag and then rebuilds
it to include ":latest" when appropriate. Should avoid removing containers
when using resin-sync.
2016-06-02 14:55:12 -03:00
Kostas Lekkas
383be0946e bugfix: do not mutate original env vars object 2016-06-01 00:02:53 +03:00
Kostas Lekkas
6193ebe1df Log useful supervisor info to stdout/stderr 2016-05-30 16:51:27 +03:00
Pablo Carranza Velez
ed7b936fee Use buffer-equal-constant-time to evaluate apikey 2016-05-23 23:59:45 -03:00
Pablo Carranza Velez
25be1176d2 Add changelog for alpine super and fix version reporting 2016-05-19 16:25:49 +00:00
Pablo Carranza Velez
d58517f32d Use rwlock to block when images are being pulled 2016-05-19 13:24:23 +00:00
Pablo Carranza Velez
95f4fdb97f Add /v1/images/load endpoint 2016-05-18 13:47:54 -03:00
Pablo Carranza Velez
951bd2888f Fix routing for deleting images with a slash in the name 2016-05-17 19:18:39 +00:00
Pablo Carranza Velez
7b9eaeea3a Add some protections to avoid deleting supervisor or app containers 2016-05-17 00:03:23 +00:00
Pablo Carranza Velez
3a77c2ec4b Allow passing tag when using fromImage in /v1/images/create 2016-05-13 10:35:03 -03:00
Pablo Carranza Velez
dcc3717949 Use Routers to separate endpoints with bodyParser 2016-05-13 10:35:03 -03:00
Pablo Carranza Velez
5d822b8dab Allow pulling images too 2016-05-13 10:35:03 -03:00
Pablo Carranza Velez
3d2f3ad94b Implement container management endpoints 2016-05-11 15:43:21 +00:00
Pablo Carranza Velez
8101d08433 Add endpoints to create, delete and list images, and also list containers 2016-05-11 14:44:05 +00:00
Pablo Carranza Velez
67a7271995 Add RESIN_APP_ID variable 2016-05-09 19:35:35 -03:00
Pablo Carranza Velez
7039b23ad9 Increase delta request timeout to 15 minutes 2016-05-02 17:33:21 -03:00
Kostas Lekkas
8577280dc5 Merge pull request #126 from resin-io/add-stop-start-endpoints
WIP: Add stop, start and get app endpoints
2016-04-25 13:27:08 +03:00
Kostas Lekkas
01e39825b4 Style fixes, select() app columns to return in /v1/apps 2016-04-21 09:58:36 +03:00
Kostas Lekkas
f76b38eb49 Use exclusion lists for keys/columns to be omited from the /v1/apps endpoint 2016-04-20 19:43:16 +03:00
Kostas Lekkas
e03e5ed0ae Address review comments 2016-04-20 19:08:35 +03:00
Kostas Lekkas
757e5b3244 Return container Id from the /v1/start and /v1/stop endpoints 2016-04-20 15:49:22 +03:00
Kostas Lekkas
809609dd76 Set containerId to null if container gets removed after a failed start attempt 2016-04-20 14:53:56 +03:00
Pagan Gazzard
f910ec11a8 Remove even more old terminal related stuff. 2016-04-18 18:13:23 +01:00
Kostas Lekkas
4e3106154d Require lodash 2016-04-18 19:04:06 +03:00
Pablo Carranza Velez
1c69f14e82 Refactor into /apps/:appId endpoint namespace, and add endpoint to GET the app 2016-04-16 13:52:38 -03:00
Pagan Gazzard
135365cf37 Remove the old terminal code, since it has been replaced by v2 which does not require supervisor support. 2016-04-15 23:36:28 +01:00
Pablo Carranza Velez
7161564123 Add /v1/stop and /v1/start endpoints 2016-04-08 16:51:39 -03:00
Pablo Carranza Velez
d0f748379e Fix log message for setLogToDisplay 2016-03-23 17:59:44 -03:00
Pablo Carranza Velez
adb7ef1140 Omit host config also when formatting local apps 2016-03-23 17:36:04 -03:00
Pablo Carranza Velez
9fea0a729b Use json to print boot config 2016-03-23 17:24:03 -03:00
Pablo Carranza Velez
8771307c39 Lodash 3 has no omitBy 2016-03-23 16:48:23 -03:00
Pablo Carranza Velez
c9968f7bbc Improve logging, plus some style fixes 2016-03-23 12:21:15 -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
Pablo Carranza Velez
2c5bc8b90a Add nodejs side of enabling/disabling log to display 2016-03-23 12:21:14 -03:00
Alexios Theodoros Brezas
3d082aaaa8 mount to /host dir 2016-03-23 04:15:02 +00:00
Alexios Theodoros Brezas
84d42ca6de Bind mount /var/lib/connman to application containers.
This allows application containers to interface with host connman.

Host /var/lib/connman is bind mounted to /host_var/lib/connman to avoid
collisions with connman installations inside the container.
2016-03-23 04:15:01 +00:00
Pablo Carranza Velez
f29bab0b9d Add RESIN_SUPERVISOR_DELTA to special list so that app is not restarted when it changes 2016-03-09 10:53:48 -03:00
Kostas Lekkas
fcaafd9033 Reduce noise in logs 2016-03-07 13:16:38 +02:00