Commit Graph

228 Commits

Author SHA1 Message Date
Jose Diaz-Gonzalez
38a13ecd39 feat: expose network listeners to nginx templates for all process types
This change allows users to specify a custom nginx.conf.sigil that can expose non-web process types to the outside world in addition to the web process type.

Closes #3258
2020-03-11 12:34:38 -04:00
Jose Diaz-Gonzalez
054bf26b0e chore: remove unnecessary source/import statements 2020-02-28 06:03:53 -05:00
Jose Diaz-Gonzalez
6fd4b5adb1 refactor: rewrite proxy plugin in golang 2020-02-22 06:40:24 -05:00
Jose Diaz-Gonzalez
e19b52442b fix: remove deprecated egrep calls from codebase 2020-02-17 05:59:52 -05:00
Jose Diaz-Gonzalez
d759c6c12d Merge pull request #3682 from dokku/3588-tty-default-lang
Force tty check to run with the default language
2020-02-10 05:14:24 -05:00
Jose Diaz-Gonzalez
e67b96780d refactor: unify command declaration across codebase 2020-02-10 01:40:30 -05:00
Jose Diaz-Gonzalez
1cb586b2e7 refactor: standardize command naming
This standardization makes it somewhat easier to read stacktraces as the command names are all uniform, so it will be slightly easier to scan trace output.
2020-02-09 22:41:39 -05:00
Jose Diaz-Gonzalez
385aed85b9 chore: fix log_exit call 2020-02-08 19:46:50 -05:00
Jose Diaz-Gonzalez
d39f4ce54d feat: add stderr log functions 2020-02-08 19:46:44 -05:00
Jose Diaz-Gonzalez
ca5946636f chore: move fn-in-array to common-functions
This is used by all generic `set` commands, so we should just make it globally available.
2019-12-19 02:29:22 -05:00
Michael Hobbs
972830a5f3 fix: respect DOKKU_APP_USER in is_image_herokuish_based 2019-11-19 15:07:29 -07:00
Jose Diaz-Gonzalez
35287a2d28 fix: force tty check to run with the default language
This fixes the case where the system language is non-english. See this stackexchange answer for more details: https://unix.stackexchange.com/q/87745

