Compare commits
15 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
6199730156 | |
|
|
11f46dae2b | |
|
|
2184106da2 | |
|
|
771bbd68ab | |
|
|
bba4980083 | |
|
|
2275fe2b37 | |
|
|
f2253b98ae | |
|
|
34b34266b6 | |
|
|
90c2d3cea3 | |
|
|
034c658e4e | |
|
|
ef1c29dc4c | |
|
|
a84bae802f | |
|
|
610302ebe6 | |
|
|
ccd84e3a55 | |
|
|
893295a402 |
|
|
@ -361,7 +361,7 @@ public class K8sService {
|
|||
if (StringUtils.isNotEmpty(nodeSelectMapKey)) {
|
||||
nodeSelectMap.put(nodeSelectMapKey, "true");
|
||||
} else {
|
||||
nodeSelectMap.put("braincloud", "others");// 普通实训
|
||||
nodeSelectMap.put("type", "others");// 普通实训
|
||||
}
|
||||
if (createImage != null && createImage) {
|
||||
nodeSelectMap.put("forevernode", "true");// 永久节点
|
||||
|
|
|
|||
|
|
@ -68,7 +68,7 @@ public class SysConfigService {
|
|||
if (sysConfig.getStatus().equals(SysConfigCsts.STATUS_ENABLE) && !expired) {// 任务进行中,并且未过期
|
||||
return null; // 返回null,加锁不成功
|
||||
}
|
||||
param.setVal("172.16.94.254");
|
||||
|
||||
|
||||
updateSysConfig(sysConfig, param);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,6 +47,8 @@ public class AppConfig {
|
|||
|
||||
@Value("${gitIP}")
|
||||
private String gitIP;
|
||||
@Value("${gitDomain}")
|
||||
private String gitDomain;
|
||||
|
||||
@Value("${gitBackUpIP}")
|
||||
private String gitBackUpIP;
|
||||
|
|
@ -441,4 +443,8 @@ public class AppConfig {
|
|||
public String getFixedServicePort() {
|
||||
return fixedServicePort;
|
||||
}
|
||||
|
||||
public String getGitDomain() {
|
||||
return gitDomain;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -46,7 +46,7 @@ public class DelExpiredPodTask {
|
|||
boolean hasHandle = false;
|
||||
final SysConfig configParam = new SysConfig();
|
||||
configParam.setName(SysConfigCsts.CONFIG_POD_MANAGE);
|
||||
configParam.setVal(appConfig.getBridgeInstanceName());
|
||||
configParam.setVal("10.16.22.23");
|
||||
while (true) {
|
||||
hasHandle = false;
|
||||
SysConfig sysConfig = null;
|
||||
|
|
@ -86,7 +86,7 @@ public class DelExpiredPodTask {
|
|||
}
|
||||
|
||||
if (!hasHandle) {
|
||||
ThreadUtils.sleep(1000);
|
||||
ThreadUtils.sleep(10000);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -26,14 +26,16 @@ registry=BRI_DOCKER_REGISTRY
|
|||
|
||||
|
||||
#GIT_IP
|
||||
gitIP=121.41.90.210
|
||||
gitBackUpIP=121.41.90.210
|
||||
gitPort=64300
|
||||
gitIP=10.16.22.23
|
||||
gitDomain=ide-kyxt.pcl.ac.cn
|
||||
gitBackUpIP=websvc:8080
|
||||
gitPort=9000
|
||||
gitBackupDirs=/opt/repositories/2018,/opt/repositories/2018-2
|
||||
gitRepoDir=/data/repositories
|
||||
#git\u7528\u6237\u540d\u53ca\u5bc6\u7801
|
||||
gitUsername=wangwei10061
|
||||
gitPassword=zq123456
|
||||
gitUsername=edugit
|
||||
gitPassword=xinedugit#
|
||||
|
||||
|
||||
workspace=/data/workspace
|
||||
secretWorkspace=/opt/workspace/secret
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ public class VscodeController extends BasicController {
|
|||
private static final String C_IMAGE_NAME = "W3siaW1hZ2UiOiJnY2MtY29kZXNlcnZlci13dzp2MS4wIiwiY3B1TGltaXQiOjIuMCwiY3B1UmVxdWVzdCI6MC4zLCJtZW1vcnlMaW1pdCI6IjIwNDhNIiwibWVtb3J5UmVxdWVzdCI6IjEwMjRNIiwicmVzb3VyY2VMaW1pdCI6IjEwMDAwSyIsInN0YXJ0VGltZSI6MjAwLCJ0eXBlIjoibWFpbiJ9XQo=";
|
||||
private static final String JAVA_IMAGE_NAME = "W3siaW1hZ2UiOiJ2c2NvZGUtd3c6djEuMCIsImNwdUxpbWl0IjoyLjAsImNwdVJlcXVlc3QiOjAuMywibWVtb3J5TGltaXQiOiIyMDQ4TSIsIm1lbW9yeVJlcXVlc3QiOiIxMDI0TSIsInJlc291cmNlTGltaXQiOiIxMDAwMEsiLCJzdGFydFRpbWUiOjIwMCwidHlwZSI6Im1haW4ifV0K";
|
||||
private static final String PYTHON_IMAGE_NAME = "W3siaW1hZ2UiOiJweXRob24zZDctY29kZXNlcnZlcjp2MS4wIiwiY3B1TGltaXQiOjIuMCwiY3B1UmVxdWVzdCI6MC4zLCJtZW1vcnlMaW1pdCI6IjIwNDhNIiwibWVtb3J5UmVxdWVzdCI6IjEwMjRNIiwicmVzb3VyY2VMaW1pdCI6IjEwMDAwSyIsInN0YXJ0VGltZSI6MjAwLCJ0eXBlIjoibWFpbiJ9XQo=";
|
||||
|
||||
|
||||
|
||||
@Autowired
|
||||
private VscodeService vscodeService;
|
||||
|
|
@ -90,8 +90,6 @@ public class VscodeController extends BasicController {
|
|||
return actionResultWithBindingResult(ErrorCodeEnum.BIND_EXCEPTION,bindingResult);
|
||||
}
|
||||
vsCodeParam.setTpiID(StringUtil.getPodName(vsCodeParam.getProjectId(),vsCodeParam.getUserId()).toLowerCase(Locale.ROOT));
|
||||
vsCodeParam.setTpiID(vsCodeParam.getTpiID().replace("_", "-"));
|
||||
vsCodeParam.setSurvivalSecond(3600 * 10);
|
||||
logger.info("[start]获取vscode连接信息 {}", JSONObject.toJSONString(vsCodeParam));
|
||||
JSONObject resp = new JSONObject();
|
||||
|
||||
|
|
@ -111,16 +109,16 @@ public class VscodeController extends BasicController {
|
|||
}
|
||||
|
||||
if ("c".equals(vsCodeParam.getLanguage().toLowerCase(Locale.ROOT))){
|
||||
vsCodeParam.setContainers(C_IMAGE_NAME);
|
||||
vsCodeParam.setContainers(PYTHON_IMAGE_NAME);
|
||||
}else if("java".equals(vsCodeParam.getLanguage().toLowerCase(Locale.ROOT))){
|
||||
vsCodeParam.setContainers(JAVA_IMAGE_NAME);
|
||||
vsCodeParam.setContainers(PYTHON_IMAGE_NAME);
|
||||
}else if("python".equals(vsCodeParam.getLanguage().toLowerCase(Locale.ROOT))){
|
||||
vsCodeParam.setContainers(PYTHON_IMAGE_NAME);
|
||||
}else{
|
||||
vsCodeParam.setContainers(PYTHON_IMAGE_NAME);
|
||||
}
|
||||
|
||||
containers = Base64Util.decode(vsCodeParam.getContainers());
|
||||
containers = Base64Util.decode(PYTHON_IMAGE_NAME);
|
||||
|
||||
|
||||
boolean createImage = vsCodeParam.getCreateImage() != null && vsCodeParam.getCreateImage();
|
||||
|
|
@ -164,8 +162,10 @@ public class VscodeController extends BasicController {
|
|||
Map<String, Object> respData = new HashMap<>(2);
|
||||
respData.put("url", targetUrl);
|
||||
|
||||
String podName = TpUtils.buildWebPodName(vsCodeParam.getTpiID(), vsCodeParam.getPodType());
|
||||
RunPod runPod = runPodService.getRunPodByName(podName);
|
||||
//存活秒数
|
||||
respData.put("remainingTime", 3600 * 10);
|
||||
respData.put("remainingTime",99999999999L);
|
||||
return R.ok().setData(respData);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -117,7 +117,9 @@ public class GameService {
|
|||
// 执行克隆操作
|
||||
String cmd = "cd " + tpiWorkSpace + " && git clone -o " + remoteName + " " + depth + " " + tpmGitURL + " " + tpiRepoName + " && cd "
|
||||
+ tpiRepoName + " && git config user.email educoder@163.com && git config user.name educoder";
|
||||
|
||||
ShellResult result = ShellUtil.executeAndGetExitStatus(cmd, 3);
|
||||
logger.info("执行克隆命令:{}, out:{}",cmd,result.getOut());
|
||||
if (result.getExitStatus() != 0) {
|
||||
if (result.getOut().contains("already exists")) {
|
||||
logger.warn("tpiWorkSpace:{} 共享磁盘同步延迟,未及时检测到文件已经存在!e: {}, cmd: {}", tpiWorkSpace, result, cmd);
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class GitAccountService {
|
|||
private final Logger logger = LoggerFactory.getLogger(getClass());
|
||||
|
||||
public void gitCredentialStore(String gitIP, String protocol) throws BusinessException {
|
||||
String cmd = "echo -e 'protocol=" + protocol + "\nhost=" + gitIP + "' | git credential-store get";
|
||||
String cmd = "echo -e 'protocol=" + protocol + " host=" + gitIP + "' | git credential-store get";
|
||||
ShellResult result = ShellUtil.executeAndGetExitStatus(cmd, 3);
|
||||
if (result.getExitStatus() != 0) {
|
||||
logger.error("获取git凭证失败!gitIP: {} e:{}", gitIP, result);
|
||||
|
|
@ -37,7 +37,7 @@ public class GitAccountService {
|
|||
if (StringUtils.isEmpty(out) || !out.contains(username) || !out.contains(password)) {
|
||||
String setCmd = "git config --global user.email educoder@163.com"
|
||||
+ " && git config --global user.name wangwei10061" + " && git config --global credential.helper store"
|
||||
+ " && echo -e 'protocol=" + protocol + "\nhost=" + gitIP + "\nusername=" + username + "\npassword="
|
||||
+ " && echo -e 'protocol=" + protocol + " host=" + gitIP + " username=" + username + " password="
|
||||
+ password + "' | git credential approve";
|
||||
setGitCredential(setCmd, gitIP);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public class GitInitTask {
|
|||
public void init() {
|
||||
String gitHost = appConfig.getGitIP();
|
||||
gitAccountService.gitCredentialStore(gitHost, "http");
|
||||
String gitDomainName = "git.educoder.net";
|
||||
String gitDomainName = appConfig.getGitDomain();
|
||||
gitAccountService.gitCredentialStore(gitDomainName, "https");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@ spring.config.import=classpath:common.properties
|
|||
|
||||
# mysql
|
||||
spring.datasource.driver-class-name=com.mysql.jdbc.Driver
|
||||
spring.datasource.url=jdbc:mysql://rm-bp13v5020p7828r5r.mysql.rds.aliyuncs.com:3306/braincloud?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
|
||||
spring.datasource.url=jdbc:mysql://rm-bp13v5020p7828r5rso.mysql.rds.aliyuncs.com:3306/braincloud?useUnicode=true&characterEncoding=utf8&autoReconnect=true&failOverReadOnly=false
|
||||
spring.datasource.username=testeducoder
|
||||
spring.datasource.password=TEST@123
|
||||
spring.datasource.type=com.alibaba.druid.pool.DruidDataSource
|
||||
|
|
|
|||
Loading…
Reference in New Issue