Skip to content

Commit

Permalink
chore(orca): Populate stage outputs instead of context. (spinnaker#181)
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt Duftler authored Dec 21, 2017
1 parent eb2ac07 commit a046e29
Show file tree
Hide file tree
Showing 8 changed files with 6 additions and 58 deletions.
18 changes: 0 additions & 18 deletions json-formats.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,18 +40,6 @@ Atlas and Stackdriver are used.
"groups": ["requests"]
}
],
"services": {
"atlas": {
"type": "atlas",
"name": "atlas",
"region": "us-east-1",
"environment": "prod",
"backend": {
"deployment": "main",
"dataset": "regional"
}
}
},
"classifier": {
"groupWeights": {
"requests": 50.0,
Expand Down Expand Up @@ -84,12 +72,6 @@ Atlas and Stackdriver are used.
"groups": ["system"]
}
],
"services": {
"stackdriver": {
"type": "stackdriver",
"name": "stackdriver"
}
},
"classifier": {
"groupWeights": {
"system": 100.0
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
import javax.annotation.Nonnull;
import java.io.IOException;
import java.time.Duration;
import java.util.Collections;
import java.util.List;
import java.util.Map;
import java.util.UUID;
Expand Down Expand Up @@ -142,6 +143,6 @@ public TaskResult execute(@Nonnull Stage stage) {
.put("result", result)
.build();

return new TaskResult(ExecutionStatus.SUCCEEDED, outputs);
return new TaskResult(ExecutionStatus.SUCCEEDED, Collections.emptyMap(), outputs);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ public TaskResult execute(@Nonnull Stage stage) {

Map outputs = Collections.singletonMap("metricSetPairListId", aggregatedMetricSetPairListId);

return new TaskResult(ExecutionStatus.SUCCEEDED, outputs);
return new TaskResult(ExecutionStatus.SUCCEEDED, Collections.emptyMap(), outputs);
}

private List<String> getMetricSetListIds(Execution execution, String stagePrefix) {
Expand Down
15 changes: 0 additions & 15 deletions kayenta-judge/src/test/resources/test-config.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
"description": "Example Automated Canary Analysis (ACA) Configuration",
"metrics": [
{
"service": "atlas",
"name": "cpu",
"query": {
"type": "atlas",
Expand All @@ -15,7 +14,6 @@
"groups": ["system", "example"]
},
{
"service": "atlas",
"name": "requests",
"query": {
"type": "atlas",
Expand All @@ -27,7 +25,6 @@
"groups": ["requests", "example"]
},
{
"service": "atlas",
"name": "foo",
"query": {
"type": "atlas",
Expand All @@ -39,18 +36,6 @@
"groups": ["bar"]
}
],
"services": {
"atlas": {
"type": "atlas",
"name": "atlas",
"region": "us-east-1",
"environment": "prod",
"backend": {
"deployment": "main",
"dataset": "regional"
}
}
},
"classifier": {
"groupWeights": {
"requests": 50.0,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ public CanaryExecutionStatusResponse getCanaryResults(@RequestParam(required = f
.filter(stage -> stage.getRefId().equals(REFID_JUDGE))
.findFirst()
.orElseThrow(() -> new IllegalArgumentException("Unable to find stage '" + REFID_JUDGE + "' in pipeline ID '" + canaryExecutionId + "'"));
Map<String, Object> judgeContext = judgeStage.getContext();
Map<String, Object> judgeOutputs = judgeStage.getOutputs();

Stage contextStage = pipeline.getStages().stream()
.filter(stage -> stage.getRefId().equals(REFID_SET_CONTEXT))
Expand Down Expand Up @@ -285,8 +285,8 @@ public CanaryExecutionStatusResponse getCanaryResults(@RequestParam(required = f
}

if (isComplete && pipelineStatus.equals("succeeded")) {
if (judgeContext.containsKey("canaryJudgeResultId")) {
String canaryJudgeResultId = (String)judgeContext.get("canaryJudgeResultId");
if (judgeOutputs.containsKey("canaryJudgeResultId")) {
String canaryJudgeResultId = (String)judgeOutputs.get("canaryJudgeResultId");
canaryExecutionStatusResponseBuilder.result(storageService.loadObject(resolvedStorageAccountName, ObjectType.CANARY_RESULT, canaryJudgeResultId));
}
}
Expand Down
8 changes: 0 additions & 8 deletions scratch/atlas_canary_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,14 +36,6 @@
}
}
],
"services": {
"atlas": {
"name": "atlas",
"type": "atlas",
"region": "us-east-1",
"environment": "prod"
}
},
"classifier": {
"groupWeights": {
"requests": 50.0,
Expand Down
6 changes: 0 additions & 6 deletions scratch/prometheus_canary_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
]
}
],
"services": {
"prometheus": {
"type": "prometheus",
"name": "prometheus"
}
},
"classifier": {
"groupWeights": {
"system": 100.0
Expand Down
6 changes: 0 additions & 6 deletions scratch/stackdriver_canary_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,6 @@
]
}
],
"services": {
"stackdriver": {
"type": "stackdriver",
"name": "stackdriver"
}
},
"classifier": {
"groupWeights": {
"system": 100.0
Expand Down

0 comments on commit a046e29

Please sign in to comment.