You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -92,7 +92,7 @@ You can configure the most behaviors of *Gantry* via environment variables.
92
92
| GANTRY_ROLLBACK_OPTIONS ||[Options](https://docs.docker.com/engine/reference/commandline/service_update/#options) added to the `docker service update --rollback` command for all services. You can apply a different value to a particular service via [labels](#labels). |
93
93
| GANTRY_UPDATE_JOBS | false | Set to `true` to update `replicated-job` or `global-job`. Set to `false` to disable updating jobs. *Gantry* adds additional options to `docker service update` when there is [no running tasks](docs/faq.md#how-to-update-services-with-no-running-tasks). You can apply a different value to a particular service via [labels](#labels). |
94
94
| GANTRY_UPDATE_NUM_WORKERS | 1 | The maximum number of updates that can run in parallel. |
95
-
| GANTRY_UPDATE_OPTIONS ||[Options](https://docs.docker.com/engine/reference/commandline/service_update/#options) added to the `docker service update` command for all services. You can apply a different value to a particular service via [labels](#labels). |
95
+
| GANTRY_UPDATE_OPTIONS ||[Options](https://docs.docker.com/engine/reference/commandline/service_update/#options) added to the `docker service update` command for all services. This also overrides any automatically added options. You can apply a different value to a particular service via [labels](#labels). |
96
96
| GANTRY_UPDATE_TIMEOUT_SECONDS | 0 | Error out if updating of a single service takes longer than the given time. Set to `0` to disable timeout. You can apply a different value to a particular service via [labels](#labels). |
Copy file name to clipboardExpand all lines: docs/faq.md
+4-2Lines changed: 4 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -26,9 +26,11 @@ You can start *Gantry* as a docker swarm service and use [`swarm-cronjob`](https
26
26
27
27
## How to update services with no running tasks?
28
28
29
-
As discussed in [docker/cli/issues/627](https://github.com/docker/cli/issues/627), the CLI will hang when running `docker service update` on a service with no running tasks. We must add`--detach=true`option to the `docker service update`.
29
+
As discussed in [docker/cli/issues/627](https://github.com/docker/cli/issues/627), the Docker CLI hangs when `docker service update`is running on a service with no running tasks, requiring the option`--detach=true` to be added.
30
30
31
-
*Gantry* will check whether there are running tasks in a service. If there is no running task, *Gantry* automatically adds the option `--detach=true`. In addition to the detach option, *Gantry* also adds `--replicas=0` for services in replicated mode. You don't need to add these options manually.
31
+
*Gantry* checks whether a service has running tasks. When none are found, it automatically adds the option `--detach=true`.
32
+
33
+
If you want to keep replicas at zero post-update, which prevents tasks from starting, you should add the [label](../README.md#labels)`gantry.update.options=--replicas=0` to the service. See the [example](../examples/cronjob).
Copy file name to clipboardExpand all lines: examples/cronjob/README.md
+2Lines changed: 2 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,3 +5,5 @@ Use [*swarm-cronjob*](https://github.com/crazy-max/swarm-cronjob) to launch [*Ga
5
5
In this example, we only want to run *Gantry* at the specific time, therefore we set `replicas` to `0` on the *Gantry* service to avoid running it as soon as the service is deployed. We also need to set `restart_policy.condition` to `none` to prevent *Gantry* from restarting automatically after a cronjob.
6
6
7
7
Refer to the [*swarm-cronjob* document](https://crazymax.dev/swarm-cronjob/) for more information.
8
+
9
+
*service_to_be_updated* is another service managed by the *swarm-cronjob* and updated by *Gantry*. The label `gantry.update.options=--replicas=0` is set on the service so that only *swarm-cronjob* starts it. Updating the image does not start the service.
0 commit comments