feat: add parallelism to certain proxy commands

Closes #4392
This commit is contained in:
Jose Diaz-Gonzalez
2021-02-19 23:44:41 -05:00
parent 5141360b48
commit 04a96125cc
5 changed files with 103 additions and 42 deletions

View File

@@ -0,0 +1,5 @@
# 0.23.0 Migration Guide
## Changes
- The commands `proxy:enable`, `proxy:disable` and `proxy:build-config` now support the `--all` flag in addition to general parallelism.

View File

@@ -3,11 +3,11 @@
> New as of 0.5.0, Enhanced in 0.6.0
```
proxy:build-config <app> # (Re)builds config for given app
proxy:disable <app> # Disable proxy for app
proxy:enable <app> # Enable proxy for app
proxy:report [<app>] [<flag>] # Displays a proxy report for one or more apps
proxy:set <app> <proxy-type> # Set proxy type for app
proxy:build-config [--parallel count] [--all|<app>] # (Re)builds config for given app
proxy:disable [--parallel count] [--all|<app>] # Disable proxy for app
proxy:enable [--parallel count] [--all|<app>] # Enable proxy for app
proxy:report [<app>] [<flag>] # Displays a proxy report for one or more apps
proxy:set <app> <proxy-type> # Set proxy type for app
```
In Dokku 0.5.0, port proxying was decoupled from the `nginx-vhosts` plugin into the proxy plugin. Dokku 0.6.0 introduced the ability to map host ports to specific container ports. In the future this will allow other proxy software - such as HAProxy or Caddy - to be used in place of nginx.
@@ -22,11 +22,23 @@ In certain cases, your app proxy configs may drift from the correct config for y
dokku proxy:build-config node-js-app
```
### Container network interface binding
All apps may have their proxy config rebuilt by using the `--all` flag.
> Changed as of 0.11.0
```shell
dokku proxy:build-config --all
```
From Dokku versions `0.5.0` until `0.11.0`, enabling or disabling an application's proxy would **also** control whether or not the application was bound to all interfaces - e.g. `0.0.0.0`. As of `0.11.0`, this is now controlled by the network plugin. Please see the [network documentation](/docs/networking/network.md#container-network-interface-binding) for more information.
By default, rebuilding proxy configs for all apps happens serially. The parallelism may be controlled by the `--parallel` flag.
```shell
dokku proxy:build-config --all --parallel 2
```
Finally, the number of parallel workers may be automatically set to the number of CPUs available by setting the `--parallel` flag to `-1`
```shell
dokku proxy:build-config --all --parallel -1
```
### Displaying proxy reports for an app
@@ -94,3 +106,9 @@ dokku proxy:set node-js-app nginx
### Proxy port mapping
See the [port management documentation](/docs/networking/port-management.md) for more information on how port mappings are managed for an application.
### Container network interface binding
> Changed as of 0.11.0
From Dokku versions `0.5.0` until `0.11.0`, enabling or disabling an application's proxy would **also** control whether or not the application was bound to all interfaces - e.g. `0.0.0.0`. As of `0.11.0`, this is now controlled by the network plugin. Please see the [network documentation](/docs/networking/network.md#container-network-interface-binding) for more information.