Compare commits

...

3 Commits
master ... dev

Author SHA1 Message Date
郑明仁 1aa01f11f0 增加buildResUsage日志 2019-09-30 10:45:50 +08:00
郑明仁 ee166b61e6 增加buildResUsage日志 2019-09-30 10:44:55 +08:00
郑明仁 bb3749a309 增加评测端口分配与创建pod service日志 2019-09-30 10:33:57 +08:00
3 changed files with 8 additions and 4 deletions

View File

@ -232,7 +232,7 @@ public class GameController {
if (StringUtils.isEmpty(port)) {
port = portService.allocatePort() + "";
}
logger.debug("评测端口映射服务,分配端口 podName: {}, port: {}", podName, port);
logger.info("评测端口映射服务,分配端口 tpiID: {}, port: {}", tpiID, port);
JedisUtil.hset("port", podName, port);
}

View File

@ -572,6 +572,7 @@ public class GameService {
resUsage.setTestSetUsages(list);
} else {
resUsageStr = Base64Util.decode(resUsageStr);
logger.info("buildResUsage, resUsageStr: {}", resUsageStr);
JSONObject resUsageJson = JSONObject.parseObject(resUsageStr);
resUsage.setRunMaxMem(resUsageJson.getLong("runMaxMem"));
List<TestSetUsage> list = new ArrayList<>();

View File

@ -158,10 +158,13 @@ public class RunPodService {
}
if (pod != null) {
// 按需创建端口映射svc
if (buildParams.getInteger("needPortMapping") != -1 && buildParams.getInteger("needPortMapping") != 0) {
Integer needPortMapping = buildParams.getInteger("needPortMapping");
if (needPortMapping != -1 && needPortMapping != 0) {
if (!k8sService.svcExist(podName)) {
k8sService.createService(podName, tpiID, buildParams.getInteger("needPortMapping"),
Integer.parseInt(JedisUtil.hget("port", podName)));
String portStr = JedisUtil.hget("port", podName);
logger.info("create run pod service, tipID: {}, needPort: {}, nodePort: {}", tpiID, needPortMapping, portStr);
Integer port = Integer.parseInt(portStr);
k8sService.createService(podName, tpiID, needPortMapping, port);
}
}
}