Browse Source

暴露远程docker端口

wangyi 3 years ago
parent
commit
8b5168893a

+ 4 - 1
src/main/java/io/renren/modules/sys/controller/algs/algTrainController.java

@@ -44,6 +44,9 @@ public class algTrainController {
     //获取host地址
     @Value("${host}")
     private String host;
+    //获取远程连接docker ip地址
+    @Value("${remote-docker}")
+    private String remoteDocker;
     @Autowired
     AlgTrainServiceImpl algTrainService;
     @Autowired
@@ -187,7 +190,7 @@ public class algTrainController {
         //保存该训练任务所在容器id
         algTrain.setContainerId(containerId);
         //保存该容器对外暴露的tensorboard端口
-        algTrain.setIpAddress("http://"+host+":"+portInt);
+        algTrain.setIpAddress("http://"+remoteDocker+":"+portInt);
         algTrainService.update(algTrain);
         return R.ok();
 

+ 6 - 5
src/main/resources/application.yml

@@ -19,6 +19,7 @@ minio:
 docker:
   #url: https://192.168.25.101:2376
   url: https://10.168.57.11:2376
+remote-docker: 10.168.57.11
 #上传文件到远程服务器地址,用户名及密码,上传文件的基础路径
 host: 10.168.57.11
 host-username: root
@@ -26,13 +27,13 @@ host-password: root
 host-basepath: /opt/uploadFile
 host-port: 22
 key-needed: false
-key-location: F:/Program Files/secretKey/lab1
+key-location: D:/Program Files/secretKey/lab1
 
 #docker证书存放路径
-docker_ca: F:/aiplat/school_ca
+docker_ca: D:/aiplat/school_ca
 
 #minio暂存文件地址
-tempFileLocation: F:/aiplat/test0708/testPython.py
+tempFileLocation: D:/aiplat/test0708/testPython.py
 
 #获取kafka实时数据ip与端口
 realTimeKafka1: 10.168.57.10:9092
@@ -43,10 +44,10 @@ realTimeKafka3: 10.168.57.12:9092
 resultToDB: 10.168.57.10
 
 #数据预处理数据集存放文件夹
-datasetLocation: F:/aiplat/demoCSV
+datasetLocation: D:/aiplat/demoCSV
 
 #数据预处理python文件存放文件夹
-dataPreProcessLocation: F:/aiplat/dataPreProcess
+dataPreProcessLocation: D:/aiplat/dataPreProcess
 
 spring:
   # 环境 dev|test|prod