feat: retire intermediate containers after use

Rather than waiting for the next deploy, take advantage of the retire system to retire these containers immediately.

Note that since the retire process happens out of band, the containers may stick around for up to 5 minutes, after which point they will be removed.

Customization of the wait time to retire - currently 60 seconds - is up for future debate. The containers ultimately haven't been useful for debugging, so keeping them around for longer won't help in most cases, and folks can disable the dokku-retire service (or cron) if that is desired.
This commit is contained in:
Jose Diaz-Gonzalez
2020-11-22 16:57:39 -05:00
parent e0127250ae
commit ef490f0a05
8 changed files with 45 additions and 2 deletions

View File

@@ -1909,6 +1909,26 @@ DOKKU_SCHEDULER="$1"; APP="$2"; CONTAINER_ID="$3";
# TODO
```
### `scheduler-register-retired`
> Warning: The scheduler plugin trigger apis are under development and may change
> between minor releases until the 1.0 release.
- Description: Allows scheduling retiring a local container
- Invoked by: `internally`
- Arguments: `$APP $CONTAINER_ID`
- Example:
```shell
#!/usr/bin/env bash
set -eo pipefail; [[ $DOKKU_TRACE ]] && set -x
APP="$1";
CONTAINER_ID="$2";
# TODO
```
### `scheduler-retire`
> Warning: The scheduler plugin trigger apis are under development and may change