Making SLA-Aware to plain Drain timeout configurable.

Upgraded Dockerbuild for debian package to use go1.12.1
This commit is contained in:
Renan DelValle 2019-03-22 19:01:10 -07:00
parent 0f19631c9a
commit fee20090d0
No known key found for this signature in database
GPG key ID: C240AD6D6F443EC9
6 changed files with 24 additions and 11 deletions

View file

@ -1,3 +1,7 @@
0.0.8
* Upgraded default timeouts and durations for sla-aware draining.
0.0.7
* Initial migration to gorealis v2

View file

@ -31,9 +31,9 @@ var message = new(string)
var updateID string
var log = logrus.New()
const australisVer = "v0.0.7"
const australisVer = "v0.0.8"
var monitorInterval, monitorTimeout time.Duration
var monitorInterval, monitorTimeout, forceDrainTimeout time.Duration
func init() {

View file

@ -23,18 +23,20 @@ func init() {
startSLADrainCmd.AddCommand(startSLACountDrainCmd)
// SLA Maintenance specific flags
startSLACountDrainCmd.Flags().DurationVar(&monitorInterval, "interval", time.Second*5, "Interval at which to poll scheduler.")
startSLACountDrainCmd.Flags().DurationVar(&monitorInterval, "interval", time.Second*10, "Interval at which to poll scheduler.")
startSLACountDrainCmd.Flags().DurationVar(&monitorTimeout, "timeout", time.Minute*20, "Time after which the monitor will stop polling and throw an error.")
startSLACountDrainCmd.Flags().Int64Var(&count, "count", 5, "Instances count that should be running to meet SLA.")
startSLACountDrainCmd.Flags().DurationVar(&duration, "duration", time.Minute*10, "Window of time from which we derive the SLA.")
startSLACountDrainCmd.Flags().DurationVar(&duration, "duration", time.Second*45, "Minimum time duration a task needs to be `RUNNING` to be treated as active.")
startSLACountDrainCmd.Flags().DurationVar(&forceDrainTimeout, "sla-limit", time.Minute*60, "Time limit after which SLA-Aware drain sheds SLA Awareness.")
startSLADrainCmd.AddCommand(startSLAPercentageDrainCmd)
// SLA Maintenance specific flags
startSLAPercentageDrainCmd.Flags().DurationVar(&monitorInterval, "interval", time.Second*5, "Interval at which to poll scheduler.")
startSLAPercentageDrainCmd.Flags().DurationVar(&monitorTimeout, "timeout", time.Minute*1, "Time after which the monitor will stop polling and throw an error.")
startSLAPercentageDrainCmd.Flags().DurationVar(&monitorInterval, "interval", time.Second*10, "Interval at which to poll scheduler.")
startSLAPercentageDrainCmd.Flags().DurationVar(&monitorTimeout, "timeout", time.Minute*20, "Time after which the monitor will stop polling and throw an error.")
startSLAPercentageDrainCmd.Flags().Float64Var(&percent, "percent", 75.0, "Percentage of instances that should be running to meet SLA.")
startSLAPercentageDrainCmd.Flags().DurationVar(&duration, "duration", time.Minute*10, "Window of time from which we derive the SLA.")
startSLAPercentageDrainCmd.Flags().DurationVar(&duration, "duration", time.Second*45, "Minimum time duration a task needs to be `RUNNING` to be treated as active.")
startSLAPercentageDrainCmd.Flags().DurationVar(&forceDrainTimeout, "sla-limit", time.Minute*60, "Time limit after which SLA-Aware drain sheds SLA Awareness.")
startCmd.AddCommand(startMaintenanceCmd)
@ -122,7 +124,7 @@ func drain(cmd *cobra.Command, args []string) {
func slaDrain(policy *aurora.SlaPolicy, hosts ...string) {
result, err := client.SLADrainHosts(policy, 60*60, hosts...)
result, err := client.SLADrainHosts(policy, int64(forceDrainTimeout.Seconds()), hosts...)
if err != nil {
log.Fatalf("error: %+v\n", err)
}
@ -139,7 +141,7 @@ func slaDrain(policy *aurora.SlaPolicy, hosts ...string) {
maintenanceMonitorPrint(hostResult, []aurora.MaintenanceMode{aurora.MaintenanceMode_DRAINED})
if err != nil {
log.Fatalln("error: %+v", err)
log.Fatalf("error: %+v", err)
}
}

View file

@ -2,7 +2,7 @@ FROM ubuntu:16.04
RUN apt-get update -y && \
apt-get install -y build-essential devscripts dh-exec dh-make git lintian wget && \
wget https://dl.google.com/go/go1.11.5.linux-amd64.tar.gz -O /tmp/go.tar.gz
wget https://dl.google.com/go/go1.12.1.linux-amd64.tar.gz -O /tmp/go.tar.gz
RUN tar -C /usr/local -xzf /tmp/go.tar.gz

7
debian/changelog vendored
View file

@ -1,3 +1,10 @@
australis (0.0.8) unstable; urgency=medium
* Upgraded default timeouts and durations for sla-aware draining.
* Added ability for controlling when an SLA-Aware drain sheds SLA awareness for SLA-aware drain policies
-- Renan DelValle <renanidelvalle@gmail.com> Fri, 22 Mar 2019 15:10:00 -0700
australis (0.0.7) unstable; urgency=medium
* Upgraded australis to gorealis v2.

2
go.sum
View file

@ -1,4 +1,4 @@
git.apache.org/thrift.git v0.12.0 h1:CMxsZlAmxKs+VAZMlDDL0wXciMblJcutQbEe3A9CYUM=
git.apache.org/thrift.git v0.12.0 h1:692K1/SsOcQvkvMRMdt60FCq2AvKpuQNM6sIeH3mN4s=
git.apache.org/thrift.git v0.12.0/go.mod h1:fPE2ZNJGynbRyZ4dJvy6G277gSllfV2HJqblrnkyeyg=
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
github.com/armon/consul-api v0.0.0-20180202201655-eb2c6b5be1b6/go.mod h1:grANhF5doyWs3UAsr3K4I6qtAmlQcZDesFNEHPZAzj8=