Commit Graph

12 Commits

Author SHA1 Message Date
Drew Erny 30d9fe30b1 Add swarm jobs
Adds support for ReplicatedJob and GlobalJob service modes. These modes
allow running service which execute tasks that exit upon success,
instead of daemon-type tasks.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2020-01-13 13:21:12 -06:00
Drew Erny f36042d259 Add support for sending down service Running and Desired task counts
Adds a new ServiceStatus field to the Service object, which includes the
running and desired task counts. This new field is gated behind a
"status" query parameter.

Signed-off-by: Drew Erny <drew.erny@docker.com>
2019-10-14 10:43:00 -05:00
Daniel Nephin 4f0d95fa6e Add canonical import comment
Signed-off-by: Daniel Nephin <dnephin@docker.com>
2018-02-05 16:51:57 -05:00
Aaron Lehmann 9b54994a8a Add support for update order
This parameter controls the order of operations when rolling out an
update task. Either the old task is stopped before starting the new one,
or the new task is started first, and the running tasks will briefly
overlap.

This commit adds Rollout to the API, and --update-order / --rollback-order
flags to the CLI.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-04-06 17:23:36 -07:00
Aaron Lehmann 3a88a24d23 Add support for rollback flags
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Aaron Lehmann cc9d04647a Add support for the "rollback" failure action
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2017-03-03 16:33:34 -08:00
Aaron Lehmann 0e70d96a68 api: Hide UpdateStatus when it is not present
When UpdateStatus was not present, the empty values of the timestamps
would be present:

        "UpdateStatus": {
            "StartedAt": "0001-01-01T00:00:00Z",
            "CompletedAt": "0001-01-01T00:00:00Z"
        }

To fix this, make the timestamps pointers, so they can be set to nil
when they should not be shown.

Also make UpdateStatus itself a pointer, so an empty object does not
show up when there is no UpdateStatus.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-12-01 15:08:41 -08:00
Aaron Lehmann d8b8b12994 api: Remove omitempty tag on Parallelism
It doesn't make sense to use omitempty here. 0 is a meaningful value and
it's different from the default. If someone sets Parallelism to 0, we
want to show that Parallelism is 0, not hide the field.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-11-16 16:21:25 -08:00
Aaron Lehmann 6d4b527699 Service update failure thresholds and rollback
This adds support for two enhancements to swarm service rolling updates:

- Failure thresholds: In Docker 1.12, a service update could be set up
  to either pause or continue after a single failure occurs. This adds
  an --update-max-failure-ratio flag that controls how many tasks need to
  fail to update for the update as a whole to be considered a failure. A
  counterpart flag, --update-monitor, controls how long to monitor each
  task for a failure after starting it during the update.

- Rollback flag: service update --rollback reverts the service to its
  previous version. If a service update encounters task failures, or
  fails to function properly for some other reason, the user can roll back
  the update.

SwarmKit also has the ability to roll back updates automatically after
hitting the failure thresholds, but we've decided not to expose this in
the Docker API/CLI for now, favoring a workflow where the decision to
roll back is always made by an admin. Depending on user feedback, we may
add a "rollback" option to --update-failure-action in the future.

Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-18 10:09:50 -07:00
Aaron Lehmann 67bebd6d81 API changes for service rollback and failure threshold
Signed-off-by: Aaron Lehmann <aaron.lehmann@docker.com>
2016-10-18 10:09:30 -07:00
Sebastiaan van Stijn 45818d6fc4
Removed engine-api leftovers
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2016-09-21 12:36:52 +02:00
Michael Crosby 91e197d614 Add engine-api types to docker
This moves the types for the `engine-api` repo to the existing types
package.

Signed-off-by: Michael Crosby <crosbymichael@gmail.com>
2016-09-07 11:05:58 -07:00