Search in sources :

Example 1 with GraphReader

use of com.epam.pipeline.manager.python.GraphReader in project cloud-pipeline by epam.

the class PipelineVersionManager method getWorkflowGraph.

public TaskGraphVO getWorkflowGraph(Long id, String version) {
    Pipeline pipeline = pipelineManager.load(id);
    try {
        gitManager.loadRevision(pipeline, version);
    } catch (GitClientException e) {
        LOGGER.error(e.getMessage(), e);
        throw new IllegalArgumentException(e.getMessage());
    }
    File config = gitManager.getConfigFile(pipeline, version);
    TaskGraphVO result = new GraphReader().readGraph(graphScript, config.getParentFile().getAbsolutePath(), CONFIG_FILE_NAME);
    mergeToolsRequirements(result);
    try {
        FileUtils.deleteDirectory(config.getParentFile());
    } catch (IOException e) {
        LOGGER.error(e.getMessage(), e);
    }
    return result;
}
Also used : GraphReader(com.epam.pipeline.manager.python.GraphReader) GitClientException(com.epam.pipeline.exception.git.GitClientException) TaskGraphVO(com.epam.pipeline.controller.vo.TaskGraphVO) IOException(java.io.IOException) File(java.io.File) Pipeline(com.epam.pipeline.entity.pipeline.Pipeline)

Aggregations

TaskGraphVO (com.epam.pipeline.controller.vo.TaskGraphVO)1 Pipeline (com.epam.pipeline.entity.pipeline.Pipeline)1 GitClientException (com.epam.pipeline.exception.git.GitClientException)1 GraphReader (com.epam.pipeline.manager.python.GraphReader)1 File (java.io.File)1 IOException (java.io.IOException)1