.withName("Standard Canary Pipeline") .withPipelineConfigId(canaryPipelineConfigId) .withStage("setupCanary", "Setup Canary", setupCanaryContext) .withStage("canaryJudge", "Perform Analysis with Judge 1", canaryJudgeContext1) .withStage("canaryJudge", "Perform Analysis with Judge 2", canaryJudgeContext2) .withStage("compareJudgeResults", "Compare Judge Results", compareJudgeResultsContext);
.withName(PIPELINE_NAME) .withPipelineConfigId(canaryPipelineConfigId) .withStage("setupCanary", "Setup Canary", setupCanaryContext) .withStage("metricSetMixer", "Mix Control and Experiment Results", mixMetricSetsContext) .withStage("canaryJudge", "Perform Analysis", canaryJudgeContext); pipelineBuilder.withStage((String)context.get("stageType"), (String)context.get("refId"), context)); fetchExperimentContexts.forEach((context) -> pipelineBuilder.withStage((String)context.get("stageType"), (String)context.get("refId"), context));
/** * Initiates the canary analysis execution Orca pipeline. * * @param canaryAnalysisConfig The configuration for the canary analysis execution. * @return Wrapper object around the execution id. */ public CanaryAnalysisExecutionResponse initiateCanaryAnalysisExecution(CanaryAnalysisConfig canaryAnalysisConfig) { String application = canaryAnalysisConfig.getApplication(); PipelineBuilder pipelineBuilder = new PipelineBuilder(application) .withName(CANARY_ANALYSIS_PIPELINE_NAME) .withPipelineConfigId(application + "-canary-analysis-referee-pipeline") .withStage( SetupAndExecuteCanariesStage.STAGE_TYPE, SetupAndExecuteCanariesStage.STAGE_DESCRIPTION, Maps.newHashMap(ImmutableMap.of( CANARY_ANALYSIS_CONFIG_CONTEXT_KEY, canaryAnalysisConfig ))); Execution pipeline = pipelineBuilder.withLimitConcurrent(false).build(); executionRepository.store(pipeline); try { executionLauncher.start(pipeline); } catch (Throwable t) { log.error("Failed to start pipeline", t); handleStartupFailure(pipeline, t); throw new RuntimeException("Failed to start the canary analysis pipeline execution"); } return CanaryAnalysisExecutionResponse.builder().canaryAnalysisExecutionId(pipeline.getId()).build(); }
public PipelineBuilder withStage(String type, String name) { return withStage(type, name, new HashMap<>()); }
public PipelineBuilder withStage(String type) { return withStage(type, type, new HashMap<>()); }
public PipelineBuilder withStages(List<Map<String, Object>> stages) { stages.forEach(it -> { String type = it.remove("type").toString(); String name = it.containsKey("name")? it.remove("name").toString() : null; withStage(type, name != null ? name : type, it); }); return this; }
.withName("Standard Canary Pipeline") .withPipelineConfigId(canaryPipelineConfigId) .withStage("setupCanary", "Setup Canary", setupCanaryContext) .withStage("canaryJudge", "Perform Analysis with Judge 1", canaryJudgeContext1) .withStage("canaryJudge", "Perform Analysis with Judge 2", canaryJudgeContext2) .withStage("compareJudgeResults", "Compare Judge Results", compareJudgeResultsContext);
.withName(PIPELINE_NAME) .withPipelineConfigId(canaryPipelineConfigId) .withStage("setupCanary", "Setup Canary", setupCanaryContext) .withStage("metricSetMixer", "Mix Control and Experiment Results", mixMetricSetsContext) .withStage("canaryJudge", "Perform Analysis", canaryJudgeContext); pipelineBuilder.withStage((String)context.get("stageType"), (String)context.get("refId"), context)); fetchExperimentContexts.forEach((context) -> pipelineBuilder.withStage((String)context.get("stageType"), (String)context.get("refId"), context));
/** * Initiates the canary analysis execution Orca pipeline. * * @param canaryAnalysisConfig The configuration for the canary analysis execution. * @return Wrapper object around the execution id. */ public CanaryAnalysisExecutionResponse initiateCanaryAnalysisExecution(CanaryAnalysisConfig canaryAnalysisConfig) { String application = canaryAnalysisConfig.getApplication(); PipelineBuilder pipelineBuilder = new PipelineBuilder(application) .withName(CANARY_ANALYSIS_PIPELINE_NAME) .withPipelineConfigId(application + "-canary-analysis-referee-pipeline") .withStage( SetupAndExecuteCanariesStage.STAGE_TYPE, SetupAndExecuteCanariesStage.STAGE_DESCRIPTION, Maps.newHashMap(ImmutableMap.of( CANARY_ANALYSIS_CONFIG_CONTEXT_KEY, canaryAnalysisConfig ))); Execution pipeline = pipelineBuilder.withLimitConcurrent(false).build(); executionRepository.store(pipeline); try { executionLauncher.start(pipeline); } catch (Throwable t) { log.error("Failed to start pipeline", t); handleStartupFailure(pipeline, t); throw new RuntimeException("Failed to start the canary analysis pipeline execution"); } return CanaryAnalysisExecutionResponse.builder().canaryAnalysisExecutionId(pipeline.getId()).build(); }