| @@ -144,10 +144,10 @@ public class ExperimentInsController extends BaseController { | |||||
| } | } | ||||
| @GetMapping("/pods/realtimelog") | |||||
| @GetMapping("/pods/realTimeLog") | |||||
| @ApiOperation("获取pod实时日志请求") | @ApiOperation("获取pod实时日志请求") | ||||
| public GenericsAjaxResult<String> getRealtimePodLogFromPod(@RequestParam("pod_name") String podName, | |||||
| @RequestParam("namespace") String namespace){ | |||||
| public GenericsAjaxResult<String> getRealtimePodLogFromPod(@PathVariable("pod_name") String podName, | |||||
| @PathVariable("namespace") String namespace){ | |||||
| return genericsSuccess(this.experimentInsService.getRealtimePodLogFromPod(podName,namespace)); | return genericsSuccess(this.experimentInsService.getRealtimePodLogFromPod(podName,namespace)); | ||||
| } | } | ||||
| @@ -10,6 +10,7 @@ import com.ruoyi.platform.service.ExperimentInsService; | |||||
| import com.ruoyi.platform.service.ExperimentService; | import com.ruoyi.platform.service.ExperimentService; | ||||
| import com.ruoyi.platform.service.WorkflowService; | import com.ruoyi.platform.service.WorkflowService; | ||||
| import com.ruoyi.platform.utils.HttpUtils; | import com.ruoyi.platform.utils.HttpUtils; | ||||
| import com.ruoyi.platform.utils.JacksonUtil; | |||||
| import com.ruoyi.platform.utils.JsonUtils; | import com.ruoyi.platform.utils.JsonUtils; | ||||
| import com.ruoyi.system.api.model.LoginUser; | import com.ruoyi.system.api.model.LoginUser; | ||||
| import org.apache.commons.collections4.MapUtils; | import org.apache.commons.collections4.MapUtils; | ||||
| @@ -225,8 +226,11 @@ public class ExperimentServiceImpl implements ExperimentService { | |||||
| // 组装运行接口json | // 组装运行接口json | ||||
| Map<String, Object> runReqMap = new HashMap<>(); | Map<String, Object> runReqMap = new HashMap<>(); | ||||
| runReqMap.put("data", converMap.get("data")); | runReqMap.put("data", converMap.get("data")); | ||||
| runReqMap.put("params", JsonUtils.jsonToMap(StringUtils.isEmpty(experiment.getGlobalParam())?"{}":experiment.getGlobalParam())); | |||||
| List<Map<String, Object>> params = JacksonUtil.parseJSONStr2MapList(StringUtils.isEmpty(experiment.getGlobalParam()) ? "[]" : experiment.getGlobalParam()); | |||||
| runReqMap.put("params", params); | |||||
| //runReqMap.put("params", JsonUtils.jsonToMap(StringUtils.isEmpty(experiment.getGlobalParam())?"{}":experiment.getGlobalParam())); | |||||
| runReqMap.put("experiment", new HashMap<String, Object>().put("name", "experiment-"+experiment.getId())); | runReqMap.put("experiment", new HashMap<String, Object>().put("name", "experiment-"+experiment.getId())); | ||||
| Map<String ,Object> output = (Map<String, Object>) converMap.get("output"); | Map<String ,Object> output = (Map<String, Object>) converMap.get("output"); | ||||
| // 调argo运行接口 | // 调argo运行接口 | ||||
| String runRes = HttpUtils.sendPost(argoUrl + argoWorkflowRun, JsonUtils.mapToJson(runReqMap)); | String runRes = HttpUtils.sendPost(argoUrl + argoWorkflowRun, JsonUtils.mapToJson(runReqMap)); | ||||
| @@ -84,7 +84,7 @@ | |||||
| and global_param = #{experiment.globalParam} | and global_param = #{experiment.globalParam} | ||||
| </if> | </if> | ||||
| <if test="experiment.statusList != null and experiment.statusList != ''"> | <if test="experiment.statusList != null and experiment.statusList != ''"> | ||||
| status_list = #{experiment.statusList}, | |||||
| status_list = #{experiment.statusList} | |||||
| </if> | </if> | ||||
| <if test="experiment.description != null and experiment.description != ''"> | <if test="experiment.description != null and experiment.description != ''"> | ||||
| and description = #{experiment.description} | and description = #{experiment.description} | ||||
| @@ -125,7 +125,7 @@ | |||||
| and global_param = #{experiment.globalParam} | and global_param = #{experiment.globalParam} | ||||
| </if> | </if> | ||||
| <if test="experiment.statusList != null and experiment.statusList != ''"> | <if test="experiment.statusList != null and experiment.statusList != ''"> | ||||
| status_list = #{experiment.statusList}, | |||||
| status_list = #{experiment.statusList} | |||||
| </if> | </if> | ||||
| <if test="experiment.description != null and experiment.description != ''"> | <if test="experiment.description != null and experiment.description != ''"> | ||||
| and description = #{experiment.description} | and description = #{experiment.description} | ||||
| @@ -148,7 +148,7 @@ | |||||
| <!--新增所有列--> | <!--新增所有列--> | ||||
| <insert id="insert" keyProperty="id" useGeneratedKeys="true"> | <insert id="insert" keyProperty="id" useGeneratedKeys="true"> | ||||
| insert into experiment(name,workflow_id, global_param, status_list, description, create_by, create_time, update_by, update_time, state) | insert into experiment(name,workflow_id, global_param, status_list, description, create_by, create_time, update_by, update_time, state) | ||||
| values (#{experiment.name},#{experiment.workflowId}, #{experiment.globalParam},#{experiment.statusList}, #{experiment.description}, #{experiment.createBy}, #{experiment.createTime}, #{experiment.updateBy}, #{experiment.updateTime}, #{experiment.state}) | |||||
| values (#{experiment.name},#{experiment.workflowId}, #{experiment.globalParam},#{experiment.statusList}, #{experiment.description}, #{experiment.createBy}, #{experiment.createTime}, #{experiment.updateBy}, #{experiment.updateTime}, #{experiment.state}) | |||||
| </insert> | </insert> | ||||
| <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> | <insert id="insertBatch" keyProperty="id" useGeneratedKeys="true"> | ||||
| @@ -248,7 +248,7 @@ | |||||
| nodes_logs = #{experimentIns.nodesLogs}, | nodes_logs = #{experimentIns.nodesLogs}, | ||||
| </if> | </if> | ||||
| <if test="experimentIns.globalParam != null and experimentIns.globalParam != ''"> | <if test="experimentIns.globalParam != null and experimentIns.globalParam != ''"> | ||||
| global_param = #{experimentIns.globalParam} | |||||
| global_param = #{experimentIns.globalParam}, | |||||
| </if> | </if> | ||||
| <if test="experimentIns.startTime != null"> | <if test="experimentIns.startTime != null"> | ||||
| start_time = #{experimentIns.startTime}, | start_time = #{experimentIns.startTime}, | ||||
| @@ -18,7 +18,7 @@ | |||||
| <!--查询单个--> | <!--查询单个--> | ||||
| <select id="queryById" resultMap="WorkflowMap"> | <select id="queryById" resultMap="WorkflowMap"> | ||||
| select | select | ||||
| id, name, description, dag, global_param, create_by, create_time, update_by, update_time, state | |||||
| id, name, description, dag, global_param, create_by, create_time, update_by, update_time, state | |||||
| from workflow | from workflow | ||||
| where id = #{id} and state = 1 | where id = #{id} and state = 1 | ||||
| </select> | </select> | ||||
| @@ -147,7 +147,7 @@ | |||||
| dag = #{workflow.dag}, | dag = #{workflow.dag}, | ||||
| </if> | </if> | ||||
| <if test="workflow.globalParam != null and workflow.globalParam != ''"> | <if test="workflow.globalParam != null and workflow.globalParam != ''"> | ||||
| global_param = #{workflow.globalParam} | |||||
| global_param = #{workflow.globalParam}, | |||||
| </if> | </if> | ||||
| <if test="workflow.createBy != null and workflow.createBy != ''"> | <if test="workflow.createBy != null and workflow.createBy != ''"> | ||||
| create_by = #{workflow.createBy}, | create_by = #{workflow.createBy}, | ||||