@spinnaker/titus 0.0.0-2025.1-0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (185) hide show
  1. package/CHANGELOG.md +2661 -0
  2. package/LICENSE.txt +203 -0
  3. package/dist/domain/IJobDisruptionBudget.d.ts +35 -0
  4. package/dist/domain/ITitusCredentials.d.ts +5 -0
  5. package/dist/domain/ITitusInstance.d.ts +28 -0
  6. package/dist/domain/ITitusScalingPolicy.d.ts +4 -0
  7. package/dist/domain/ITitusServerGroup.d.ts +52 -0
  8. package/dist/domain/ITitusServiceJobProcesses.d.ts +3 -0
  9. package/dist/domain/index.d.ts +5 -0
  10. package/dist/help/titus.help.d.ts +1 -0
  11. package/dist/index.d.ts +6 -0
  12. package/dist/index.js +12828 -0
  13. package/dist/index.js.map +1 -0
  14. package/dist/instance/details/TitusInstanceDetails.d.ts +25 -0
  15. package/dist/instance/details/TitusInstanceDns.d.ts +8 -0
  16. package/dist/instance/details/TitusInstanceInformation.d.ts +7 -0
  17. package/dist/instance/details/index.d.ts +4 -0
  18. package/dist/instance/details/titusInstanceDetailsUtils.d.ts +14 -0
  19. package/dist/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.controller.d.ts +2 -0
  20. package/dist/pipeline/stages/cloneServerGroup/titusCloneServerGroupStage.d.ts +2 -0
  21. package/dist/pipeline/stages/destroyAsg/titusDestroyAsgStage.d.ts +2 -0
  22. package/dist/pipeline/stages/disableAsg/titusDisableAsgStage.d.ts +2 -0
  23. package/dist/pipeline/stages/disableCluster/titusDisableClusterStage.d.ts +2 -0
  24. package/dist/pipeline/stages/enableAsg/titusEnableAsgStage.d.ts +2 -0
  25. package/dist/pipeline/stages/findAmi/titusFindAmiStage.d.ts +2 -0
  26. package/dist/pipeline/stages/resizeAsg/titusResizeAsgStage.d.ts +2 -0
  27. package/dist/pipeline/stages/runJob/RunJobExecutionDetails.d.ts +16 -0
  28. package/dist/pipeline/stages/runJob/TitusRunJobStageConfig.d.ts +25 -0
  29. package/dist/pipeline/stages/runJob/TitusSecurityGroupPicker.d.ts +34 -0
  30. package/dist/pipeline/stages/runJob/titusRunJobStage.d.ts +1 -0
  31. package/dist/pipeline/stages/scaleDownCluster/titusScaleDownClusterStage.d.ts +2 -0
  32. package/dist/pipeline/stages/shrinkCluster/titusShrinkClusterStage.d.ts +2 -0
  33. package/dist/reactShims/index.d.ts +1 -0
  34. package/dist/reactShims/titus.react.injector.d.ts +11 -0
  35. package/dist/reactShims/titus.react.module.d.ts +1 -0
  36. package/dist/securityGroup/securityGroup.read.service.d.ts +2 -0
  37. package/dist/serverGroup/configure/ServerGroupCommandBuilder.d.ts +2 -0
  38. package/dist/serverGroup/configure/serverGroup.configure.titus.module.d.ts +2 -0
  39. package/dist/serverGroup/configure/serverGroupConfiguration.service.d.ts +89 -0
  40. package/dist/serverGroup/configure/wizard/TitusCloneServerGroupModal.d.ts +31 -0
  41. package/dist/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.d.ts +28 -0
  42. package/dist/serverGroup/configure/wizard/pages/ServerGroupParameters.d.ts +15 -0
  43. package/dist/serverGroup/configure/wizard/pages/ServerGroupResources.d.ts +11 -0
  44. package/dist/serverGroup/configure/wizard/pages/TitusMapLayout.d.ts +4 -0
  45. package/dist/serverGroup/configure/wizard/pages/disruptionBudget/JobDisruptionBudget.d.ts +40 -0
  46. package/dist/serverGroup/configure/wizard/pages/disruptionBudget/PolicyOptions.d.ts +2 -0
  47. package/dist/serverGroup/configure/wizard/pages/disruptionBudget/RateOptions.d.ts +2 -0
  48. package/dist/serverGroup/configure/wizard/pages/disruptionBudget/WindowPicker.d.ts +23 -0
  49. package/dist/serverGroup/configure/wizard/pages/index.d.ts +4 -0
  50. package/dist/serverGroup/details/TitusCapacityDetailsSection.d.ts +11 -0
  51. package/dist/serverGroup/details/TitusLaunchConfigSection.d.ts +9 -0
  52. package/dist/serverGroup/details/TitusPackageDetailsSection.d.ts +6 -0
  53. package/dist/serverGroup/details/TitusSecurityGroups.d.ts +17 -0
  54. package/dist/serverGroup/details/capacityDetailsSection.component.d.ts +1 -0
  55. package/dist/serverGroup/details/disruptionBudget/DisruptionBudgetSection.d.ts +19 -0
  56. package/dist/serverGroup/details/disruptionBudget/EditDisruptionBudgetModal.d.ts +14 -0
  57. package/dist/serverGroup/details/index.d.ts +5 -0
  58. package/dist/serverGroup/details/launchConfigSection.component.d.ts +1 -0
  59. package/dist/serverGroup/details/resize/TitusResizeServerGroupModal.d.ts +8 -0
  60. package/dist/serverGroup/details/resize/useTaskMonitor.d.ts +25 -0
  61. package/dist/serverGroup/details/rollback/rollbackServerGroup.controller.d.ts +2 -0
  62. package/dist/serverGroup/details/scalingActivity/TitusScalingActivitiesModal.d.ts +7 -0
  63. package/dist/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.d.ts +21 -0
  64. package/dist/serverGroup/details/scalingPolicy/TitusCustomScalingPolicy.d.ts +7 -0
  65. package/dist/serverGroup/details/scalingPolicy/createScalingPolicyButton.component.d.ts +1 -0
  66. package/dist/serverGroup/details/scalingPolicy/index.d.ts +3 -0
  67. package/dist/serverGroup/details/scalingPolicy/scalingPolicy.module.d.ts +1 -0
  68. package/dist/serverGroup/details/scalingPolicy/targetTracking/TitusTargetTrackingChart.d.ts +9 -0
  69. package/dist/serverGroup/details/scalingPolicy/targetTracking/UpsertTargetTrackingModal.d.ts +10 -0
  70. package/dist/serverGroup/details/scalingPolicy/titusCustomScalingPolicy.component.d.ts +1 -0
  71. package/dist/serverGroup/details/scalingPolicy/upsert/TitusScalingPolicyCommandBuilderService.d.ts +10 -0
  72. package/dist/serverGroup/details/scalingPolicy/upsert/UpsertScalingPolicyModal.d.ts +10 -0
  73. package/dist/serverGroup/details/sections/ITitusServerGroupDetailsSectionProps.d.ts +5 -0
  74. package/dist/serverGroup/details/serverGroupDetails.titus.controller.d.ts +2 -0
  75. package/dist/serverGroup/details/serviceJobProcesses/ServiceJobProcesses.d.ts +3 -0
  76. package/dist/serverGroup/details/serviceJobProcesses/ServiceJobProcessesSection.d.ts +7 -0
  77. package/dist/serverGroup/details/titusPackageDetailsSection.component.d.ts +1 -0
  78. package/dist/serverGroup/details/titusSecurityGroups.component.d.ts +1 -0
  79. package/dist/serverGroup/serverGroup.transformer.d.ts +2 -0
  80. package/dist/titus.module.d.ts +5 -0
  81. package/dist/titus.settings.d.ts +14 -0
  82. package/dist/validation/ApplicationNameValidator.d.ts +1 -0
  83. package/package.json +52 -0
  84. package/src/domain/IJobDisruptionBudget.ts +19 -0
  85. package/src/domain/ITitusCredentials.ts +6 -0
  86. package/src/domain/ITitusInstance.ts +30 -0
  87. package/src/domain/ITitusScalingPolicy.ts +5 -0
  88. package/src/domain/ITitusServerGroup.ts +56 -0
  89. package/src/domain/ITitusServiceJobProcesses.ts +3 -0
  90. package/src/domain/index.ts +5 -0
  91. package/src/help/titus.help.ts +99 -0
  92. package/src/index.ts +6 -0
  93. package/src/instance/details/TitusInstanceDetails.tsx +234 -0
  94. package/src/instance/details/TitusInstanceDns.tsx +40 -0
  95. package/src/instance/details/TitusInstanceInformation.tsx +42 -0
  96. package/src/instance/details/index.ts +4 -0
  97. package/src/instance/details/titusInstanceDetailsUtils.spec.ts +124 -0
  98. package/src/instance/details/titusInstanceDetailsUtils.ts +181 -0
  99. package/src/logo/titus.logo.less +5 -0
  100. package/src/logo/titus.logo.png +0 -0
  101. package/src/logo/titus.logo.svg +7 -0
  102. package/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.controller.js +66 -0
  103. package/src/pipeline/stages/cloneServerGroup/cloneServerGroupExecutionDetails.html +46 -0
  104. package/src/pipeline/stages/cloneServerGroup/cloneServerGroupStage.html +106 -0
  105. package/src/pipeline/stages/cloneServerGroup/cloneServerGroupStepLabel.html +1 -0
  106. package/src/pipeline/stages/cloneServerGroup/titusCloneServerGroupStage.js +104 -0
  107. package/src/pipeline/stages/destroyAsg/destroyAsgStage.html +9 -0
  108. package/src/pipeline/stages/destroyAsg/destroyAsgStepLabel.html +1 -0
  109. package/src/pipeline/stages/destroyAsg/titusDestroyAsgStage.js +65 -0
  110. package/src/pipeline/stages/disableAsg/disableAsgStage.html +11 -0
  111. package/src/pipeline/stages/disableAsg/disableAsgStepLabel.html +1 -0
  112. package/src/pipeline/stages/disableAsg/titusDisableAsgStage.js +69 -0
  113. package/src/pipeline/stages/disableCluster/disableClusterStage.html +26 -0
  114. package/src/pipeline/stages/disableCluster/titusDisableClusterStage.js +85 -0
  115. package/src/pipeline/stages/enableAsg/enableAsgStage.html +11 -0
  116. package/src/pipeline/stages/enableAsg/enableAsgStepLabel.html +1 -0
  117. package/src/pipeline/stages/enableAsg/titusEnableAsgStage.js +73 -0
  118. package/src/pipeline/stages/findAmi/findAmiStage.html +24 -0
  119. package/src/pipeline/stages/findAmi/titusFindAmiStage.js +79 -0
  120. package/src/pipeline/stages/resizeAsg/resizeAsgStage.html +99 -0
  121. package/src/pipeline/stages/resizeAsg/resizeAsgStepLabel.html +1 -0
  122. package/src/pipeline/stages/resizeAsg/titusResizeAsgStage.js +125 -0
  123. package/src/pipeline/stages/runJob/RunJobExecutionDetails.tsx +165 -0
  124. package/src/pipeline/stages/runJob/TitusRunJobStageConfig.tsx +466 -0
  125. package/src/pipeline/stages/runJob/TitusSecurityGroupPicker.tsx +170 -0
  126. package/src/pipeline/stages/runJob/titusRunJobStage.ts +30 -0
  127. package/src/pipeline/stages/scaleDownCluster/scaleDownClusterStage.html +35 -0
  128. package/src/pipeline/stages/scaleDownCluster/titusScaleDownClusterStage.js +79 -0
  129. package/src/pipeline/stages/shrinkCluster/shrinkClusterStage.html +34 -0
  130. package/src/pipeline/stages/shrinkCluster/titusShrinkClusterStage.js +73 -0
  131. package/src/reactShims/index.ts +1 -0
  132. package/src/reactShims/titus.react.injector.ts +17 -0
  133. package/src/reactShims/titus.react.module.ts +10 -0
  134. package/src/securityGroup/securityGroup.read.service.js +15 -0
  135. package/src/serverGroup/configure/ServerGroupCommandBuilder.js +247 -0
  136. package/src/serverGroup/configure/serverGroup.configure.titus.module.js +9 -0
  137. package/src/serverGroup/configure/serverGroupCommandBuilder.spec.js +63 -0
  138. package/src/serverGroup/configure/serverGroupConfiguration.service.ts +410 -0
  139. package/src/serverGroup/configure/wizard/TitusCloneServerGroupModal.tsx +293 -0
  140. package/src/serverGroup/configure/wizard/pages/ServerGroupBasicSettings.tsx +339 -0
  141. package/src/serverGroup/configure/wizard/pages/ServerGroupParameters.less +5 -0
  142. package/src/serverGroup/configure/wizard/pages/ServerGroupParameters.tsx +217 -0
  143. package/src/serverGroup/configure/wizard/pages/ServerGroupResources.tsx +200 -0
  144. package/src/serverGroup/configure/wizard/pages/TitusMapLayout.less +3 -0
  145. package/src/serverGroup/configure/wizard/pages/TitusMapLayout.tsx +29 -0
  146. package/src/serverGroup/configure/wizard/pages/disruptionBudget/JobDisruptionBudget.tsx +285 -0
  147. package/src/serverGroup/configure/wizard/pages/disruptionBudget/PolicyOptions.tsx +112 -0
  148. package/src/serverGroup/configure/wizard/pages/disruptionBudget/RateOptions.tsx +89 -0
  149. package/src/serverGroup/configure/wizard/pages/disruptionBudget/WindowPicker.tsx +202 -0
  150. package/src/serverGroup/configure/wizard/pages/index.ts +4 -0
  151. package/src/serverGroup/details/TitusCapacityDetailsSection.tsx +66 -0
  152. package/src/serverGroup/details/TitusLaunchConfigSection.tsx +35 -0
  153. package/src/serverGroup/details/TitusPackageDetailsSection.tsx +40 -0
  154. package/src/serverGroup/details/TitusSecurityGroups.tsx +107 -0
  155. package/src/serverGroup/details/capacityDetailsSection.component.ts +12 -0
  156. package/src/serverGroup/details/disruptionBudget/DisruptionBudgetSection.tsx +226 -0
  157. package/src/serverGroup/details/disruptionBudget/EditDisruptionBudgetModal.tsx +92 -0
  158. package/src/serverGroup/details/index.ts +5 -0
  159. package/src/serverGroup/details/launchConfigSection.component.ts +12 -0
  160. package/src/serverGroup/details/resize/TitusResizeServerGroupModal.tsx +302 -0
  161. package/src/serverGroup/details/resize/useTaskMonitor.ts +30 -0
  162. package/src/serverGroup/details/rollback/rollbackServerGroup.controller.js +149 -0
  163. package/src/serverGroup/details/rollback/rollbackServerGroup.html +133 -0
  164. package/src/serverGroup/details/scalingActivity/TitusScalingActivitiesModal.tsx +81 -0
  165. package/src/serverGroup/details/scalingPolicy/CreateScalingPolicyButton.tsx +102 -0
  166. package/src/serverGroup/details/scalingPolicy/TitusCustomScalingPolicy.tsx +13 -0
  167. package/src/serverGroup/details/scalingPolicy/createScalingPolicyButton.component.ts +15 -0
  168. package/src/serverGroup/details/scalingPolicy/index.js +3 -0
  169. package/src/serverGroup/details/scalingPolicy/scalingPolicy.module.ts +7 -0
  170. package/src/serverGroup/details/scalingPolicy/targetTracking/TitusTargetTrackingChart.tsx +57 -0
  171. package/src/serverGroup/details/scalingPolicy/targetTracking/UpsertTargetTrackingModal.tsx +82 -0
  172. package/src/serverGroup/details/scalingPolicy/titusCustomScalingPolicy.component.ts +17 -0
  173. package/src/serverGroup/details/scalingPolicy/upsert/TitusScalingPolicyCommandBuilderService.ts +115 -0
  174. package/src/serverGroup/details/scalingPolicy/upsert/UpsertScalingPolicyModal.tsx +157 -0
  175. package/src/serverGroup/details/sections/ITitusServerGroupDetailsSectionProps.ts +6 -0
  176. package/src/serverGroup/details/serverGroupDetails.html +191 -0
  177. package/src/serverGroup/details/serverGroupDetails.titus.controller.js +457 -0
  178. package/src/serverGroup/details/serviceJobProcesses/ServiceJobProcesses.ts +12 -0
  179. package/src/serverGroup/details/serviceJobProcesses/ServiceJobProcessesSection.tsx +136 -0
  180. package/src/serverGroup/details/titusPackageDetailsSection.component.ts +12 -0
  181. package/src/serverGroup/details/titusSecurityGroups.component.ts +12 -0
  182. package/src/serverGroup/serverGroup.transformer.js +90 -0
  183. package/src/titus.module.ts +95 -0
  184. package/src/titus.settings.ts +22 -0
  185. package/src/validation/ApplicationNameValidator.ts +43 -0
