From 27d3eb801ea8c31661c9bd9613ffe70f6d4aa817 Mon Sep 17 00:00:00 2001 From: Aaron Lehmann Date: Fri, 11 Nov 2016 11:24:34 -0800 Subject: [PATCH] api: Centralize defaults and add InsertDefaults flag Currently, there is a problem with visibility of defaults. The best way to create a service is to only specify fields that you care about, because then the manager can apply appropriate defaults for the other fields. However, there's no way to know which values are actually being used for those fields. The spec is under the user's control, so if they don't specify a value (for example, `Spec.Task.Restart.Delay`), this field will show up as blank when the service is retrieved. We don't want to break the spec ownership model, but we do want a way to communicate actual values in use back to the client. For this, we add an `InsertDefaults` flag to the ControlAPI which allows fetching a version of the service with defaults inserted into empty fields. This also has the benefit of centralizing defaults. Default values for these fields that were defined in various places around the code are now centralized in `github.com/docker/swarmkit/api/defaults`. Right now this flag is only is only available for `Service`, but as we encounter situations where other objects have default values which need to be exposed, we should add this to other objects as well. Signed-off-by: Aaron Lehmann --- api/control.pb.go | 278 +++++++++++++----------- api/control.proto | 1 + api/defaults/service.go | 83 +++++++ manager/controlapi/service.go | 5 + manager/orchestrator/restart/restart.go | 5 +- manager/orchestrator/task.go | 4 - manager/orchestrator/taskinit/init.go | 6 +- manager/orchestrator/update/updater.go | 19 +- 8 files changed, 260 insertions(+), 141 deletions(-) create mode 100644 api/defaults/service.go diff --git a/api/control.pb.go b/api/control.pb.go index 053f1b39fb..8d57b49be7 100644 --- a/api/control.pb.go +++ b/api/control.pb.go @@ -234,7 +234,8 @@ func (*CreateServiceResponse) ProtoMessage() {} func (*CreateServiceResponse) Descriptor() ([]byte, []int) { return fileDescriptorControl, []int{15} } type GetServiceRequest struct { - ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + ServiceID string `protobuf:"bytes,1,opt,name=service_id,json=serviceId,proto3" json:"service_id,omitempty"` + InsertDefaults bool `protobuf:"varint,2,opt,name=insert_defaults,json=insertDefaults,proto3" json:"insert_defaults,omitempty"` } func (m *GetServiceRequest) Reset() { *m = GetServiceRequest{} } @@ -3604,6 +3605,16 @@ func (m *GetServiceRequest) MarshalTo(dAtA []byte) (int, error) { i = encodeVarintControl(dAtA, i, uint64(len(m.ServiceID))) i += copy(dAtA[i:], m.ServiceID) } + if m.InsertDefaults { + dAtA[i] = 0x10 + i++ + if m.InsertDefaults { + dAtA[i] = 1 + } else { + dAtA[i] = 0 + } + i++ + } return i, nil } @@ -6105,6 +6116,9 @@ func (m *GetServiceRequest) Size() (n int) { if l > 0 { n += 1 + l + sovControl(uint64(l)) } + if m.InsertDefaults { + n += 2 + } return n } @@ -6833,6 +6847,7 @@ func (this *GetServiceRequest) String() string { } s := strings.Join([]string{`&GetServiceRequest{`, `ServiceID:` + fmt.Sprintf("%v", this.ServiceID) + `,`, + `InsertDefaults:` + fmt.Sprintf("%v", this.InsertDefaults) + `,`, `}`, }, "") return s @@ -9448,6 +9463,26 @@ func (m *GetServiceRequest) Unmarshal(dAtA []byte) error { } m.ServiceID = string(dAtA[iNdEx:postIndex]) iNdEx = postIndex + case 2: + if wireType != 0 { + return fmt.Errorf("proto: wrong wireType = %d for field InsertDefaults", wireType) + } + var v int + for shift := uint(0); ; shift += 7 { + if shift >= 64 { + return ErrIntOverflowControl + } + if iNdEx >= l { + return io.ErrUnexpectedEOF + } + b := dAtA[iNdEx] + iNdEx++ + v |= (int(b) & 0x7F) << shift + if b < 0x80 { + break + } + } + m.InsertDefaults = bool(v != 0) default: iNdEx = preIndex skippy, err := skipControl(dAtA[iNdEx:]) @@ -13463,124 +13498,125 @@ var ( func init() { proto.RegisterFile("control.proto", fileDescriptorControl) } var fileDescriptorControl = []byte{ - // 1894 bytes of a gzipped FileDescriptorProto - 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x5a, 0x4f, 0x6f, 0xdb, 0x46, - 0x16, 0xb7, 0xfe, 0xd8, 0x92, 0x9e, 0x2c, 0xd9, 0x1e, 0x2b, 0x59, 0x41, 0xc9, 0xda, 0x06, 0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d, - 0x8f, 0x0b, 0x82, 0x20, 0x2e, 0xc8, 0x27, 0xfb, 0xd0, 0x33, 0x33, 0x67, 0x75, 0xe4, 0x63, 0xd0, - 0xea, 0x28, 0x9e, 0xa2, 0x94, 0x3b, 0x62, 0x75, 0x63, 0xbb, 0xb6, 0xd7, 0xe1, 0xf6, 0xae, 0xbc, - 0x8d, 0x33, 0x11, 0x21, 0x83, 0x67, 0x10, 0x11, 0xb7, 0xd9, 0xb0, 0x88, 0xfc, 0x78, 0x81, 0x22, - 0x22, 0x8b, 0x4c, 0x2a, 0x22, 0x1b, 0x90, 0x36, 0xb1, 0x71, 0xac, 0x35, 0x08, 0x3b, 0x98, 0x88, - 0xf0, 0x10, 0x76, 0xd9, 0x70, 0xb5, 0x62, 0xaa, 0xc0, 0x21, 0xd5, 0xa6, 0x89, 0x56, 0x21, 0xc9, - 0xb9, 0xc4, 0xd4, 0x22, 0xb5, 0x99, 0xee, 0x9f, 0x2e, 0x27, 0x18, 0x99, 0x4c, 0x35, 0xc1, 0xd8, - 0x64, 0xa2, 0x0a, 0x64, 0x9b, 0xd8, 0xd4, 0x0c, 0xdc, 0xac, 0x99, 0x56, 0xdd, 0xe2, 0xfa, 0x90, - 0x2d, 0xff, 0xd1, 0x2f, 0xc5, 0xbb, 0x04, 0xa5, 0x66, 0xb8, 0x11, 0x7d, 0x93, 0x88, 0x4c, 0x62, - 0x58, 0x64, 0xd0, 0x55, 0x80, 0x5e, 0xb7, 0x66, 0xe9, 0x35, 0x72, 0x76, 0xf2, 0x49, 0x4a, 0xdf, - 0x64, 0xaf, 0xbb, 0xa7, 0x57, 0xea, 0x16, 0x46, 0x05, 0x48, 0x1a, 0xbd, 0x8e, 0xa5, 0x91, 0xdd, - 0x4f, 0x51, 0x6b, 0xfb, 0x7d, 0x02, 0xf2, 0xc4, 0x37, 0xda, 0x91, 0x27, 0xc2, 0xb7, 0x40, 0x79, - 0xa2, 0x04, 0x64, 0x30, 0x65, 0x1b, 0x72, 0x5b,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0xfa, 0xe1, 0xfd, - 0xd2, 0xd4, 0xc7, 0xfd, 0xa5, 0xc8, 0xbb, 0xfe, 0x52, 0xe4, 0xfb, 0xfe, 0x52, 0xe4, 0xa7, 0xfe, - 0x52, 0xe4, 0x60, 0x86, 0xfe, 0x97, 0x9a, 0x5b, 0xbf, 0x05, 0x00, 0x00, 0xff, 0xff, 0x35, 0xa6, - 0x7d, 0x8d, 0xcb, 0x23, 0x00, 0x00, + // 1917 bytes of a gzipped FileDescriptorProto + 0x1f, 0x8b, 0x08, 0x00, 0x00, 0x09, 0x6e, 0x88, 0x02, 0xff, 0xcc, 0x5a, 0x4f, 0x6f, 0x1b, 0x41, + 0x15, 0x8f, 0xff, 0x24, 0xb6, 0x9f, 0x63, 0x27, 0x99, 0xb8, 0xc5, 0x72, 0x4b, 0x12, 0x6d, 0x69, + 0xe2, 0xa0, 0xe0, 0x50, 0x97, 0x8a, 0x52, 0xc4, 0x9f, 0x26, 0x6e, 0x8b, 0x9b, 0x36, 0xad, 0x36, + 0x49, 0xc5, 0xcd, 0xda, 0xd8, 0x93, 0xb0, 0xb5, 0xe3, 0x35, 0xbb, 0xeb, 0xb4, 0x11, 0x17, 0x40, + 0xe5, 0x23, 0x20, 0x71, 0xe5, 0x0a, 0x12, 0x07, 0x4e, 0xfd, 0x08, 0x15, 0x27, 0x8e, 0x48, 0x48, + 0x11, 0xb5, 0x84, 0xc4, 0x89, 0xcf, 0x80, 0xe6, 0xdf, 0xee, 0x7a, 0x3d, 0xbb, 0x6b, 0x27, 0x96, + 0xc2, 0xa9, 0xde, 0xd9, 0xdf, 0x9b, 0xf7, 0x66, 0xde, 0x6f, 0x7e, 0xfb, 0xe6, 0xa5, 0x90, 0x6b, + 0x1a, 0x5d, 0xdb, 0x34, 0x3a, 0x95, 0x9e, 0x69, 0xd8, 0x06, 0x42, 0x2d, 0xa3, 0xd9, 0xc6, 0x66, + 0xc5, 0xfa, 0xa0, 0x99, 0x67, 0x6d, 0xdd, 0xae, 0x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x17, 0x19, 0x82, 0x24, 0xd9, 0x69, 0xbe, 0x5f, + 0xf4, 0x37, 0x21, 0x39, 0xb7, 0x21, 0x24, 0x8f, 0xbb, 0x24, 0xe7, 0xb6, 0x84, 0xe4, 0x1c, 0x50, + 0x6f, 0x71, 0xf1, 0x9b, 0x52, 0x8c, 0x3f, 0x17, 0xe7, 0x6e, 0xea, 0x61, 0x3a, 0x67, 0xd1, 0x17, + 0xa9, 0xf2, 0x9f, 0x38, 0x3b, 0x8b, 0x7c, 0xfc, 0x0a, 0x67, 0xd1, 0x67, 0x39, 0x7a, 0x16, 0x7f, + 0x77, 0x83, 0x67, 0x31, 0x20, 0xb8, 0x2b, 0x9f, 0xc5, 0x29, 0x9c, 0x37, 0x37, 0x24, 0xf7, 0xbc, + 0xf1, 0x44, 0x85, 0x9e, 0x37, 0x91, 0x39, 0x07, 0xac, 0x3c, 0xa5, 0x94, 0xde, 0xed, 0xf4, 0x2d, + 0x1b, 0x9b, 0x1e, 0x8d, 0x6e, 0xb2, 0x11, 0x9f, 0x46, 0x73, 0x1c, 0xe1, 0x05, 0x07, 0x38, 0xf4, + 0x75, 0xa6, 0x70, 0xe9, 0xcb, 0x21, 0x61, 0xf4, 0x15, 0x56, 0x02, 0xeb, 0x70, 0x89, 0xbf, 0xb8, + 0x02, 0x97, 0x7c, 0x96, 0xff, 0x5f, 0x5c, 0x0a, 0x08, 0xee, 0x26, 0xb9, 0xe4, 0x86, 0xe4, 0x72, + 0x89, 0x67, 0x23, 0x94, 0x4b, 0x22, 0x75, 0x0e, 0x58, 0xf9, 0x7d, 0x0c, 0xb2, 0x7b, 0xf8, 0x42, + 0x35, 0x6c, 0xcd, 0x26, 0xa5, 0xcf, 0xb7, 0x61, 0x89, 0x90, 0x0c, 0x9b, 0x8d, 0xf7, 0x86, 0xde, + 0x6d, 0xd8, 0x46, 0x1b, 0x77, 0x69, 0x68, 0x69, 0x75, 0x81, 0xbd, 0x78, 0x69, 0xe8, 0xdd, 0x43, + 0x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x84, 0x83, 0xf3, 0xec, 0xbf, 0x9e, 0x46, 0x9e, 0x67, 0xb1, 0xe0, 0x90, 0xf3, 0xec, + 0x5b, 0xf3, 0xe6, 0x18, 0xc8, 0xc8, 0x8f, 0x93, 0x73, 0x9b, 0x91, 0x7f, 0x9c, 0xfc, 0x77, 0xa5, + 0xd2, 0xfd, 0x08, 0x54, 0xe4, 0x3e, 0x7b, 0xaf, 0x0e, 0xf2, 0x7d, 0x96, 0x5c, 0x8b, 0x4a, 0xe5, + 0x68, 0x60, 0xb8, 0xe7, 0x3e, 0x64, 0x3d, 0x05, 0x30, 0x5a, 0x1f, 0xaf, 0x66, 0x2f, 0x6d, 0x44, + 0xe2, 0x22, 0x17, 0xec, 0xad, 0x6f, 0xe5, 0x0b, 0x96, 0x14, 0xd3, 0xa5, 0x72, 0x34, 0x30, 0xd2, + 0xb3, 0xb7, 0x96, 0x95, 0x7b, 0x96, 0xd4, 0xcb, 0xa5, 0x72, 0x34, 0x30, 0xd4, 0xf3, 0x4e, 0xf1, + 0xcb, 0xd7, 0x95, 0x99, 0x7f, 0x7c, 0x5d, 0x99, 0xf9, 0xf5, 0x60, 0x25, 0xf6, 0x65, 0xb0, 0x12, + 0xfb, 0xfb, 0x60, 0x25, 0xf6, 0xaf, 0xc1, 0x4a, 0xec, 0x78, 0x8e, 0xfe, 0xdf, 0x9b, 0x87, 0xff, + 0x0b, 0x00, 0x00, 0xff, 0xff, 0x3b, 0x09, 0x33, 0xa6, 0xf4, 0x23, 0x00, 0x00, } diff --git a/api/control.proto b/api/control.proto index 1de94fc6db..9c84e3f256 100644 --- a/api/control.proto +++ b/api/control.proto @@ -217,6 +217,7 @@ message CreateServiceResponse { message GetServiceRequest { string service_id = 1; + bool insert_defaults = 2; } message GetServiceResponse { diff --git a/api/defaults/service.go b/api/defaults/service.go new file mode 100644 index 0000000000..ecc5fc7f1a --- /dev/null +++ b/api/defaults/service.go @@ -0,0 +1,83 @@ +package defaults + +import ( + "time" + + "github.com/docker/swarmkit/api" + "github.com/docker/swarmkit/api/deepcopy" + gogotypes "github.com/gogo/protobuf/types" +) + +// Service is a ServiceSpec object with all fields filled in using default +// values. +var Service = api.ServiceSpec{ + Task: api.TaskSpec{ + Runtime: &api.TaskSpec_Container{ + Container: &api.ContainerSpec{ + StopGracePeriod: gogotypes.DurationProto(10 * time.Second), + PullOptions: &api.ContainerSpec_PullOptions{}, + DNSConfig: &api.ContainerSpec_DNSConfig{}, + }, + }, + Resources: &api.ResourceRequirements{}, + Restart: &api.RestartPolicy{ + Delay: gogotypes.DurationProto(5 * time.Second), + }, + Placement: &api.Placement{}, + }, + Update: &api.UpdateConfig{ + FailureAction: api.UpdateConfig_PAUSE, + Monitor: gogotypes.DurationProto(5 * time.Second), + Parallelism: 1, + Order: api.UpdateConfig_STOP_FIRST, + }, +} + +// InterpolateService returns a ServiceSpec based on the provided spec, which +// has all unspecified values filled in with default values. +func InterpolateService(origSpec *api.ServiceSpec) *api.ServiceSpec { + spec := origSpec.Copy() + + container := spec.Task.GetContainer() + defaultContainer := Service.Task.GetContainer() + if container != nil { + if container.StopGracePeriod == nil { + container.StopGracePeriod = &gogotypes.Duration{} + deepcopy.Copy(container.StopGracePeriod, defaultContainer.StopGracePeriod) + } + if container.PullOptions == nil { + container.PullOptions = defaultContainer.PullOptions.Copy() + } + if container.DNSConfig == nil { + container.DNSConfig = defaultContainer.DNSConfig.Copy() + } + } + + if spec.Task.Resources == nil { + spec.Task.Resources = Service.Task.Resources.Copy() + } + + if spec.Task.Restart == nil { + spec.Task.Restart = Service.Task.Restart.Copy() + } else { + if spec.Task.Restart.Delay == nil { + spec.Task.Restart.Delay = &gogotypes.Duration{} + deepcopy.Copy(spec.Task.Restart.Delay, Service.Task.Restart.Delay) + } + } + + if spec.Task.Placement == nil { + spec.Task.Placement = Service.Task.Placement.Copy() + } + + if spec.Update == nil { + spec.Update = Service.Update.Copy() + } else { + if spec.Update.Monitor == nil { + spec.Update.Monitor = &gogotypes.Duration{} + deepcopy.Copy(spec.Update.Monitor, Service.Update.Monitor) + } + } + + return spec +} diff --git a/manager/controlapi/service.go b/manager/controlapi/service.go index c6f8220898..29d3d9a8fa 100644 --- a/manager/controlapi/service.go +++ b/manager/controlapi/service.go @@ -10,6 +10,7 @@ import ( "github.com/docker/distribution/reference" "github.com/docker/swarmkit/api" + "github.com/docker/swarmkit/api/defaults" "github.com/docker/swarmkit/api/naming" "github.com/docker/swarmkit/identity" "github.com/docker/swarmkit/manager/allocator" @@ -525,6 +526,10 @@ func (s *Server) GetService(ctx context.Context, request *api.GetServiceRequest) return nil, grpc.Errorf(codes.NotFound, "service %s not found", request.ServiceID) } + if request.InsertDefaults { + service.Spec = *defaults.InterpolateService(&service.Spec) + } + return &api.GetServiceResponse{ Service: service, }, nil diff --git a/manager/orchestrator/restart/restart.go b/manager/orchestrator/restart/restart.go index 58af5f216d..d10d825302 100644 --- a/manager/orchestrator/restart/restart.go +++ b/manager/orchestrator/restart/restart.go @@ -8,6 +8,7 @@ import ( "github.com/docker/go-events" "github.com/docker/swarmkit/api" + "github.com/docker/swarmkit/api/defaults" "github.com/docker/swarmkit/log" "github.com/docker/swarmkit/manager/orchestrator" "github.com/docker/swarmkit/manager/state" @@ -159,10 +160,10 @@ func (r *Supervisor) Restart(ctx context.Context, tx store.Tx, cluster *api.Clus restartDelay, err = gogotypes.DurationFromProto(t.Spec.Restart.Delay) if err != nil { log.G(ctx).WithError(err).Error("invalid restart delay; using default") - restartDelay = orchestrator.DefaultRestartDelay + restartDelay, _ = gogotypes.DurationFromProto(defaults.Service.Task.Restart.Delay) } } else { - restartDelay = orchestrator.DefaultRestartDelay + restartDelay, _ = gogotypes.DurationFromProto(defaults.Service.Task.Restart.Delay) } } diff --git a/manager/orchestrator/task.go b/manager/orchestrator/task.go index a6af9f6de1..565cf53d3b 100644 --- a/manager/orchestrator/task.go +++ b/manager/orchestrator/task.go @@ -9,10 +9,6 @@ import ( "github.com/docker/swarmkit/protobuf/ptypes" ) -// DefaultRestartDelay is the restart delay value to use when none is -// specified. -const DefaultRestartDelay = 5 * time.Second - // NewTask creates a new task. func NewTask(cluster *api.Cluster, service *api.Service, slot uint64, nodeID string) *api.Task { var logDriver *api.Driver diff --git a/manager/orchestrator/taskinit/init.go b/manager/orchestrator/taskinit/init.go index dc227fa625..09ff9d75d0 100644 --- a/manager/orchestrator/taskinit/init.go +++ b/manager/orchestrator/taskinit/init.go @@ -4,8 +4,8 @@ import ( "time" "github.com/docker/swarmkit/api" + "github.com/docker/swarmkit/api/defaults" "github.com/docker/swarmkit/log" - "github.com/docker/swarmkit/manager/orchestrator" "github.com/docker/swarmkit/manager/orchestrator/restart" "github.com/docker/swarmkit/manager/state/store" gogotypes "github.com/gogo/protobuf/types" @@ -55,13 +55,13 @@ func CheckTasks(ctx context.Context, s *store.MemoryStore, readTx store.ReadTx, if t.DesiredState != api.TaskStateReady || t.Status.State > api.TaskStateRunning { continue } - restartDelay := orchestrator.DefaultRestartDelay + restartDelay, _ := gogotypes.DurationFromProto(defaults.Service.Task.Restart.Delay) if t.Spec.Restart != nil && t.Spec.Restart.Delay != nil { var err error restartDelay, err = gogotypes.DurationFromProto(t.Spec.Restart.Delay) if err != nil { log.G(ctx).WithError(err).Error("invalid restart delay") - restartDelay = orchestrator.DefaultRestartDelay + restartDelay, _ = gogotypes.DurationFromProto(defaults.Service.Task.Restart.Delay) } } if restartDelay != 0 { diff --git a/manager/orchestrator/update/updater.go b/manager/orchestrator/update/updater.go index bf331df8fc..b69a881ed0 100644 --- a/manager/orchestrator/update/updater.go +++ b/manager/orchestrator/update/updater.go @@ -11,6 +11,7 @@ import ( "github.com/docker/go-events" "github.com/docker/swarmkit/api" + "github.com/docker/swarmkit/api/defaults" "github.com/docker/swarmkit/log" "github.com/docker/swarmkit/manager/orchestrator" "github.com/docker/swarmkit/manager/orchestrator/restart" @@ -21,8 +22,6 @@ import ( gogotypes "github.com/gogo/protobuf/types" ) -const defaultMonitor = 5 * time.Second - // Supervisor supervises a set of updates. It's responsible for keeping track of updates, // shutting them down and replacing them. type Supervisor struct { @@ -156,14 +155,12 @@ func (u *Updater) Run(ctx context.Context, slots []orchestrator.Slot) { u.startUpdate(ctx, service.ID) } - var ( - parallelism = 1 - delay time.Duration - failureAction = api.UpdateConfig_PAUSE - allowedFailureFraction = float32(0) - monitoringPeriod = defaultMonitor - order = api.UpdateConfig_STOP_FIRST - ) + delay := defaults.Service.Update.Delay + parallelism := int(defaults.Service.Update.Parallelism) + failureAction := defaults.Service.Update.FailureAction + allowedFailureFraction := defaults.Service.Update.MaxFailureRatio + monitoringPeriod, _ := gogotypes.DurationFromProto(defaults.Service.Update.Monitor) + order := defaults.Service.Update.Order updateConfig := service.Spec.Update if service.UpdateStatus != nil && service.UpdateStatus.State == api.UpdateStatus_ROLLBACK_STARTED { @@ -181,7 +178,7 @@ func (u *Updater) Run(ctx context.Context, slots []orchestrator.Slot) { if updateConfig.Monitor != nil { monitoringPeriod, err = gogotypes.DurationFromProto(updateConfig.Monitor) if err != nil { - monitoringPeriod = defaultMonitor + monitoringPeriod, _ = gogotypes.DurationFromProto(defaults.Service.Update.Monitor) } } }