|
@@ -112,18 +112,19 @@ public class ProjectManager {
|
|
|
String replace17 = replace16.replace("namespace-name", kubernetesConfiguration.getNamespace()); // pod 名称包括 projectId 和 随机字符串
|
|
|
String replace18 = replace17.replace("node-name", nodeName); // 指定 pod 运行节点
|
|
|
|
|
|
- String finalYaml = null;
|
|
|
+ String finalYaml;
|
|
|
if (DictConstants.USE_GPU.equals(isChoiceGpu)) {
|
|
|
log.info("项目 " + projectId + " 使用 gpu 生成视频");
|
|
|
log.info("createTempYaml() k8s参数为:" + kubernetesConfiguration);
|
|
|
log.info("createTempYaml() yaml模板为:" + replace12);
|
|
|
String replace19 = replace18.replace("vtd-image", kubernetesConfiguration.getImageVtdGpu());
|
|
|
- finalYaml = replace19.replace("vtd-command", kubernetesConfiguration.getCommandVtdCarsimNogpu());
|
|
|
- }
|
|
|
- if (DictConstants.NOT_USE_GPU.equals(isChoiceGpu)) {
|
|
|
+ finalYaml = replace19.replace("vtd-command", kubernetesConfiguration.getCommandVtdCarsimGpu());
|
|
|
+ } else if (DictConstants.NOT_USE_GPU.equals(isChoiceGpu)) {
|
|
|
log.info("项目 " + projectId + " 不使用 gpu 生成视频");
|
|
|
String replace19 = replace18.replace("vtd-image", kubernetesConfiguration.getImageVtdNogpu());
|
|
|
finalYaml = replace19.replace("vtd-command", kubernetesConfiguration.getCommandVtdCarsimNogpu());
|
|
|
+ } else {
|
|
|
+ throw new RuntimeException("createTempYaml() 是否使用 gpu:" + isChoiceGpu);
|
|
|
}
|
|
|
log.info("保存项目 " + projectId + " 的 yaml 文件:" + finalYaml);
|
|
|
FileUtil.writeStringToLocalFile(finalYaml, podYamlDirectory + podYaml);
|
|
@@ -131,7 +132,5 @@ public class ProjectManager {
|
|
|
} else {
|
|
|
throw new RuntimeException("createTempYaml() 模型类型错误:" + modelType);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
}
|
|
|
}
|