Adding update strategies change to changelog, changed docker-compose to point to aurora 0.22.0 snapshot. Added test coverage for update strategies.
This commit is contained in:
parent
60a41dadbe
commit
68c27fee13
3 changed files with 74 additions and 5 deletions
|
@ -1,6 +1,8 @@
|
|||
1.4.0 (unreleased)
|
||||
1.22.0 (unreleased)
|
||||
|
||||
* Moved to Thrift 0.12.0 code generator and go library.
|
||||
* `aurora.ACTIVE_STATES`, `aurora.SLAVE_ASSIGNED_STATES`, `aurora.LIVE_STATES`, `aurora.TERMINAL_STATES`, `aurora.ACTIVE_JOB_UPDATE_STATES`, `aurora.AWAITNG_PULSE_JOB_UPDATE_STATES` are all now generated as a slices.
|
||||
* Please use `realis.ActiveStates`, `realis.SlaveAssignedStates`,`realis.LiveStates`, `realis.TerminalStates`, `realis.ActiveJobUpdateStates`, `realis.AwaitingPulseJobUpdateStates` in their places when map representations are needed.
|
||||
* `GetInstanceIds(key *aurora.JobKey, states map[aurora.ScheduleStatus]bool) (map[int32]bool, error)` has changed signature to ` GetInstanceIds(key *aurora.JobKey, states []aurora.ScheduleStatus) ([]int32, error)`
|
||||
* Changing compose environment to Aurora snapshot in order to support staggered update.
|
||||
* Adding staggered updates API.
|
||||
|
|
|
@ -14,7 +14,7 @@ services:
|
|||
ipv4_address: 192.168.33.2
|
||||
|
||||
master:
|
||||
image: rdelvalle/mesos-master:1.5.1
|
||||
image: rdelvalle/mesos-master:1.6.1
|
||||
restart: on-failure
|
||||
ports:
|
||||
- "5050:5050"
|
||||
|
@ -32,7 +32,7 @@ services:
|
|||
- zk
|
||||
|
||||
agent-one:
|
||||
image: rdelvalle/mesos-agent:1.5.1
|
||||
image: rdelvalle/mesos-agent:1.6.1
|
||||
pid: host
|
||||
restart: on-failure
|
||||
ports:
|
||||
|
@ -56,7 +56,7 @@ services:
|
|||
- zk
|
||||
|
||||
agent-two:
|
||||
image: rdelvalle/mesos-agent:1.5.1
|
||||
image: rdelvalle/mesos-agent:1.6.1
|
||||
pid: host
|
||||
restart: on-failure
|
||||
ports:
|
||||
|
@ -80,7 +80,7 @@ services:
|
|||
- zk
|
||||
|
||||
aurora-one:
|
||||
image: rdelvalle/aurora:0.21.0
|
||||
image: rdelvalle/aurora:0.22.0-07c1dee796e553540a025d3ef5e126cfaf14620d
|
||||
pid: host
|
||||
ports:
|
||||
- "8081:8081"
|
||||
|
|
|
@ -823,3 +823,70 @@ func TestAuroraJob_UpdateSlaPolicy(t *testing.T) {
|
|||
})
|
||||
}
|
||||
}
|
||||
|
||||
func TestRealisClient_UpdateStrategies(t *testing.T) {
|
||||
|
||||
// Create a single job
|
||||
job := realis.NewJob().
|
||||
Environment("prod").
|
||||
Role("vagrant").
|
||||
ExecutorName(aurora.AURORA_EXECUTOR_NAME).
|
||||
ExecutorData(string(thermosPayload)).
|
||||
CPU(.01).
|
||||
RAM(4).
|
||||
Disk(10).
|
||||
InstanceCount(6).
|
||||
IsService(true)
|
||||
|
||||
strategies := []struct {
|
||||
UpdateJob *realis.UpdateJob
|
||||
Name string
|
||||
}{
|
||||
{
|
||||
UpdateJob: realis.NewDefaultUpdateJob(job.TaskConfig()).
|
||||
QueueUpdateStrategy(aurora.QueueJobUpdateStrategy{GroupSize: 2}).
|
||||
InstanceCount(6).
|
||||
WatchTime(1000),
|
||||
Name: "Queue",
|
||||
},
|
||||
{
|
||||
UpdateJob: realis.NewDefaultUpdateJob(job.TaskConfig()).
|
||||
BatchUpdateStrategy(aurora.BatchJobUpdateStrategy{GroupSize: 2}).
|
||||
InstanceCount(6).
|
||||
WatchTime(1000),
|
||||
Name: "Batch",
|
||||
},
|
||||
{
|
||||
UpdateJob: realis.NewDefaultUpdateJob(job.TaskConfig()).
|
||||
VariableBatchStrategy(aurora.VariableBatchJobUpdateStrategy{GroupSizes: []int32{1, 2, 3}}).
|
||||
InstanceCount(6).
|
||||
WatchTime(1000),
|
||||
Name: "VarBatch",
|
||||
},
|
||||
}
|
||||
|
||||
for _, strategy := range strategies {
|
||||
t.Run("TestRealisClient_UpdateStrategies_"+strategy.Name, func(t *testing.T) {
|
||||
job.Name("update_strategies_" + strategy.Name)
|
||||
resp, err := r.StartJobUpdate(strategy.UpdateJob, "")
|
||||
|
||||
assert.NoError(t, err)
|
||||
assert.NotNil(t, resp)
|
||||
assert.NotNil(t, resp.GetResult_())
|
||||
assert.NotNil(t, resp.GetResult_().GetStartJobUpdateResult_())
|
||||
assert.NotNil(t, resp.GetResult_().GetStartJobUpdateResult_().GetKey())
|
||||
|
||||
var ok bool
|
||||
var mErr error
|
||||
key := *resp.GetResult_().GetStartJobUpdateResult_().GetKey()
|
||||
|
||||
if ok, mErr = monitor.JobUpdate(key, 5, 240); !ok || mErr != nil {
|
||||
// Update may already be in a terminal state so don't check for error
|
||||
_, err := r.AbortJobUpdate(key, "Monitor timed out.")
|
||||
assert.NoError(t, err)
|
||||
}
|
||||
_, err = r.KillJob(job.JobKey())
|
||||
assert.NoError(t, err)
|
||||
})
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue