Commit Graph
177 Commits
Author SHA1 Message Date
Jose Diaz-Gonzalez 1e543afb78 Retrieve default docker args a single time 2015-09-18 16:09:59 -04:00
Jose Diaz-Gonzalez b9ecb32d3f Reduce deploy trace output for multi-container applications
This reduces deploy output by moving `config:get` calls out of the main loop. Since the values are the same for each iteration, it does not make sense to re-retrieve them each time.
2015-09-18 16:08:24 -04:00
Jose Diaz-Gonzalez 1975384292 Fix issue where restart on failure option overrode existing DOCKER_ARGS 2015-09-17 10:32:14 -07:00
Jose Diaz-Gonzalez ab8eb5a727 Handle crashing containers by using restart=on-failure policy
Previously a crashed container would stay down, regardless of exit status. In some cases, it may be useful to restart the container. For example, an application may not be correctly implementing their error handling, or the crash may be caused by a transient error.

By setting the restart policy to `on-failure:N` - where N is a number of max restarts - we can help developers guard against crashing applications. Note that this is not a replacement for proper error handling, nor does this include notifications to a developer when a container is restarted. Those patterns should be implemented application side, or via a feature request to docker.

The value is configurable at the app-level by setting DOKKU_RESTART_LIMIT to a number. By default, containers will be restarted a max of 10 times. If a container crashes during the check-deploy plugin trigger, then the deploy will be marked as a failure.

Closes #216
Closes #398
Closes #1327
2015-09-16 23:47:33 -07:00
Michael Hobbs 72a1b76b63 don't require sudo for tailing logs since we're root anyway 2015-09-15 10:15:22 -07:00
Michael Hobbs 872fbc130e new trigger for failed container retirement 2015-09-15 02:17:28 -07:00
Michael Hobbs 8095df79f6 implement core plugin mgmt using plugn. add tests. 2015-09-15 02:17:28 -07:00
Michael Hobbs d6341e9ab7 set DOKKU_API_VERSION initially to 1 2015-09-15 02:17:28 -07:00
Michael Hobbs 18d234a925 move plugin-* to plugin: namespace 2015-09-15 02:17:28 -07:00
Jose Diaz-Gonzalez b3ddcbed53 Remove deprecated calls 2015-09-15 02:17:27 -07:00
Michael Hobbs 7a545759f2 initial pass at switching to plugn 2015-09-15 02:16:40 -07:00
Loïc Guitaut ac75c726ad Plugins management
We had an issue with third party plugins installing things via apt while
already installing dokku itself via apt.

To resolve this, `plugins-install` and `plugins-install-dependencies`
now can take a `--core` flag allowing to execute the install hook only
on core plugins and not on third party plugins.

Another feature with this modification is the ability to disable/enable
plugins. Two new commands now exist:

* `plugins:enable <name>` to enable a previously disabled plugin
* `plugins:disable <name>` to disable an installed plugin. This won’t
  work on core plugins.