Closes #3588
2019-10-14 05:03:18 -04:00
Jose Diaz-Gonzalez
498bdd0491 chore: cleanup build and destroy logging output 2019-09-20 12:31:19 -04:00
Jose Diaz-Gonzalez
b4e95fe0d5 feat: add support for python3
- Use jq where possible
- Drop unused function (no usage across entire codebase nor in any github repository

Closes #3689
2019-09-19 23:33:43 -04:00
Jose Diaz-Gonzalez
798725bb54 feat: allow passing labels to one-off dokku containers
This feature is allows users to add extra label metadata to one-off containers. As this can interfere with Dokku internals if they shadow labels used by plugins, care should be taken to avoid the `com.dokku` or `org.label-schema` namespace.

Also proper name run containers so they don't get random names from docker...
2019-09-16 23:10:14 -04:00
Jose Diaz-Gonzalez
44fcea0ffa refactor: use new-style docker management commands
This PR uses the new syntax for commands introduced in Docker 1.13, making it a bit easier to understand just what a particular command is trying to do.

This also pushes the long-form syntax for docker command flags, which are also easier to understand at a glance.
2019-09-15 18:55:53 -04:00
Jose Diaz-Gonzalez
3ca6245b00 fix: use 6 X to support running under busybox
mktemp from busybox requires that all templates end with XXXXXX.
2019-08-12 18:16:16 -04:00
Jose Diaz-Gonzalez
925c6c4c28 feat: inject the dokku PID into temporary files/directories
This will allow background processes to cleanup these files if they were unable to be cleaned up during a run of the dokku binary, as is the case for files copied by the docker binary when running in docker.
2019-08-12 17:56:17 -04:00
Jose Diaz-Gonzalez
9a2c8e04a5 feat: quiet down deploys 2019-08-12 17:39:01 -04:00
Jose Diaz-Gonzalez
6fcb53113a fix: return true when removing temporary files extracted from docker
If you are running docker in docker, the permissions on the generated file are such that they may not be accessible by the normal dokku user. For dokku, it is good enough to ignore the failed removal.
2019-08-05 15:57:54 -04:00
Jose Diaz-Gonzalez
5affe42699 fix: remove unnecessary cat 2019-08-05 15:24:15 -04:00
Jose Diaz-Gonzalez
86febeb7ca fix: do not try to remove the container twice 2019-08-05 13:35:03 -04:00
Jose Diaz-Gonzalez
8dbf855d56 feat: handle case where docker cp is run as non root and tries to chown the file
This _may_ be cargo-cult, but its an easy way to handle any potential issues, so we'll include it regardless.
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
dc9d597cd8 feat: handle case where file may not have trailing newline and parsing depends on it 2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
f771b272e3 fix: handle case where file may have windows newlines
Closes #3611
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
6c8f716c11 refactor: handle case copied file is not directly readable
If "docker cp" is run within docker, it seems the owner is root, resulting in other processes not being able to directly read the file without resorting to `cat` trickery. Doing this in a single place avoids the problem completely.
2019-08-05 11:40:53 -04:00
Jose Diaz-Gonzalez
008fafbed8 fix: force image pruning 2019-08-03 14:21:34 -04:00
Jose Diaz-Gonzalez
c959b236ea fix: do not prune all unused images
This would impact base images related to image building, as well as other images not managed by Dokku directly.
2019-08-02 11:38:08 -04:00
Jose Diaz-Gonzalez
85b41121de fix: make image removal synchronous
Asynchronous image removal would remove intermediate build images during the build process, causing intermittent build failures for users of multi-stage dockerfiles. While we still remove intermediate docker images that may be used in the current build, we now do so during the deploy, ensuring that there are no intermediate build failures in the future.

Closes #3474
2019-08-02 11:21:51 -04:00
Jose Diaz-Gonzalez
5b53994447 feat: avoid calling the user-auth trigger where possible
As this trigger is always in the execution path, `plugn` starts and expensively checks to see if it can execute the trigger. Rather than call this on every invocation, skip the trigger if no non-core implementation exists.
2019-08-01 20:18:14 -04:00
Jose Diaz-Gonzalez
0a8d5eb744 refactor: add initial support for builder plugins
A builder plugin implements some method for 'building' artifacts from a given source code archive. This refactor moves the majority of the image building code into separate plugins, allowing us to implement other builders, but also simplifying the common pugin codebase.

Also move the pre-build-buildpack hook from the build-env plugin to builder-herokuish.
2019-07-30 14:42:30 -04:00
Jose Diaz-Gonzalez
6836e56b24 refactor: add global docker build and run args
This reduces duplication and allows users to rely on global arguments to generate most labels needed.

The 'commit' command cannot have global arguments because the whitespace within the label change breaks string-based interpolation, and shell arrays cannot be exported.
2019-07-20 05:52:20 -04:00
Jose Diaz-Gonzalez
193e40b4c3 feat: scope cleanup to app when specified
This will require changes in community plugins to properly add the specified labels to intermediate containers.

Closes #3515
2019-07-19 15:45:43 -04:00
Jose Diaz-Gonzalez
d1af10fc51 feat: add labels to all build, commit, create, and run docker calls
This will allow us to further filter containers and images by application when cleaning up containers.

Refs #3515
2019-07-19 15:45:43 -04:00
Jose Diaz-Gonzalez
402c6db826 chore: move the event logging to it's own tag
Without this, rsyslog will shunt any logging output from the dokku user to the event log, garbling output for future investigation.
2019-07-17 20:48:57 -04:00
Jose Diaz-Gonzalez
785d9b4937 feat: allow setting DOCKER_BIN path for docker execution
This change allows operators to specify a DOCKER_BIN environment variable. This will specify a binary to run when executing docker, which is useful in cases where the 'docker' command being run must be modified in a way that would otherwise be invasive to Dokku, but minimalistic if done within a wrapper.
2019-05-29 00:46:19 -04:00
Jose Diaz-Gonzalez
1b92f4a97e chore: standardize how temporary files are named 2019-05-20 18:01:17 -07:00
Jose Diaz-Gonzalez
c8a491ed7f fix: only use the RETURN signal for the suppress file removal
Closes #3473
2019-05-20 18:01:03 -07:00
Jose Diaz-Gonzalez
9e2a129854 Merge pull request #3561 from dokku/3544-ps-can-scale
feat: disable scaling if app contains DOKKU_SCALE file
2019-05-19 22:59:08 -07:00
Jose Diaz-Gonzalez
4264380e15 feat: disable scaling if app contains DOKKU_SCALE file
A DOKKU_SCALE file will always be used for managing the scale count for an app if it exists in a repository. As such, ps:scale usage should be disabled in those cases. This commit makes that more apparent.

Also document how to build a specific core plugin for testing purposes.

Closes #3544
2019-05-18 15:24:59 -07:00
Jose Diaz-Gonzalez
a92687d3e8 fix: correct calls to fetch process-specific build and deploy args 2019-05-17 12:00:05 -04:00
Jose Diaz-Gonzalez
bc70a24e1d fix: handle case where image is null on first deploy 2019-05-12 07:37:21 -04:00
Jose Diaz-Gonzalez
5373cf2989 refactor: allow the scheduler to decide if an app is deployed
Without moving this to the scheduler, all applications are assumed to not be deployed unless the scheduler is set to docker-local.

Closes #3531
2019-05-10 17:47:39 -04:00
Jose Diaz-Gonzalez
662c8c2831 refactor: move log retrieval to docker-local scheduler
This change will allow other schedulers to implement log retrieval as necessary for the platform specified.

Closes #3487
2019-04-17 15:03:37 -04:00
Jose Diaz-Gonzalez
243d5ecc43 feat: integrate resource plugin with scheduler-docker-local 2019-04-08 11:31:34 -04:00
Jose Diaz-Gonzalez
ef5a45c7cb feat: add DOKKU_QUIET_OUTPUT=1 to all config_set/config_unset calls
This makes build output a bit more digestable.
2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
7f1fe3ccfd chore: follow logging pattern from heroku for phase command declarations 2019-03-13 02:05:18 -04:00
Jose Diaz-Gonzalez
acbe8fa805 fix: Only override the WORKDIR in copy_from_image if the image is gliderlabs/herokuish based
Rather than always assuming a missing `WORKDIR` means herokuish, we instead inspect the image to verify that it is. If it is, then and _only_ then do we set WORKDIR. Otherwise, we respect the decision of `docker cp` to execute from within the last known `WORKDIR` context, which is inherited at the image level, not image metadata level.

Additionally, speed up `is_image_herokuish_based` by inspecting the environment variables on the image. When there is a "USER=herokuishuser", we can more or less safely assume it is an image that Dokku built, and is therefore a herokuish image. While possible, it would be very strange if a non-herokuish image had this environment variable set, so it is a relatively safe change.
2019-03-11 20:09:13 -04:00
Jose Diaz-Gonzalez
c7b71b5d92 lint: remove unnecessary negation
Also use double-brackets where possible.

Fixes SC2236
2019-02-02 13:52:18 -05:00
Jose Diaz-Gonzalez
67ae374e60 lint: remove whitespaces before redirect 2019-02-02 13:49:24 -05:00