Compare commits
3 Commits
Author | SHA1 | Date |
---|---|---|
郑明仁 | 1aa01f11f0 | |
郑明仁 | ee166b61e6 | |
郑明仁 | bb3749a309 |
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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<>();
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue