use of com.epam.pipeline.entity.configuration.PipeConfValueVO in project cloud-pipeline by epam.
the class PipelineConfigurationManager method updateMasterConfiguration.
public void updateMasterConfiguration(PipelineConfiguration configuration, boolean isNFS) {
configuration.setClusterRole(MASTER_CLUSTER_ROLE);
if (isNFS) {
configuration.getParameters().put(NFS_CLUSTER_ROLE, new PipeConfValueVO("true"));
}
configuration.buildEnvVariables();
}
use of com.epam.pipeline.entity.configuration.PipeConfValueVO in project cloud-pipeline by epam.
the class PipelineConfigurationManager method updateWorkerConfiguration.
public void updateWorkerConfiguration(String parentId, PipelineStart runVO, PipelineConfiguration configuration, boolean isNFS, boolean clearParams) {
configuration.setEraseRunEndpoints(hasBooleanParameter(configuration, ERASE_WORKER_ENDPOINTS));
Map<String, PipeConfValueVO> updatedParams = clearParams ? new HashMap<>() : configuration.getParameters();
updatedParams.put(PipelineRun.PARENT_ID_PARAM, new PipeConfValueVO(parentId));
if (isNFS) {
updatedParams.put(NFS_CLUSTER_ROLE, new PipeConfValueVO("true"));
} else {
updatedParams.remove(NFS_CLUSTER_ROLE);
}
configuration.setParameters(updatedParams);
configuration.setClusterRole(WORKER_CLUSTER_ROLE);
configuration.setCmdTemplate(StringUtils.hasText(runVO.getWorkerCmd()) ? runVO.getWorkerCmd() : WORKER_CMD_TEMPLATE);
// remove node count parameter for workers
configuration.setNodeCount(null);
configuration.buildEnvVariables();
}
use of com.epam.pipeline.entity.configuration.PipeConfValueVO in project cloud-pipeline by epam.
the class ToolVersionDaoTest method shouldCRUDWithSettings.
@Test
public void shouldCRUDWithSettings() {
Long toolId = tool.getId();
PipelineConfiguration pipelineConfiguration = new PipelineConfiguration();
pipelineConfiguration.setCmdTemplate(TEST_CMD_TEMPLATE_1);
pipelineConfiguration.setNodeCount(TEST_NODE_COUNT);
pipelineConfiguration.setParameters(Collections.singletonMap(TEST_PARAMETER_NAME, new PipeConfValueVO(TEST_PARAMETER_VALUE)));
ConfigurationEntry configurationEntry = new ConfigurationEntry(pipelineConfiguration);
List<ConfigurationEntry> settings = Collections.singletonList(configurationEntry);
toolVersion1.setSettings(settings);
toolVersionDao.createToolVersionWithSettings(toolVersion1);
ToolVersion actual = toolVersionDao.loadToolVersionWithSettings(toolId, TEST_VERSION).orElse(null);
validateToolVersionSettings(actual, configurationEntry, TEST_VERSION, toolId, TEST_PARAMETER_NAME);
pipelineConfiguration.setCmdTemplate(TEST_CMD_TEMPLATE_2);
configurationEntry.setConfiguration(pipelineConfiguration);
settings = Collections.singletonList(configurationEntry);
toolVersion1.setSettings(settings);
toolVersionDao.updateToolVersionWithSettings(toolVersion1);
actual = toolVersionDao.loadToolVersionWithSettings(toolId, TEST_VERSION).orElse(null);
validateToolVersionSettings(actual, configurationEntry, TEST_VERSION, toolId, TEST_PARAMETER_NAME);
toolVersionDao.deleteToolVersions(toolId);
actual = toolVersionDao.loadToolVersion(toolId, TEST_VERSION).orElse(null);
assertThat(actual).isNull();
}
use of com.epam.pipeline.entity.configuration.PipeConfValueVO in project cloud-pipeline by epam.
the class PipelineConfigurationManagerTest method getPipelineStartVO.
private PipelineStart getPipelineStartVO() {
PipelineStart vo = new PipelineStart();
vo.setInstanceType(TEST_INSTANCE_TYPE);
vo.setDockerImage(tool.getImage());
vo.setHddSize(1);
vo.setCmdTemplate("template");
vo.setTimeout(TEST_TIMEOUT);
vo.setNodeCount(1);
vo.setIsSpot(true);
vo.setParams(Collections.singletonMap("testParam", new PipeConfValueVO("testParamValue", "int", true)));
return vo;
}
use of com.epam.pipeline.entity.configuration.PipeConfValueVO in project cloud-pipeline by epam.
the class PipelineRunTest method shouldReturnValidStringWithType.
@Test
public void shouldReturnValidStringWithType() {
PipelineRun pipelineRun = new PipelineRun();
Map<String, PipeConfValueVO> params = new HashMap<>();
params.put(PARAM1_NAME, new PipeConfValueVO(PARAM1_VALUE, PARAM1_TYPE));
params.put(PARAM2_NAME, new PipeConfValueVO(PARAM2_VALUE, PARAM2_TYPE));
pipelineRun.convertParamsToString(params);
assertThat(pipelineRun.getParams(), is(glueParams(glueParam(PARAM1_NAME, PARAM1_VALUE, PARAM1_TYPE), glueParam(PARAM2_NAME, PARAM2_VALUE, PARAM2_TYPE))));
}
Aggregations