@@ -0,0 +1,73 @@
1
+ 'use strict';
2
+
3
+ import { module } from 'angular';
4
+
5
+ import { AccountService, Registry, StageConstants } from '@spinnaker/core';
6
+
7
+ export const TITUS_PIPELINE_STAGES_ENABLEASG_TITUSENABLEASGSTAGE = 'spinnaker.titus.pipeline.stage.enableAsgStage';
8
+ export const name = TITUS_PIPELINE_STAGES_ENABLEASG_TITUSENABLEASGSTAGE; // for backwards compatibility
9
+ module(TITUS_PIPELINE_STAGES_ENABLEASG_TITUSENABLEASGSTAGE, [])
10
+ .config(function () {
11
+ Registry.pipeline.registerStage({
12
+ provides: 'enableServerGroup',
13
+ alias: 'enableAsg',
14
+ cloudProvider: 'titus',
15
+ templateUrl: require('./enableAsgStage.html'),
16
+ executionStepLabelUrl: require('./enableAsgStepLabel.html'),
17
+ validators: [
18
+ { type: 'requiredField', fieldName: 'cluster' },
19
+ { type: 'requiredField', fieldName: 'target' },
20
+ { type: 'requiredField', fieldName: 'regions' },
21
+ { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },
22
+ ],
23
+ });
24
+ })
25
+ .controller('titusEnableAsgStageCtrl', [
26
+ '$scope',
27
+ function ($scope) {
28
+ const ctrl = this;
29
+
30
+ const stage = $scope.stage;
31
+
32
+ $scope.state = {
33
+ accounts: false,
34
+ regionsLoaded: false,
35
+ };
36
+
37
+ AccountService.listAccounts('titus').then(function (accounts) {
38
+ $scope.accounts = accounts;
39
+ $scope.state.accounts = true;
40
+ });
41
+
42
+ ctrl.reset = () => {
43
+ ctrl.accountUpdated();
44
+ ctrl.resetSelectedCluster();
45
+ };
46
+
47
+ $scope.targets = StageConstants.TARGET_LIST;
48
+
49
+ stage.regions = stage.regions || [];
50
+ stage.cloudProvider = 'titus';
51
+
52
+ if (
53
+ stage.isNew &&
54
+ $scope.application.attributes.platformHealthOnlyShowOverride &&
55
+ $scope.application.attributes.platformHealthOnly
56
+ ) {
57
+ stage.interestingHealthProviderNames = ['Titus'];
58
+ }
59
+
60
+ if (!stage.credentials && $scope.application.defaultCredentials.titus) {
61
+ stage.credentials = $scope.application.defaultCredentials.titus;
62
+ }
63
+ if (!stage.regions.length && $scope.application.defaultRegions.titus) {
64
+ stage.regions.push($scope.application.defaultRegions.titus);
65
+ }
66
+
67
+ if (!stage.target) {
68
+ stage.target = $scope.targets[0].val;
69
+ }
70
+
71
+ $scope.$watch('stage.credentials', $scope.accountUpdated);
72
+ },
73
+ ]);
@@ -0,0 +1,24 @@
1
+ <div ng-controller="titusFindAmiStageCtrl as findAmiCtrl" class="form-horizontal">
2
+ <account-region-cluster-selector
3
+ application="application"
4
+ component="stage"
5
+ accounts="accounts"
6
+ show-all-regions="true"
7
+ >
8
+ </account-region-cluster-selector>
9
+ <stage-config-field label="Server Group Selection">
10
+ <ui-select ng-model="stage.selectionStrategy" class="form-control input-sm">
11
+ <ui-select-match placeholder="None">{{$select.selected.label}}</ui-select-match>
12
+ <ui-select-choices repeat="strategy.val as strategy in selectionStrategies | filter: $select.search">
13
+ <strong ng-bind-html="strategy.label | highlight: $select.search"></strong>
14
+ <div ng-bind-html="strategy.description"></div>
15
+ </ui-select-choices>
16
+ </ui-select>
17
+ </stage-config-field>
18
+ <stage-config-field label="Server Group Filters">
19
+ <label class="checkbox-inline">
20
+ <input type="checkbox" ng-model="stage.onlyEnabled" />
21
+ Only consider enabled Server Groups
22
+ </label>
23
+ </stage-config-field>
24
+ </div>
@@ -0,0 +1,79 @@
1
+ 'use strict';
2
+
3
+ import * as angular from 'angular';
4
+
5
+ import { AccountService, Registry } from '@spinnaker/core';
6
+
7
+ export const TITUS_PIPELINE_STAGES_FINDAMI_TITUSFINDAMISTAGE = 'spinnaker.titus.pipeline.stage.findAmiStage';
8
+ export const name = TITUS_PIPELINE_STAGES_FINDAMI_TITUSFINDAMISTAGE; // for backwards compatibility
9
+ angular
10
+ .module(TITUS_PIPELINE_STAGES_FINDAMI_TITUSFINDAMISTAGE, [])
11
+ .config(function () {
12
+ Registry.pipeline.registerStage({
13
+ provides: 'findImage',
14
+ alias: 'findAmi',
15
+ cloudProvider: 'titus',
16
+ templateUrl: require('./findAmiStage.html'),
17
+ validators: [
18
+ { type: 'requiredField', fieldName: 'cluster' },
19
+ { type: 'requiredField', fieldName: 'selectionStrategy', fieldLabel: 'Server Group Selection' },
20
+ { type: 'requiredField', fieldName: 'credentials' },
21
+ ],
22
+ });
23
+ })
24
+ .controller('titusFindAmiStageCtrl', [
25
+ '$scope',
26
+ function ($scope) {
27
+ const stage = $scope.stage;
28
+
29
+ $scope.state = {
30
+ accounts: false,
31
+ regionsLoaded: false,
32
+ };
33
+
34
+ AccountService.listAccounts('titus').then(function (accounts) {
35
+ $scope.accounts = accounts;
36
+ $scope.state.accounts = true;
37
+ });
38
+
39
+ $scope.selectionStrategies = [
40
+ {
41
+ label: 'Largest',
42
+ val: 'LARGEST',
43
+ description: 'When multiple server groups exist, prefer the server group with the most instances',
44
+ },
45
+ {
46
+ label: 'Newest',
47
+ val: 'NEWEST',
48
+ description: 'When multiple server groups exist, prefer the newest',
49
+ },
50
+ {
51
+ label: 'Oldest',
52
+ val: 'OLDEST',
53
+ description: 'When multiple server groups exist, prefer the oldest',
54
+ },
55
+ {
56
+ label: 'Fail',
57
+ val: 'FAIL',
58
+ description: 'When multiple server groups exist, fail',
59
+ },
60
+ ];
61
+
62
+ stage.regions = stage.regions || [];
63
+ stage.cloudProvider = 'titus';
64
+ stage.selectionStrategy = stage.selectionStrategy || $scope.selectionStrategies[0].val;
65
+
66
+ if (angular.isUndefined(stage.onlyEnabled)) {
67
+ stage.onlyEnabled = true;
68
+ }
69
+
70
+ if (!stage.credentials && $scope.application.defaultCredentials.titus) {
71
+ stage.credentials = $scope.application.defaultCredentials.titus;
72
+ }
73
+ if (!stage.regions.length && $scope.application.defaultRegions.titus) {
74
+ stage.regions.push($scope.application.defaultRegions.titus);
75
+ }
76
+
77
+ $scope.$watch('stage.credentials', $scope.accountUpdated);
78
+ },
79
+ ]);
@@ -0,0 +1,99 @@
1
+ <div ng-controller="titusResizeAsgStageCtrl as resizeAsgStageCtrl">
2
+ <div ng-if="!pipeline.strategy">
3
+ <div ng-if="!viewState.accountsLoaded">
4
+ <h4 class="text-center">
5
+ <span us-spinner="{radius:20, width:6, length: 12}"></span>
6
+ </h4>
7
+ </div>
8
+ <div ng-if="viewState.accountsLoaded">
9
+ <account-region-cluster-selector application="application" component="stage" accounts="accounts">
10
+ </account-region-cluster-selector>
11
+ </div>
12
+ </div>
13
+ <stage-config-field label="Target">
14
+ <target-select model="stage" options="resizeTargets"></target-select>
15
+ </stage-config-field>
16
+ <stage-config-field label="Action" help-key="pipeline.config.resizeAsg.action">
17
+ <select
18
+ class="form-control input-sm"
19
+ required
20
+ ng-model="stage.action"
21
+ ng-change="resizeAsgStageCtrl.updateResizeType()"
22
+ ng-options="a.val as a.label for a in scaleActions"
23
+ >
24
+ <option>Select an action...</option>
25
+ </select>
26
+ </stage-config-field>
27
+ <div ng-if="stage.action !== 'scale_exact'">
28
+ <stage-config-field label="{{stage.action === 'scale_to_cluster' ? 'Additional Capacity' : 'Type'}}">
29
+ <select
30
+ class="form-control input-sm"
31
+ required
32
+ ng-model="stage.resizeType"
33
+ ng-change="resizeAsgStageCtrl.updateResizeType()"
34
+ ng-options="t.val as t.label for t in resizeTypes"
35
+ >
36
+ <option>Select an action...</option>
37
+ </select>
38
+ </stage-config-field>
39
+ <div class="form-group" ng-if="stage.resizeType === 'pct'">
40
+ <div class="col-md-9 col-md-offset-3">
41
+ <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize Percentage</label>
42
+
43
+ <div class="col-md-2">
44
+ <input type="number" min="0" ng-model="stage.scalePct" class="form-control input-sm" />
45
+ </div>
46
+ </div>
47
+ <div class="col-md-9 col-md-offset-3">
48
+ <em class="subinput-note"
49
+ >This is the percentage by which the target server group's capacity will be increased</em
50
+ >
51
+ </div>
52
+ </div>
53
+ <div class="form-group" ng-if="stage.resizeType === 'incr'">
54
+ <div class="col-md-9 col-md-offset-3">
55
+ <label class="col-md-2 sm-label-right" style="margin-left: 0; padding-left: 0">Resize-by Amount</label>
56
+
57
+ <div class="col-md-2">
58
+ <input type="number" min="0" ng-model="stage.scaleNum" class="form-control input-sm" />
59
+ </div>
60
+ </div>
61
+
62
+ <div class="col-md-9 col-md-offset-3">
63
+ <em class="subinput-note"
64
+ >This is the exact amount by which the target server group's capacity will be increased</em
65
+ >
66
+ </div>
67
+ </div>
68
+ </div>
69
+ <div class="form-group" ng-if="stage.action === 'scale_exact'">
70
+ <div class="col-md-9 col-md-offset-3 small">
71
+ <div class="col-md-9">
72
+ <div class="col-md-3 col-md-offset-3">Min</div>
73
+ <div class="col-md-3">Max</div>
74
+ <div class="col-md-3">Desired</div>
75
+ </div>
76
+ </div>
77
+ <div class="col-md-9 col-md-offset-3">
78
+ <label class="col-md-2 sm-label-right small" style="margin-left: 0; padding-left: 0">Match Capacity</label>
79
+
80
+ <div class="col-md-9">
81
+ <div class="col-md-3">
82
+ <input type="number" ng-model="stage.capacity.min" class="form-control input-sm" />
83
+ </div>
84
+ <div class="col-md-3">
85
+ <input type="number" ng-model="stage.capacity.max" class="form-control input-sm" />
86
+ </div>
87
+ <div class="col-md-3">
88
+ <input type="number" ng-model="stage.capacity.desired" class="form-control input-sm" />
89
+ </div>
90
+ </div>
91
+ </div>
92
+
93
+ <div class="col-md-9 col-md-offset-3">
94
+ <em class="subinput-note">This is the exact amount to which the target server group will be scaled</em>
95
+ </div>
96
+ </div>
97
+ <stage-platform-health-override application="application" stage="stage" platform-health-type="'Titus'">
98
+ </stage-platform-health-override>
99
+ </div>
@@ -0,0 +1 @@
1
+ <span class="task-label"> Resize Server Group: {{step.context.serverGroupName}} ({{step.context.region}}) </span>
@@ -0,0 +1,125 @@
1
+ 'use strict';
2
+
3
+ import { module } from 'angular';
4
+
5
+ import { AccountService, Registry, StageConstants } from '@spinnaker/core';
6
+
7
+ export const TITUS_PIPELINE_STAGES_RESIZEASG_TITUSRESIZEASGSTAGE = 'spinnaker.titus.pipeline.stage.resizeAsgStage';
8
+ export const name = TITUS_PIPELINE_STAGES_RESIZEASG_TITUSRESIZEASGSTAGE; // for backwards compatibility
9
+ module(TITUS_PIPELINE_STAGES_RESIZEASG_TITUSRESIZEASGSTAGE, [])
10
+ .config(function () {
11
+ Registry.pipeline.registerStage({
12
+ provides: 'resizeServerGroup',
13
+ alias: 'resizeAsg',
14
+ cloudProvider: 'titus',
15
+ templateUrl: require('./resizeAsgStage.html'),
16
+ executionConfigSections: ['resizeServerGroupConfig', 'taskStatus'],
17
+ executionStepLabelUrl: require('./resizeAsgStepLabel.html'),
18
+ accountExtractor: (stage) => [stage.context.credentials],
19
+ configAccountExtractor: (stage) => [stage.credentials],
20
+ validators: [
21
+ {
22
+ type: 'targetImpedance',
23
+ message:
24
+ 'This pipeline will attempt to resize a server group without deploying a new version into the same cluster.',
25
+ },
26
+ { type: 'requiredField', fieldName: 'target' },
27
+ { type: 'requiredField', fieldName: 'action' },
28
+ { type: 'requiredField', fieldName: 'regions' },
29
+ { type: 'requiredField', fieldName: 'cluster' },
30
+ { type: 'requiredField', fieldName: 'credentials', fieldLabel: 'account' },
31
+ ],
32
+ });
33
+ })
34
+ .controller('titusResizeAsgStageCtrl', [
35
+ '$scope',
36
+ function ($scope) {
37
+ const ctrl = this;
38
+
39
+ const stage = $scope.stage;
40
+
41
+ $scope.viewState = {
42
+ accountsLoaded: false,
43
+ regionsLoaded: false,
44
+ };
45
+
46
+ AccountService.listAccounts('titus').then(function (accounts) {
47
+ $scope.accounts = accounts;
48
+ $scope.viewState.accountsLoaded = true;
49
+ });
50
+
51
+ $scope.resizeTargets = StageConstants.TARGET_LIST;
52
+
53
+ $scope.scaleActions = [
54
+ {
55
+ label: 'Scale Up',
56
+ val: 'scale_up',
57
+ },
58
+ {
59
+ label: 'Scale Down',
60
+ val: 'scale_down',
61
+ },
62
+ {
63
+ label: 'Scale to Cluster Size',
64
+ val: 'scale_to_cluster',
65
+ },
66
+ {
67
+ label: 'Scale to Exact Size',
68
+ val: 'scale_exact',
69
+ },
70
+ ];
71
+
72
+ $scope.resizeTypes = [
73
+ {
74
+ label: 'Percentage',
75
+ val: 'pct',
76
+ },
77
+ {
78
+ label: 'Incremental',
79
+ val: 'incr',
80
+ },
81
+ ];
82
+
83
+ stage.capacity = stage.capacity || {};
84
+ stage.regions = stage.regions || [];
85
+ stage.target = stage.target || $scope.resizeTargets[0].val;
86
+ stage.action = stage.action || $scope.scaleActions[0].val;
87
+ stage.resizeType = stage.resizeType || $scope.resizeTypes[0].val;
88
+ if (!stage.action && stage.resizeType === 'exact') {
89
+ stage.action = 'scale_exact';
90
+ }
91
+ stage.cloudProvider = 'titus';
92
+
93
+ if (
94
+ stage.isNew &&
95
+ $scope.application.attributes.platformHealthOnlyShowOverride &&
96
+ $scope.application.attributes.platformHealthOnly
97
+ ) {
98
+ stage.interestingHealthProviderNames = ['Titus'];
99
+ }
100
+
101
+ if (!stage.credentials && $scope.application.defaultCredentials.titus) {
102
+ stage.credentials = $scope.application.defaultCredentials.titus;
103
+ }
104
+ if (!stage.regions.length && $scope.application.defaultRegions.titus) {
105
+ stage.regions.push($scope.application.defaultRegions.titus);
106
+ }
107
+
108
+ ctrl.updateResizeType = function () {
109
+ if (stage.action === 'scale_exact') {
110
+ stage.resizeType = 'exact';
111
+ delete stage.scalePct;
112
+ delete stage.scaleNum;
113
+ } else {
114
+ stage.capacity = {};
115
+ if (stage.resizeType === 'pct') {
116
+ delete stage.scaleNum;
117
+ } else {
118
+ stage.resizeType = 'incr';
119
+ delete stage.scalePct;
120
+ stage.scaleNum = stage.scaleNum || 0;
121
+ }
122
+ }
123
+ };
124
+ },
125
+ ]);
@@ -0,0 +1,165 @@
1
+ import { get } from 'lodash';
2
+ import React from 'react';
3
+
4
+ import type { IExecutionDetailsSectionProps } from '@spinnaker/core';
5
+ import {
6
+ AccountService,
7
+ AccountTag,
8
+ ExecutionDetailsSection,
9
+ LabeledValue,
10
+ LabeledValueList,
11
+ Markdown,
12
+ RenderOutputFile,
13
+ StageFailureMessage,
14
+ } from '@spinnaker/core';
15
+
16
+ export interface IRunJobExecutionDetailsState {
17
+ titusUiEndpoint?: string;
18
+ }
19
+
20
+ export class RunJobExecutionDetails extends React.Component<
21
+ IExecutionDetailsSectionProps,
22
+ IRunJobExecutionDetailsState
23
+ > {
24
+ public static title = 'runJobConfig';
25
+ private mounted = false;
26
+
27
+ constructor(props: IExecutionDetailsSectionProps) {
28
+ super(props);
29
+ this.state = {};
30
+ }
31
+
32
+ public componentDidMount() {
33
+ this.mounted = true;
34
+ this.setEndpoint();
35
+ }
36
+
37
+ private setEndpoint(): void {
38
+ const { context } = this.props.stage;
39
+ AccountService.getAccountDetails(context.credentials).then((details) => {
40
+ const titusUiEndpoint = details.regions.find((r) => r.name === context.cluster.region).endpoint;
41
+ this.mounted && this.setState({ titusUiEndpoint });
42
+ });
43
+ }
44
+
45
+ private formatEntryPoint(entryPointList: string[], entryPoint: string): string {
46
+ if (entryPointList && Array.isArray(entryPointList) && entryPointList.length > 0) {
47
+ return entryPointList.length === 1 ? entryPointList[0] : JSON.stringify(entryPointList);
48
+ }
49
+ return entryPoint;
50
+ }
51
+
52
+ public componentWillUnmount() {
53
+ this.mounted = false;
54
+ }
55
+
56
+ public componentWillReceiveProps() {
57
+ this.setEndpoint();
58
+ }
59
+
60
+ public render() {
61
+ const { stage, current, name } = this.props;
62
+ const { titusUiEndpoint } = this.state;
63
+ const { context } = stage;
64
+ const { cluster } = context;
65
+ const { resources, env, entryPoint, entryPointList } = cluster;
66
+ const jobId = cluster ? get(context['deploy.jobs'], cluster.region, [])[0] : null;
67
+ const taskId = get(context, 'jobStatus.completionDetails.taskId');
68
+
69
+ const normalizedEntryPoint = this.formatEntryPoint(entryPointList, entryPoint);
70
+
71
+ return (
72
+ <ExecutionDetailsSection name={name} current={current}>
73
+ <div className="row">
74
+ <div className="col-md-9">
75
+ <LabeledValueList className="dl-narrow dl-horizontal">
76
+ <LabeledValue label="Account" value={<AccountTag account={context.credentials} />} />
77
+ {cluster && (
78
+ <>
79
+ <LabeledValue label="Image" value={cluster.imageId} />
80
+ {normalizedEntryPoint && <LabeledValue label="Entrypoint" value={normalizedEntryPoint} />}
81
+ </>
82
+ )}
83
+ {jobId && (
84
+ <LabeledValue
85
+ label="Titus Job Id"
86
+ value={<Markdown message={`[${jobId}](${titusUiEndpoint}jobs/${jobId})`} />}
87
+ />
88
+ )}
89
+ {taskId && (
90
+ <LabeledValue
91
+ label="Titus Task Id"
92
+ value={<Markdown message={`[${taskId}](${titusUiEndpoint}jobs/${jobId}/tasks/${taskId})`} />}
93
+ />
94
+ )}
95
+ {resources && Object.keys(resources) && (
96
+ <LabeledValue
97
+ label="Resources"
98
+ value={
99
+ <ul className="nostyle">
100
+ {Object.keys(resources).map((key) => (
101
+ <li key={key}>
102
+ {key}: {resources[key]}
103
+ </li>
104
+ ))}
105
+ </ul>
106
+ }
107
+ />
108
+ )}
109
+ </LabeledValueList>
110
+ </div>
111
+ </div>
112
+ {env && Object.keys(env) && (
113
+ <div className="row">
114
+ <div className="col-md-12">
115
+ <h5 style={{ marginBottom: 0, paddingBottom: '5px' }}>Environment Variables</h5>
116
+ <LabeledValueList>
117
+ {Object.keys(env).map((key) => (
118
+ <LabeledValue key={key} label={key} value={env[key]} />
119
+ ))}
120
+ </LabeledValueList>
121
+ </div>
122
+ </div>
123
+ )}
124
+ {context.propertyFileContents && (
125
+ <div className="row">
126
+ <div className="col-md-12">
127
+ <h5 style={{ marginBottom: '0px', paddingBottom: '5px' }}>Property File</h5>
128
+ <RenderOutputFile outputFileObject={context.propertyFileContents} />
129
+ </div>
130
+ </div>
131
+ )}
132
+ <StageFailureMessage
133
+ stage={stage}
134
+ message={stage.failureMessage || get(context, 'completionDetails.message')}
135
+ />
136
+
137
+ {taskId && (
138
+ <div className="row">
139
+ <div className="col-md-12">
140
+ <div className="well alert alert-info">
141
+ <a target="_blank" href={`${titusUiEndpoint}jobs/${jobId}/tasks/${taskId}/logs`}>
142
+ View Execution Logs
143
+ </a>
144
+ <br />
145
+ <a
146
+ target="_blank"
147
+ href={`${titusUiEndpoint}jobs/${jobId}/tasks/${taskId}/logs/archived?file=stdout&view=Finished&open=true`}
148
+ >
149
+ Stdout
150
+ </a>
151
+ <br />
152
+ <a
153
+ target="_blank"
154
+ href={`${titusUiEndpoint}jobs/${jobId}/tasks/${taskId}/logs/archived?file=stderr&view=Finished&open=true`}
155
+ >
156
+ Stderr
157
+ </a>
158
+ </div>
159
+ </div>
160
+ </div>
161
+ )}
162
+ </ExecutionDetailsSection>
163
+ );
164
+ }
165
+ }