-
Notifications
You must be signed in to change notification settings - Fork 900
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): show hint if wait for up instances task is not completing (…
- Loading branch information
1 parent
9ae3860
commit 62901fb
Showing
20 changed files
with
100 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
export interface TaskStep { | ||
import {ITimedItem} from './IOrchestratedItem'; | ||
|
||
export interface TaskStep extends ITimedItem { | ||
name: string; | ||
status: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
53 changes: 53 additions & 0 deletions
53
app/scripts/modules/core/task/platformHealthOverrideMessage.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
import {module, IComponentOptions, IComponentController} from 'angular'; | ||
import {get} from 'lodash'; | ||
import * as moment from 'moment'; | ||
|
||
import {Application} from 'core/application/application.model'; | ||
import {TaskStep, InstanceCounts, IStage, ITimedItem} from 'core/domain/index'; | ||
import {ITask} from './task.read.service'; | ||
|
||
class PlatformHealthOverrideMessageController implements IComponentController { | ||
public showMessage: boolean; | ||
public messageTemplate = require('./platformHealthOverrideMessage.html'); | ||
private application: Application; | ||
private step: TaskStep; | ||
private task: ITask; | ||
|
||
public $onInit(): void { | ||
const lastCapacity: InstanceCounts = this.task.getValueFor('lastCapacityCheck'); | ||
if (lastCapacity) { | ||
const lastCapacityTotal = lastCapacity.up + lastCapacity.down + | ||
lastCapacity.outOfService + lastCapacity.unknown + lastCapacity.succeeded + lastCapacity.failed; | ||
|
||
// Confirm that a). we're stuck on a clone or create task (not, e.g., an enable task) | ||
// and b). the step we're stuck on is within that clone or create task. | ||
const isRelevantTask: boolean = this.task.execution.stages | ||
.some((stage: IStage) => { | ||
return (stage.type === 'cloneServerGroup' || stage.type === 'createServerGroup') && | ||
stage.tasks.some((task: ITimedItem) => task.startTime === this.step.startTime); | ||
}); | ||
|
||
this.showMessage = (isRelevantTask && | ||
this.step.name === 'waitForUpInstances' && | ||
this.step.runningTimeInMs > moment.duration(5, 'minutes').asMilliseconds() && | ||
lastCapacity.unknown > 0 && | ||
lastCapacity.unknown === lastCapacityTotal && | ||
!get(this.application, 'attributes.platformHealthOnly')); | ||
} | ||
} | ||
} | ||
|
||
class PlatformHealthOverrideMessage implements IComponentOptions { | ||
public bindings: any = { | ||
application: '<', | ||
step: '<', | ||
task: '<' | ||
}; | ||
public controller = PlatformHealthOverrideMessageController; | ||
public template = `<i ng-if="$ctrl.showMessage" | ||
uib-tooltip-template="::$ctrl.messageTemplate" | ||
class="fa fa-exclamation-circle" style="font-size: smaller;"></i>`; | ||
} | ||
|
||
export const PLATFORM_HEALTH_OVERRIDE_MESSAGE = 'spinnaker.core.platformHealthOverrideMessage.component'; | ||
module(PLATFORM_HEALTH_OVERRIDE_MESSAGE, []).component('platformHealthOverrideMessage', new PlatformHealthOverrideMessage()); |
13 changes: 13 additions & 0 deletions
13
app/scripts/modules/core/task/platformHealthOverrideMessage.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
<p> | ||
Task not completing? | ||
</p> | ||
<p> | ||
By default, Spinnaker does not consider cloud provider health (i.e. whether your instances have launched and are running) | ||
as a reliable indicator of instance health. | ||
</p> | ||
<p> | ||
If your instances do not provide a health indicator known to Spinnaker | ||
(e.g. a discovery service or load balancers), you should configure your application to | ||
consider only cloud provider health when executing tasks. This option is available under Application Attributes | ||
in the <b>Config tab</b>. | ||
</p> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters