update code

main
haha 2024-08-20 23:16:55 +08:00
parent 911b92a82c
commit dfa39efef9
7 changed files with 159 additions and 106 deletions

View File

@ -36,11 +36,20 @@ const compileDeploy=(operation_id)=>{
}); });
} }
//获取推理最新的模型推理日志
const inferenceTaskLatest=task_id=>{
return request({
url: `/logs/inference/${task_id}/latest`,
method: "get"
});
}
export default { export default {
serverState, serverState,
userOperationNotice, userOperationNotice,
userOperation, userOperation,
compileDeploy, compileDeploy,
userRunning userRunning,
inferenceTaskLatest
} }

View File

@ -1,9 +1,10 @@
import request from "@/utils/request"; import request from "@/utils/request";
//获取任务列表 //获取任务列表
const tasks = () => { const tasks = (data) => {
return request({ return request({
url: '/tasks', url: '/tasks',
method: 'get' method: 'get',
params:data
}) })
} }
//获取可用的设备状态 //获取可用的设备状态

View File

@ -34,7 +34,7 @@
</template> </template>
<el-table v-loading="loading" ref="dataTb" :data="info.tableData" stripe @row-click="doRowClick"> <el-table v-loading="loading" ref="dataTb" :data="info.tableData" stripe @row-click="doRowClick">
<el-table-column width="55"> <el-table-column width="55" v-if="1 == 2">
<template #default="scope"> <template #default="scope">
<el-checkbox v-model="scope.row.checked" :disabled="!scope.row.available" /> <el-checkbox v-model="scope.row.checked" :disabled="!scope.row.available" />
</template> </template>
@ -65,7 +65,8 @@
</el-table-column> </el-table-column>
<el-table-column label="操作" align="center" width="100"> <el-table-column label="操作" align="center" width="100">
<template #default="scope"> <template #default="scope">
<el-button type="primary" text v-if="scope.row.available" size="default"></el-button> <el-button type="primary" @click="doCompile(scope.row)" text v-if="scope.row.available"
size="default">部署</el-button>
<span v-else style="color: #888;">部署</span> <span v-else style="color: #888;">部署</span>
</template> </template>
</el-table-column> </el-table-column>
@ -89,6 +90,7 @@
<script setup> <script setup>
import taskApi from "@/api/task"; import taskApi from "@/api/task";
import choiceToolsParamDlg from './choiceToolsParamDlg.vue'; import choiceToolsParamDlg from './choiceToolsParamDlg.vue';
const emit = defineEmits(["compile"]);
const props = defineProps({ const props = defineProps({
modelInfo: { modelInfo: {
type: Object, type: Object,
@ -113,7 +115,13 @@ const info = reactive({
logs: [], logs: [],
editItem: null, editItem: null,
}); });
const doCompile = (row) => {
if (!row.tool_params_id) {
ElMessage.error("请选择工具链运行参数列表!");
return;
}
emit("compile", row);
}
const doChoice = row => { const doChoice = row => {
info.editItem = row; info.editItem = row;
choiceToolParamDlg.value.showDialog(row); choiceToolParamDlg.value.showDialog(row);

View File

@ -11,11 +11,12 @@
<div style="margin-bottom:100px;" class="card-content"> <div style="margin-bottom:100px;" class="card-content">
<addStep1 ref="step1" v-if="active == 1" /> <addStep1 ref="step1" v-if="active == 1" />
<addStep2 ref="step2" v-if="active == 2" /> <addStep2 ref="step2" v-if="active == 2" />
<addStep3 ref="step3" v-if="active == 3" :modelInfo="modelInfo" /> <addStep3 ref="step3" v-if="active == 3" :modelInfo="modelInfo" @compile="doCompile" />
<addStep4 ref="step4" v-if="active == 4" /> <addStep4 ref="step4" v-if="active == 4" />
</div> </div>
<el-card class="card-footer"> <el-card class="card-footer">
<el-button type="primary" v-if="active == 3 && state == 0" @click="doCompile"></el-button> <!--
<el-button type="primary" v-if="active == 3 && state == 0" @click="doCompile"></el-button>-->
<el-button type="primary" v-if="active == 3 && state == 1" loading disabled>编译中...</el-button> <el-button type="primary" v-if="active == 3 && state == 1" loading disabled>编译中...</el-button>
<el-button type="primary" v-if="active == 3 && state == 2" loading disabled>部署中...</el-button> <el-button type="primary" v-if="active == 3 && state == 2" loading disabled>部署中...</el-button>
<el-button type="primary" v-if="active == 4" @click="doStart" :loading="state > 0" :disabled="state > 0">{{ state <el-button type="primary" v-if="active == 4" @click="doStart" :loading="state > 0" :disabled="state > 0">{{ state
@ -109,10 +110,11 @@ const startInference = () => {
}); });
} }
const doCompile = () => { const doCompile = (row) => {
let tmp = step3.value.checkForm(); debugger
let tmp = row;
if (tmp) { if (tmp) {
info.devices = tmp; info.devices = [tmp];
state.value = 1; state.value = 1;
step3.value.updateState(state.value); step3.value.updateState(state.value);
startComplie();// startComplie();//
@ -125,10 +127,12 @@ const doCompile = () => {
const startComplie = () => { const startComplie = () => {
let ajaxs = info.devices.map(d => { let ajaxs = info.devices.map(d => {
return inferenceApi.doCompile({ return inferenceApi.doCompile({
model_id: modelInfo.model_id, //model_id: modelInfo.model_id,
modl_net_type: modelInfo.modl_net_type, //modl_net_type: modelInfo.modl_net_type,
tool_params_id: d.tool_params_id, tool_params_id: d.tool_params_id,
device_id: d.device_id tool_id: d.tool_id,
device_id: d.device_id,
connection_id: modelInfo.connection_id
}); });
}) })
addLogs({ msg: "开始编译....", type: "info" }) addLogs({ msg: "开始编译....", type: "info" })

View File

@ -29,7 +29,7 @@
</el-dialog> </el-dialog>
<el-dialog v-model="info.showJsonDlg" title="查看工具链运行参数" :close-on-press-escape="false" :close-on-click-modal="false" <el-dialog v-model="info.showJsonDlg" title="查看工具链运行参数" :close-on-press-escape="false" :close-on-click-modal="false"
align-center append-to-body width="800px" modal-class="show-tool-param-dlg"> align-center append-to-body width="800px" modal-class="show-tool-param-dlg">
<pre v-html="info.showItem.params_content"></pre> <json-viewer :value="info.showItem.params_content" copyable boxed sort theme="my-json-view jv-light" />
<template #footer> <template #footer>
<div style="text-align: center"> <div style="text-align: center">
<el-button type="primary" @click="info.showJsonDlg = false">关闭</el-button> <el-button type="primary" @click="info.showJsonDlg = false">关闭</el-button>
@ -81,7 +81,7 @@ const showDialog = (opt) => {
const loadData = () => { const loadData = () => {
info.loading = true; info.loading = true;
toolApi.paramsList({ page_num: 1, page_size: 100, tool_id: info.data.tool_id }).then(d => { toolApi.paramsList({ page_num: 1, page_size: 100, tool_id: info.data.tool_id }).then(d => {
info.tableData = d.data.data.ParamsList || []; info.tableData = d.data.data.ToolParamsList || [];
info.loading = false; info.loading = false;
}); });
} }

View File

@ -1,20 +1,19 @@
<template> <template>
<div class="app-container simulation-execution"> <div class="app-container simulation-execution">
<el-card> <el-card>
<el-table v-loading="loading" ref="dataTb" :data="tableData" stripe height="400px" > <el-table v-loading="loading" ref="dataTb" :data="info.dataList" stripe height="400px">
<el-table-column label="推理任务名称" align="left" prop="taskName" /> <el-table-column label="推理任务名称" align="left" prop="task_name" />
<el-table-column label="模型名称" align="left" prop="modelName" /> <el-table-column label="模型名称" align="left" prop="model_name" />
<el-table-column label="模型类型" align="left" prop="modelType" /> <el-table-column label="模型类型" align="left" prop="modl_net_type" />
<el-table-column label="互联名称" align="left" prop="netName" /> <el-table-column label="互联名称" align="left" prop="connection_name" />
<el-table-column label="推理数据集名称" align="left" prop="datasName" /> <el-table-column label="推理数据集名称" align="left" prop="data_set_name" />
<el-table-column label="创建用户" width="120" align="left" prop="createUser" /> <el-table-column label="推理设备名称" align="left" prop="device_name" />
<el-table-column label="推理设备名称" align="left" prop="devName" /> <el-table-column label="运行状态" fixed="right" align="center" width="120" v-if="1 == 2">
<el-table-column label="运行状态" fixed="right" align="center" width="120">
<template #default="scope"> <template #default="scope">
<span :class="'run-state state-' + scope.row.state">{{ scope.row.state == 1 ? '完成' : '推理中' }}</span> <span :class="'run-state state-' + scope.row.state">{{ scope.row.state == 1 ? '完成' : '推理中' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" fixed="right" align="center" width="120"> <el-table-column label="操作" fixed="right" align="center" width="120" v-if="1 == 2">
<template #default="scope"> <template #default="scope">
<el-button text type="primary"> <el-button text type="primary">
<i-ep-circle-close />&nbsp;终止推理</el-button> <i-ep-circle-close />&nbsp;终止推理</el-button>
@ -22,7 +21,7 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
<pagination v-if="total > 0" v-model:total="total" v-model:page="queryParams.pageNum" <pagination v-model:total="total" v-model:page="queryParams.pageNum" v-if="1 == 2"
v-model:limit="queryParams.pageSize" @pagination="handleQuery" /> v-model:limit="queryParams.pageSize" @pagination="handleQuery" />
</el-card> </el-card>
<div style="margin-top:30px;font-size:12px;font-weight: bold;margin-left:8px;">推理日志</div> <div style="margin-top:30px;font-size:12px;font-weight: bold;margin-left:8px;">推理日志</div>
@ -36,7 +35,14 @@
</template> </template>
<script setup> <script setup>
import TaskApi from '@/api/task'
import LogsApi from '@/api/log'
import request from "axios";
let loading = ref(false) let loading = ref(false)
let info = reactive({
dataList: [],
logs: [],
})
const logList = reactive([ const logList = reactive([
{ date: '2024-05-06 18:34:36', log: '系统已启动编译' }, { date: '2024-05-06 18:34:36', log: '系统已启动编译' },
{ date: '2024-05-06 18:34:36', log: '系统正在分割目标文件' }, { date: '2024-05-06 18:34:36', log: '系统正在分割目标文件' },
@ -52,28 +58,46 @@ function handleQuery(a) {
queryParams.pageSize = a.limit; queryParams.pageSize = a.limit;
ElMessage.success("查询成功"); ElMessage.success("查询成功");
loading.value = false; loading.value = false;
} }
const loadLogs = () => {
let ajaxs = info.dataList.filter(it => it.state == 0).map(it => {
return LogsApi.inferenceTaskLatest(it.task_id)
});
request.all(ajaxs).then(d => {
debugger
});
};
const loadData = () => {
loading.value = true;
TaskApi.running().then(d => {
loading.value = false;
info.dataList = (d.data.data.running_task_list || []).map(it => {
it.device_name = (it.device_list || []).map(item => item.device_name).join(",");
it.state = 0;
return it;
});
loadLogs();
});
}
onMounted(loadData);
let tableData=reactive([
{id:"1",taskName:"人脸识别推理1",modelName:'进行人员检测的模型1',modelType:'图像分类',netName:'我的互联名称',datasName:'模型名称模型名称模型名称1',createUser:'User',devName:'Mobile-Vit',state:0},
{id:"2",taskName:"人脸识别推理2",modelName:'进行人员检测的模型2',modelType:'图像分类',netName:'我的互联名称',datasName:'模型名称模型名称模型名称2',createUser:'User',devName:'Mobile-Vit',state:1},
{id:"3",taskName:"人脸识别推理3",modelName:'进行人员检测的模型3',modelType:'图像分类',netName:'我的互联名称',datasName:'模型名称模型名称模型名称3',createUser:'User',devName:'Mobile-Vit',state:0},
{id:"4",taskName:"人脸识别推理4",modelName:'进行人员检测的模型4',modelType:'图像分类',netName:'我的互联名称',datasName:'模型名称模型名称模型名称4',createUser:'User',devName:'Mobile-Vit',state:1}
])
</script> </script>
<style lang='scss'> <style lang='scss'>
.simulation-execution { .simulation-execution {
.split-log { .split-log {
font-size: 12px; font-size: 12px;
.el-card__body { .el-card__body {
padding: 8px; padding: 8px;
} }
} }
.run-state { .run-state {
&.state-0 { &.state-0 {
color: var(--el-color-primary); color: var(--el-color-primary);
} }
&.state-1 { &.state-1 {
color: var(--el-color-success); color: var(--el-color-success);
} }

View File

@ -15,18 +15,17 @@
</el-form> </el-form>
</div> </div>
<el-card> <el-card>
<el-table v-loading="loading" :data="tableData" stripe @selection-change="handleSelectionChange"> <el-table v-loading="loading" :data="info.tableData" stripe @selection-change="handleSelectionChange">
<el-table-column label="任务名称" align="left" prop="taskName" /> <el-table-column label="任务名称" align="left" prop="task_name" />
<el-table-column label="任务说明" align="left" prop="desc" /> <el-table-column label="任务说明" align="left" prop="task_desc" />
<el-table-column label="使用数据集" align="left" prop="dataSet" /> <el-table-column label="使用数据集" align="left" prop="data_set_name" />
<el-table-column label="运行模型" align="left" prop="model" width="120"/> <el-table-column label="运行模型" align="left" prop="model_name" width="120" />
<el-table-column label="模型网络" align="left" prop="netName" width="120"/> <el-table-column label="模型网络" align="left" prop="modl_net_type" width="120" />
<el-table-column label="创建时间" align="left" prop="crTime" width="120" /> <el-table-column label="创建时间" align="left" prop="crTime" width="120" />
<el-table-column label="操作" fixed="right" align="center" width="200"> <el-table-column label="操作" fixed="right" align="center" width="200">
<template #default="scope"> <template #default="scope">
<el-button text type="primary" size="small" <el-button text type="primary" size="small" @click="doShowDetail(scope.row)"><i-ep-view />查看报告</el-button>
@click="doShowDetail(scope.row)"><i-ep-view />查看报告</el-button> <el-button text type="primary" v-if="1 == 2" size="small"
<el-button text type="primary" size="small"
@click="doDelete(scope.row)"><i-ep-close-bold />删除</el-button> @click="doDelete(scope.row)"><i-ep-close-bold />删除</el-button>
</template> </template>
</el-table-column> </el-table-column>
@ -41,29 +40,24 @@
</template> </template>
<script setup> <script setup>
import TaskApi from '@/api/task'
const queryFormRef = ref(ElForm); // const queryFormRef = ref(ElForm); //
const router = useRouter(); const router = useRouter();
const loading = ref(false); // const loading = ref(false); //
const queryParams = reactive({ const queryParams = reactive({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
keywords: '', keywords: '',
}); });
const total = ref(100); // const total = ref(0); //
let info = reactive({
tableData: []
})
/** 查询 */ /** 查询 */
function handleQuery() { function handleQuery() {
loading.value = true; loadData();
ElMessage.success("查询成功");
loading.value = false;
} }
let tableData=reactive([
{id:"1",taskName:"模型名称模型名称模型名称1",desc:"进行10种类型 的目标分类模型查看",dataSet:"图像分类",model:"人脸模型",netName:"VIT",crTime:'2024-02-02'},
{id:"2",taskName:"模型名称模型名称模型名称2",desc:"进行10种类型 的目标分类模型查看",dataSet:"图像分类",model:"人脸模型",netName:"VIT",crTime:'2024-02-02'},
{id:"3",taskName:"模型名称模型名称模型名称3",desc:"进行10种类型 的目标分类模型查看",dataSet:"图像分类",model:"人脸模型",netName:"VIT",crTime:'2024-02-02'},
{id:"4",taskName:"模型名称模型名称模型名称4",desc:"进行10种类型 的目标分类模型查看",dataSet:"图像分类",model:"人脸模型",netName:"VIT",crTime:'2024-02-02'},
]);
const doDelete = (row) => { const doDelete = (row) => {
ElMessageBox.confirm("确认删除?", "警告", { ElMessageBox.confirm("确认删除?", "警告", {
@ -83,6 +77,19 @@ const doDelete=(row)=>{
const doShowDetail = row => { const doShowDetail = row => {
router.push({ path: "/simulationEvaluation/taskDesc", query: { ...row } }); router.push({ path: "/simulationEvaluation/taskDesc", query: { ...row } });
} }
const loadData = () => {
loading.value = true;
TaskApi.tasks(queryParams).then(d => {
loading.value = false;
total.value = d.data.data.total || 0;
info.tableData = (d.data.data.task_list || []).map(it => {
it.device_name = (it.device_list || []).map(item => item.device_name).join(",");
return it;
})
})
}
onMounted(loadData);
</script> </script>
<style lang='scss'> <style lang='scss'>
.simulation-his-task-list { .simulation-his-task-list {