new PipelineBuilder(application) .withName("Standard Canary Pipeline") .withPipelineConfigId(canaryPipelineConfigId) .withStage("setupCanary", "Setup Canary", setupCanaryContext) .withStage("canaryJudge", "Perform Analysis with Judge 1", canaryJudgeContext1)
new PipelineBuilder(application) .withName(PIPELINE_NAME) .withPipelineConfigId(canaryPipelineConfigId) .withStage("setupCanary", "Setup Canary", setupCanaryContext) .withStage("metricSetMixer", "Mix Control and Experiment Results", mixMetricSetsContext)
/** * 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(); }
new PipelineBuilder(application) .withName("Standard Canary Pipeline") .withPipelineConfigId(canaryPipelineConfigId) .withStage("setupCanary", "Setup Canary", setupCanaryContext) .withStage("canaryJudge", "Perform Analysis with Judge 1", canaryJudgeContext1)
new PipelineBuilder(application) .withName(PIPELINE_NAME) .withPipelineConfigId(canaryPipelineConfigId) .withStage("setupCanary", "Setup Canary", setupCanaryContext) .withStage("metricSetMixer", "Mix Control and Experiment Results", mixMetricSetsContext)
private Execution parsePipeline(String configJson) throws IOException { // TODO: can we not just annotate the class properly to avoid all this? Map<String, Serializable> config = objectMapper.readValue(configJson, Map.class); return new PipelineBuilder(getString(config, "application")) .withName(getString(config, "name")) .withPipelineConfigId(getString(config, "id")) .withTrigger(objectMapper.convertValue(config.get("trigger"), Trigger.class)) .withStages((List<Map<String, Object>>) config.get("stages")) .withLimitConcurrent(getBoolean(config, "limitConcurrent")) .withKeepWaitingPipelines(getBoolean(config, "keepWaitingPipelines")) .withNotifications((List<Map<String, Object>>) config.get("notifications")) .withOrigin(getString(config, "origin")) .withStartTimeExpiry(getString(config, "startTimeExpiry")) .withSource((config.get("source") == null) ? null : objectMapper.convertValue(config.get("source"), Execution.PipelineSource.class)) .build(); }
/** * 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(); }