Skip to content

Commit

Permalink
Most K8S deployments do not use the outputs in downstream stages. So,…
Browse files Browse the repository at this point in the history
… if it is not used

users can skip the output of the Deployment Manifest and Run Job (Manifest) stage by
specifiying the attribute noOutput set to false in the stage json.

This significantly reduces the execution context being saved in redis/databse or
sent to the browser.
  • Loading branch information
Nirmalyasen committed Dec 22, 2020
1 parent ca398bf commit d33c26a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,12 @@

package com.netflix.spinnaker.orca.clouddriver.pipeline.job;

import static java.util.Collections.emptyMap;

import com.fasterxml.jackson.databind.ObjectMapper;
import com.netflix.spinnaker.orca.api.pipeline.CancellableStage;
import com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder;
import com.netflix.spinnaker.orca.api.pipeline.graph.StageGraphBuilder;
import com.netflix.spinnaker.orca.api.pipeline.graph.TaskNode;
import com.netflix.spinnaker.orca.api.pipeline.models.StageExecution;
import com.netflix.spinnaker.orca.clouddriver.tasks.artifacts.ConsumeArtifactTask;
Expand Down Expand Up @@ -76,6 +79,12 @@ public void taskGraph(@Nonnull StageExecution stage, @Nonnull TaskNode.Builder b
}
}

public void afterStages(@Nonnull StageExecution stage, @Nonnull StageGraphBuilder graph) {
if (stage.getContext().getOrDefault("noOutput", "false").toString().equals("true")) {
stage.setOutputs(emptyMap());
}
}

@Override
public Result cancel(StageExecution stage) {
log.info(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
package com.netflix.spinnaker.orca.clouddriver.pipeline.manifest;

import static com.google.common.collect.ImmutableList.toImmutableList;
import static java.util.Collections.emptyMap;

import com.google.common.collect.ImmutableList;
import com.netflix.spinnaker.orca.api.pipeline.graph.StageDefinitionBuilder;
Expand Down Expand Up @@ -80,6 +81,9 @@ public void afterStages(@Nonnull StageExecution stage, @Nonnull StageGraphBuilde
// do nothing
}
}
if (stage.getContext().getOrDefault("noOutput", "false").toString().equals("true")) {
stage.setOutputs(emptyMap());
}
}

private void disableOldManifests(Map<String, Object> parentContext, StageGraphBuilder graph) {
Expand Down

0 comments on commit d33c26a

Please sign in to comment.