2015-09-15 02:15:39 -07:00
Jose Diaz-Gonzalez 0ef3f71d8d Set DYNO env var to heroku-compatible value
Closes #1459
2015-09-14 20:30:57 -07:00
Michael Hobbs 51e8b540cc Merge pull request #1458 from progrium/mh-trace
set TRACE=true when DOKKU_TRACE is set
2015-09-10 14:36:33 -07:00
Michael Hobbs 01525e3164 set TRACE=true when DOKKU_TRACE is set 2015-09-10 14:07:07 -07:00
Luke Childs 2123917e9b Consistent spacing before do/then 2015-09-10 20:46:29 +01:00
Luke Childs a7c0020ceb while and do on same line in dokku deploy 2015-09-10 20:43:48 +01:00
Luke Childs 299d530959 Use [[ instead of [ in dokku deploy 2015-09-10 20:33:10 +01:00
Michael Hobbs b2949d2199 log when killing old app container(s) fails 2015-09-10 08:47:48 -07:00
Michael Hobbs ff6de12196 Merge remote-tracking branch 'akatrevorjay/pull-req-0' into 1356_mh-safe-stop-kill-event 2015-09-10 08:30:50 -07:00
Jose Diaz-Gonzalez 342e9aa95b Move dokku cleanup into docker_cleanup function
This should slightly reduce DOKKU_TRACE output.
2015-09-06 19:21:12 -04:00
Michael Hobbs ccb9e4a571 remove duplicate output 2015-09-03 17:25:28 -07:00
Michael Hobbs 495b1d2ba0 refactor to explicitly set IMAGE via get_app_image_name() 2015-09-03 16:12:36 -07:00
Michael Hobbs 04a4da7fc5 allow tagging and deployment of tagged app images 2015-09-02 11:18:01 -07:00
Jose Diaz-Gonzalez cd23310042 Surround in single quotes 2015-08-26 02:30:57 -04:00
Jose Diaz-Gonzalez b6ef5af3d1 Set DYNO_TYPE_NUMBER environment variable for each container
This will allow users to inspect the underlying environment and conditionally run different commands based upon the `DYNO_TYPE_NUMBER`. The values will be set in the following format:

    web.1
    web.2
    worker.1
    worker.2
    clock.1

Users of process managing plugins and dockerfiles can check the `DYNO_TYPE_NUMBER` and set a specific command to run.

Closes #1350
2015-08-26 00:35:22 -04:00
Michael Hobbs 6d71c164f0 Merge pull request #1128 from progrium/1091_mh-switch-to-herokuish
switching to herokuish. closes #1091
2015-08-24 12:11:05 -07:00
Michael Hobbs 42905c345b support comments in DOKKU_SCALE and print contents on deploy 2015-08-24 09:22:07 -07:00
Michael Hobbs 26d761d85b make sure we sort container id files, et al correctly even if the app name contains a period. fixes #1382 2015-08-12 21:36:25 -07:00
Michael Hobbs c02ba86c81 allow DOKKU_WAIT_TO_RETIRE to be defined per app. closes #1258 2015-07-30 15:03:19 -07:00
Trevor Joynson (trevorj) c750f5a768 Allow stop/kill to continue in the event that it cannot stop or kill one of the old containers.
Also actually attempt to kill if stop has a bad exit code.
2015-07-30 16:42:13 -04:00
Michael Hobbs d21caa4811 Merge branch 'master' into 1091_mh-switch-to-herokuish 2015-07-28 10:55:44 -07:00
Michael Hobbs b30db17def use column to format help output 2015-07-28 09:31:56 -07:00
Michael Hobbs 9593bd6d48 simplify docker run logic in deploy 2015-07-24 12:15:10 -07:00
Michael Hobbs da5f42a13e set and use $port whenever $PROC_TYPE == 'web'. closes #1336 2015-07-24 10:40:00 -07:00
Michael Hobbs c7cb014580 convenience functions for app container state 2015-07-13 09:27:42 -07:00
Jose Diaz-Gonzalez f27cbe1325 Merge pull request #1313 from progrium/1309_mh-verify-app-in-deploy
verify we have an app when deploy is called
2015-07-13 10:35:22 -04:00
Michael Hobbs b0ca3aadb0 verify we have an app when deploy is called. fixes #1309 2015-07-12 16:59:16 -07:00
Michael Hobbs 57b405ce76 use config:get for checks skipping variables 2015-07-12 15:23:51 -07:00
Jose Diaz-Gonzalez 43b179735b Merge pull request #1261 from Flink/bypass-checks-on-demand
Allows to skip checks (all or default)
2015-07-11 16:31:21 -04:00
Michael Hobbs a84397895a initial pass at config plugin arguments refactor 2015-07-06 19:41:17 -07:00
Michael Hobbs 0840d8fd1f initial pass at switching to herokuish. closes #1091 2015-07-06 12:41:54 -07:00
Michael Hobbs 0b9ac9a727 don't background cleanup 2015-07-05 21:08:47 -07:00
Jose Diaz-Gonzalez e1044199c7 Merge pull request #1254 from kilianc/feature/custom-start-cmd
added DOKKU_DOCKERFILE_START_CMD support
2015-07-03 12:54:24 -04:00
Alessio Treglia 91c691a806 Create dokku's /var/log/dokku/ private namespace
Rename dokku.log to events.log.
Refresh tests accordingly.
2015-07-01 18:25:11 +01:00
Loïc Guitaut c316f59f4f Allows to skip checks (all or default)
Setting `DOKKU_SKIP_ALL_CHECKS` globally or for a given app will skip
all checks.
Setting `DOKKU_SKIP_DEFAULT_CHECKS` globally or for a given app will skip
default checks only.
2015-06-29 17:21:31 +02:00
Alessio Treglia 783bb02b2c Implement events logging feature
Record events (i.e. pluginhook's calls) as syslog entries and
provide a shortcut command to display the last part of the log
file.

A brief summary of the changes follows:

dokku:
 - New DOKKU_EVENTS_LOGFILE envvar to hold logfile location.

plugins/20_events/commands:
 - events output log entries, a tail's follow-like mode is
   provided too.
 - events:[on|off] enables/disables logging.
 - events:list lists events that are logged.

plugins/20_events/hook:
 - Generic hook that writes log entries. All the events are
   registered via symlink to this script.

plugins/common/functions:
 - dokku_log_event() writes log entries via logger.
 - dokku_log_pluginhook_call() formats log entries and writes
   them via dokku_log_event().
2015-06-26 14:47:18 +01:00
Kilian Ciuffolo 4a4ae9cb71 not fail if DOKKU_DOCKERFILE_START_CMD is not set 2015-06-25 18:05:03 -07:00
Kilian Ciuffolo 74164c2266 added DOKKU_DOCKERFILE_START_CMD support 2015-06-25 15:17:28 -07:00
Michael Hobbs 4aedb6507a Merge branch 'master' into mh-ps-scale 2015-04-30 10:32:29 -07:00