Browse Source

Merge pull request 'X' (#12) from dev into master

master-fzznrj423
fanshuai 1 year ago
parent
commit
9ddbfc0160
51 changed files with 304 additions and 97 deletions
  1. +1
    -0
      react-ui/config/config.ts
  2. BIN
      react-ui/public/assets/images/component-icon-3-Failed.png
  3. BIN
      react-ui/public/assets/images/component-icon-3-Omitted.png
  4. BIN
      react-ui/public/assets/images/component-icon-3-Pending.png
  5. BIN
      react-ui/public/assets/images/component-icon-3-Running.png
  6. BIN
      react-ui/public/assets/images/component-icon-3-Skipped.png
  7. BIN
      react-ui/public/assets/images/component-icon-3-Succeeded.png
  8. BIN
      react-ui/public/assets/images/component-icon-3.png
  9. BIN
      react-ui/public/assets/images/component-icon-4-Failed.png
  10. BIN
      react-ui/public/assets/images/component-icon-4-Omitted.png
  11. BIN
      react-ui/public/assets/images/component-icon-4-Pending.png
  12. BIN
      react-ui/public/assets/images/component-icon-4-Running.png
  13. BIN
      react-ui/public/assets/images/component-icon-4-Skipped.png
  14. BIN
      react-ui/public/assets/images/component-icon-4-Succeeded.png
  15. BIN
      react-ui/public/assets/images/component-icon-4.png
  16. BIN
      react-ui/public/assets/images/component-icon-5-Failed.png
  17. BIN
      react-ui/public/assets/images/component-icon-5-Omitted.png
  18. BIN
      react-ui/public/assets/images/component-icon-5-Pending.png
  19. BIN
      react-ui/public/assets/images/component-icon-5-Running.png
  20. BIN
      react-ui/public/assets/images/component-icon-5-Skipped.png
  21. BIN
      react-ui/public/assets/images/component-icon-5-Succeeded.png
  22. BIN
      react-ui/public/assets/images/component-icon-5.png
  23. BIN
      react-ui/public/assets/images/component-icon-6-Failed.png
  24. BIN
      react-ui/public/assets/images/component-icon-6-Omitted.png
  25. BIN
      react-ui/public/assets/images/component-icon-6-Pending.png
  26. BIN
      react-ui/public/assets/images/component-icon-6-Running.png
  27. BIN
      react-ui/public/assets/images/component-icon-6-Skipped.png
  28. BIN
      react-ui/public/assets/images/component-icon-6-Succeeded.png
  29. BIN
      react-ui/public/assets/images/component-icon-6.png
  30. BIN
      react-ui/public/assets/images/component-icon-7-Skipped.png
  31. +28
    -1
      react-ui/src/hooks/index.ts
  32. +8
    -10
      react-ui/src/pages/Dataset/datasetIntro.jsx
  33. +1
    -1
      react-ui/src/pages/Experiment/experimentText/LogList.tsx
  34. +1
    -1
      react-ui/src/pages/Experiment/experimentText/logGroup.tsx
  35. +11
    -0
      react-ui/src/pages/Experiment/status.ts
  36. +0
    -10
      react-ui/src/pages/Experiment/types.ts
  37. +8
    -5
      react-ui/src/pages/Model/modelIntro.jsx
  38. +14
    -0
      react-ui/src/pages/Pipeline/editPipeline/globalParamsDrawer.less
  39. +133
    -0
      react-ui/src/pages/Pipeline/editPipeline/globalParamsDrawer.tsx
  40. +60
    -38
      react-ui/src/pages/Pipeline/editPipeline/index.jsx
  41. +1
    -1
      react-ui/src/services/dataset/index.js
  42. +3
    -3
      react-ui/src/services/experiment/index.js
  43. +9
    -0
      react-ui/src/types.ts
  44. +1
    -1
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/annotations/CheckDuplicate.java
  45. +4
    -4
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/PodStatus.java
  46. +4
    -4
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java
  47. +2
    -5
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java
  48. +10
    -9
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/TensorBoardServiceImpl.java
  49. +2
    -2
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java
  50. +1
    -0
      ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/MinioUtil.java
  51. +2
    -2
      ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ModelsVersionDaoMapper.xml

+ 1
- 0
react-ui/config/config.ts View File

@@ -154,4 +154,5 @@ export default defineConfig({
strategy: 'normal',
},
requestRecord: {},
icons: {},
});

BIN
react-ui/public/assets/images/component-icon-3-Failed.png View File

Before After
Width: 108  |  Height: 108  |  Size: 5.1 kB Width: 108  |  Height: 108  |  Size: 3.5 kB

BIN
react-ui/public/assets/images/component-icon-3-Omitted.png View File

Before After
Width: 108  |  Height: 108  |  Size: 5.1 kB Width: 108  |  Height: 108  |  Size: 3.4 kB

BIN
react-ui/public/assets/images/component-icon-3-Pending.png View File

Before After
Width: 108  |  Height: 108  |  Size: 5.1 kB Width: 108  |  Height: 108  |  Size: 3.6 kB

BIN
react-ui/public/assets/images/component-icon-3-Running.png View File

Before After
Width: 108  |  Height: 108  |  Size: 5.0 kB Width: 108  |  Height: 108  |  Size: 3.4 kB

BIN
react-ui/public/assets/images/component-icon-3-Skipped.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.4 kB

BIN
react-ui/public/assets/images/component-icon-3-Succeeded.png View File

Before After
Width: 108  |  Height: 108  |  Size: 5.2 kB Width: 108  |  Height: 108  |  Size: 3.7 kB

BIN
react-ui/public/assets/images/component-icon-3.png View File

Before After
Width: 72  |  Height: 72  |  Size: 3.2 kB Width: 72  |  Height: 72  |  Size: 1.7 kB

BIN
react-ui/public/assets/images/component-icon-4-Failed.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.2 kB Width: 108  |  Height: 108  |  Size: 4.6 kB

BIN
react-ui/public/assets/images/component-icon-4-Omitted.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.1 kB Width: 108  |  Height: 108  |  Size: 4.6 kB

BIN
react-ui/public/assets/images/component-icon-4-Pending.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.2 kB Width: 108  |  Height: 108  |  Size: 4.7 kB

BIN
react-ui/public/assets/images/component-icon-4-Running.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.1 kB Width: 108  |  Height: 108  |  Size: 4.5 kB

BIN
react-ui/public/assets/images/component-icon-4-Skipped.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.6 kB

BIN
react-ui/public/assets/images/component-icon-4-Succeeded.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.4 kB Width: 108  |  Height: 108  |  Size: 4.8 kB

BIN
react-ui/public/assets/images/component-icon-4.png View File

Before After
Width: 72  |  Height: 72  |  Size: 2.8 kB Width: 72  |  Height: 72  |  Size: 2.8 kB

BIN
react-ui/public/assets/images/component-icon-5-Failed.png View File

Before After
Width: 108  |  Height: 108  |  Size: 2.9 kB Width: 108  |  Height: 108  |  Size: 4.5 kB

BIN
react-ui/public/assets/images/component-icon-5-Omitted.png View File

Before After
Width: 108  |  Height: 108  |  Size: 2.8 kB Width: 108  |  Height: 108  |  Size: 4.5 kB

BIN
react-ui/public/assets/images/component-icon-5-Pending.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.0 kB Width: 108  |  Height: 108  |  Size: 4.7 kB

BIN
react-ui/public/assets/images/component-icon-5-Running.png View File

Before After
Width: 108  |  Height: 108  |  Size: 2.9 kB Width: 108  |  Height: 108  |  Size: 4.4 kB

BIN
react-ui/public/assets/images/component-icon-5-Skipped.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.5 kB

BIN
react-ui/public/assets/images/component-icon-5-Succeeded.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.2 kB Width: 108  |  Height: 108  |  Size: 4.8 kB

BIN
react-ui/public/assets/images/component-icon-5.png View File

Before After
Width: 72  |  Height: 72  |  Size: 1.2 kB Width: 72  |  Height: 72  |  Size: 3.0 kB

BIN
react-ui/public/assets/images/component-icon-6-Failed.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.2 kB Width: 108  |  Height: 108  |  Size: 4.2 kB

BIN
react-ui/public/assets/images/component-icon-6-Omitted.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.2 kB Width: 108  |  Height: 108  |  Size: 4.1 kB

BIN
react-ui/public/assets/images/component-icon-6-Pending.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.2 kB Width: 108  |  Height: 108  |  Size: 4.2 kB

BIN
react-ui/public/assets/images/component-icon-6-Running.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.1 kB Width: 108  |  Height: 108  |  Size: 4.1 kB

BIN
react-ui/public/assets/images/component-icon-6-Skipped.png View File

Before After
Width: 108  |  Height: 108  |  Size: 4.1 kB

BIN
react-ui/public/assets/images/component-icon-6-Succeeded.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.3 kB Width: 108  |  Height: 108  |  Size: 4.3 kB

BIN
react-ui/public/assets/images/component-icon-6.png View File

Before After
Width: 31  |  Height: 31  |  Size: 716 B Width: 72  |  Height: 72  |  Size: 2.4 kB

BIN
react-ui/public/assets/images/component-icon-7-Skipped.png View File

Before After
Width: 108  |  Height: 108  |  Size: 3.1 kB

+ 28
- 1
react-ui/src/hooks/index.ts View File

@@ -1,4 +1,11 @@
import { useEffect, useRef, useState } from 'react';
import { useCallback, useEffect, useRef, useState } from 'react';

/**
* Generates a state reference with the initial value.
*
* @param initialValue - The initial value for the state
* @return An array containing the state value, state setter function, and a mutable reference object
*/
export function useStateRef<T>(initialValue: T) {
const [value, setValue] = useState(initialValue);

@@ -10,3 +17,23 @@ export function useStateRef<T>(initialValue: T) {

return [value, setValue, ref] as const;
}

/**
* Generates a custom hook for managing the visibility state of a modal.
*
* @param initialValue - The initial visibility state of the modal.
* @return An array containing the visibility state and functions to open and close the modal.
*/
export function useModal(initialValue: boolean) {
const [visible, setVisible] = useState(initialValue);

const open = useCallback(() => {
setVisible(true);
}, []);

const close = useCallback(() => {
setVisible(false);
}, []);

return [visible, open, close];
}

+ 8
- 10
react-ui/src/pages/Dataset/datasetIntro.jsx View File

@@ -54,7 +54,7 @@ const Dataset = () => {
const [dialogTitle, setDialogTitle] = useState('新建版本');
const [isModalOpen, setIsModalOpen] = useState(false);
const [datasetDetailObj, setDatasetDetailObj] = useState({});
const [version, setVersion] = useState('');
const [version, setVersion] = useState(null);
const [versionList, setVersionList] = useState([]);
const locationParams = useParams(); //新版本获取路由参数接口
const [wordList, setWordList] = useState([]);
@@ -109,27 +109,24 @@ const Dataset = () => {

onOk: () => {
deleteDatasetVersion({ dataset_id: locationParams.id, version }).then((ret) => {
message.success('删除成功');
setVersion(null);
getDatasetVersionList();
getDatasetVersions({ version, dataset_id: locationParams.id });
message.success('删除成功');
});
},
});
};
const onFinish = (values) => {
addDatasetVersionDetail(formList).then((ret) => {
console.log(ret);
getDatasetVersionList();
setIsModalOpen(false);
message.success('创建成功');
});
};
const getDatasetVersions = (params) => {
getDatasetVersionIdList(params).then((res) => {
setWordList(
res.data.map((v) => ({
...v,
key: v.id,
})),
);
setWordList(res.data);
});
};
const handleChange = (value) => {
@@ -242,6 +239,7 @@ const Dataset = () => {
width: 160,
}}
allowClear
value={version}
onChange={handleChange}
options={versionList}
/>
@@ -281,7 +279,7 @@ const Dataset = () => {
<div style={{ marginBottom: '10px', fontSize: '14px' }}>
{wordList.length > 0 ? wordList[0].description : null}
</div>
<Table columns={columns} dataSource={wordList} pagination={false} />
<Table columns={columns} dataSource={wordList} pagination={false} rowKey="id" />
</div>
</TabPane>
</Tabs>


+ 1
- 1
react-ui/src/pages/Experiment/experimentText/LogList.tsx View File

@@ -1,4 +1,4 @@
import { ExperimentStatus } from '../types';
import { ExperimentStatus } from '../status';
import LogGroup, { type LogGroupProps } from './logGroup';

type LogListProps = {


+ 1
- 1
react-ui/src/pages/Experiment/experimentText/logGroup.tsx View File

@@ -3,7 +3,7 @@ import { getExperimentPodsLog } from '@/services/experiment/index.js';
import { DoubleRightOutlined, DownOutlined, UpOutlined } from '@ant-design/icons';
import { Button } from 'antd';
import { useEffect, useState } from 'react';
import { ExperimentStatus } from '../types';
import { ExperimentStatus } from '../status';
import styles from './logGroup.less';

export type LogGroupProps = {


+ 11
- 0
react-ui/src/pages/Experiment/status.ts View File

@@ -4,6 +4,17 @@ export interface StatusInfo {
icon: string;
}

export enum ExperimentStatus {
Running = 'Running',
Succeeded = 'Succeeded',
Pending = 'Pending',
Failed = 'Failed',
Error = 'Error',
Terminated = 'Terminated',
Skipped = 'Skipped',
Omitted = 'Omitted',
}

export const experimentStatusInfo: Record<string, StatusInfo | undefined> = {
Running: {
label: '运行中',


+ 0
- 10
react-ui/src/pages/Experiment/types.ts View File

@@ -1,10 +0,0 @@
export enum ExperimentStatus {
Running = 'Running',
Succeeded = 'Succeeded',
Pending = 'Pending',
Failed = 'Failed',
Error = 'Error',
Terminated = 'Terminated',
Skipped = 'Skipped',
Omitted = 'Omitted',
}

+ 8
- 5
react-ui/src/pages/Model/modelIntro.jsx View File

@@ -54,7 +54,7 @@ const Dataset = () => {
const [dialogTitle, setDialogTitle] = useState('新建版本');
const [isModalOpen, setIsModalOpen] = useState(false);
const [datasetDetailObj, setDatasetDetailObj] = useState({});
const [version, setVersion] = useState('');
const [version, setVersion] = useState(null);
const [versionList, setVersionList] = useState([]);
const locationParams = useParams(); //新版本获取路由参数接口
console.log(locationParams);
@@ -104,17 +104,19 @@ const Dataset = () => {

onOk: () => {
deleteModelVersion({ models_id: locationParams.id, version }).then((ret) => {
message.success('删除成功');
setVersion(null);
getModelVersionsList();
getModelVersions({ version, models_id: locationParams.id });
message.success('删除成功');
});
},
});
};
const onFinish = () => {
addModelsVersionDetail(formList).then((ret) => {
console.log(ret);
getModelVersionsList();
setIsModalOpen(false);
message.success('创建成功');
});
};
const getModelVersions = (params) => {
@@ -140,7 +142,7 @@ const Dataset = () => {
getModelVersions({ version: value, models_id: locationParams.id });
setVersion(value);
} else {
setVersion(null);
setVersion('');
}
};
const onFinishFailed = (errorInfo) => {
@@ -237,6 +239,7 @@ const Dataset = () => {
style={{
width: 160,
}}
value={version}
allowClear
onChange={handleChange}
options={versionList}
@@ -277,7 +280,7 @@ const Dataset = () => {
<div style={{ marginBottom: '10px', fontSize: '14px' }}>
{wordList.length > 0 ? wordList[0].description : null}
</div>
<Table columns={columns} dataSource={wordList} pagination={false} />
<Table columns={columns} dataSource={wordList} pagination={false} rowKey="id" />
</div>
</TabPane>
</Tabs>


+ 14
- 0
react-ui/src/pages/Pipeline/editPipeline/globalParamsDrawer.less View File

@@ -0,0 +1,14 @@
.form_item_block {
position: relative;
padding-top: 40px;
border-bottom: 1px dashed rgba(20, 49, 179, 0.12);
}
.delete_button {
position: absolute;
top: 5px;
right: 0;
}
.add_button {
margin-top: 15px;
padding: 0;
}

+ 133
- 0
react-ui/src/pages/Pipeline/editPipeline/globalParamsDrawer.tsx View File

@@ -0,0 +1,133 @@
import { type PipelineGlobalParam } from '@/types';
import { to } from '@/utils/promise';
import { DeleteOutlined, PlusOutlined } from '@ant-design/icons';
import { Button, Drawer, Form, Input, Radio } from 'antd';
import { forwardRef, useImperativeHandle } from 'react';
import styles from './globalParamsDrawer.less';

type GlobalParamsDrawerProps = {
open: boolean;
onClose: () => void;
globalParam: PipelineGlobalParam[];
};

const GlobalParamsDrawer = forwardRef(
({ open = false, onClose, globalParam = [] }: GlobalParamsDrawerProps, ref) => {
const [form] = Form.useForm();

useImperativeHandle(ref, () => ({
getFieldsValue: async () => {
const [res, error] = await to(form.validateFields());
if (res && !error) {
const values = form.getFieldsValue();
return values;
} else {
return Promise.reject(error);
}
},
}));
return (
<Drawer
rootStyle={{ marginTop: '45px' }}
title="全局参数"
placement="right"
closeIcon={false}
getContainer={false}
onClose={onClose}
open={open}
width={420}
>
<Form
name="global_params_form"
autoComplete="off"
form={form}
labelCol={{ span: 7 }}
wrapperCol={{ span: 17 }}
initialValues={{ global_param: globalParam }}
labelAlign="left"
>
<Form.List name="global_param">
{(fields, { add, remove }) => (
<>
{fields.map(({ key, name, ...restField }) => (
<div key={key} className={styles.form_item_block}>
<Form.Item
{...restField}
name={[name, 'param_name']}
label="参数名称"
rules={[{ required: true, message: '请输入参数名称' }]}
>
<Input placeholder="请输入参数名称" allowClear />
</Form.Item>
<Form.Item
{...restField}
name={[name, 'description']}
label="参数描述"
rules={[{ required: true, message: '请输入参数描述' }]}
>
<Input.TextArea
placeholder="请输入参数描述"
autoSize={{ minRows: 2, maxRows: 4 }}
allowClear
/>
</Form.Item>
<Form.Item
{...restField}
name={[name, 'param_type']}
label="类  型"
rules={[{ required: true, message: '请选择类型' }]}
>
<Radio.Group>
<Radio value={1}>字符串</Radio>
<Radio value={2}>整型</Radio>
<Radio value={3}>布尔类型</Radio>
</Radio.Group>
</Form.Item>
<Form.Item
{...restField}
name={[name, 'param_value']}
label="值"
rules={[{ required: true, message: '请输入值' }]}
>
<Input placeholder="请输入值" allowClear />
</Form.Item>
<Form.Item
{...restField}
name={[name, 'is_sensitive']}
label="脱敏显示"
rules={[{ required: true, message: '请选择' }]}
tooltip="脱敏后的参数以*****显示"
>
<Radio.Group>
<Radio value={1}>是</Radio>
<Radio value={0}>否</Radio>
</Radio.Group>
</Form.Item>
<Button
className={styles.delete_button}
type="link"
onClick={() => remove(name)}
icon={<DeleteOutlined />}
></Button>
</div>
))}
<Form.Item>
<Button
className={styles.add_button}
type="link"
onClick={add}
icon={<PlusOutlined />}
>
流水线参数
</Button>
</Form.Item>
</>
)}
</Form.List>
</Form>
</Drawer>
);
},
);

export default GlobalParamsDrawer;

+ 60
- 38
react-ui/src/pages/Pipeline/editPipeline/index.jsx View File

@@ -1,21 +1,27 @@
import { useModal } from '@/hooks';
import { getWorkflowById, saveWorkflow } from '@/services/pipeline/index.js';
import { to } from '@/utils/promise';
import { SaveOutlined } from '@ant-design/icons';
import { useEmotionCss } from '@ant-design/use-emotion-css';
import G6 from '@antv/g6';
import { Button, message } from 'antd';
import React, { useEffect, useRef } from 'react';
import { useEffect, useRef, useState } from 'react';
import { useNavigate, useParams } from 'react-router-dom';
import { Icon } from 'umi';
import { s8 } from '../../../utils';
import Styles from './editPipeline.less';
import GlobalParamsDrawer from './globalParamsDrawer';
import ModelMenus from './modelMenus';
import Props from './props';
const editPipeline = (React.FC = () => {

let graph = null;

const EditPipeline = () => {
const propsRef = useRef();
const navgite = useNavigate();
// const [contextMenu,setContextMenu]=useState({})
let contextMenu = {};
const locationParams = useParams(); //新版本获取路由参数接口
let graph = null;
let sourceAnchorIdx, targetAnchorIdx;
const pipelineContainer = useEmotionCss(() => {
return {
@@ -53,6 +59,9 @@ const editPipeline = (React.FC = () => {
};
});
const graphRef = useRef();
const paramsDrawerRef = useRef();
const [paramsDrawerVisible, openParamsDrawer, closeParamsDrawer] = useModal(false);
const [globalParam, setGlobalParam] = useState([]);

const onDragEnd = (val) => {
console.log(val, 'eee');
@@ -74,35 +83,37 @@ const editPipeline = (React.FC = () => {
console.log(graph);
};
const formChange = (val) => {
const data = graph.save();
const index = data.nodes.findIndex((item) => {
return item.id === val.id;
});
data.nodes[index] = val;
graph.changeData(data);
graph.render();
if (graph) {
const data = graph.save();
const index = data.nodes.findIndex((item) => {
return item.id === val.id;
});
data.nodes[index] = val;
graph.changeData(data);
graph.render();
}
};
const savePipeline = (val) => {
const savePipeline = async (val) => {
const [res, error] = await to(paramsDrawerRef.current.getFieldsValue());
if (error) {
message.error('全局参数配置有误');
return;
}
const data = graph.save();
console.log(data);
let params = {
...locationParams,
dag: JSON.stringify(data),
global_param: JSON.stringify(res.global_param),
};
saveWorkflow(params).then((ret) => {
console.log(ret);
if (ret.code == 200) {
message.success('保存成功');
setTimeout(() => {
if (val) {
navgite({ pathname: `/pipeline` });
}
}, 500);
} else {
message.error('保存失败');
}
message.success('保存成功');
setTimeout(() => {
if (val) {
navgite({ pathname: `/pipeline` });
}
}, 500);
});
console.log(params);
};
const handlerClick = (e) => {
e.stopPropagation();
@@ -258,13 +269,12 @@ const editPipeline = (React.FC = () => {
};
const getFirstWorkflow = (val) => {
getWorkflowById(val).then((ret) => {
console.log(ret);
if (ret.code == 200) {
if (graph && ret.data && ret.data.dag) {
getGraphData(JSON.parse(ret.data.dag));
}
if (ret && ret.data) {
setGlobalParam(ret.data.global_param);
}
if (graph && ret.data && ret.data.dag) {
getGraphData(JSON.parse(ret.data.dag));
}

// graph&&graph.data(JSON.parse(ret.dag))
// graph.render()
});
@@ -334,7 +344,6 @@ const editPipeline = (React.FC = () => {
});
graph.off('dblclick', handlerClick);
};
console.log(contextMenu);
}, []);
const initGraph = () => {
const fittingString = (str, maxWidth, fontSize) => {
@@ -601,8 +610,10 @@ const editPipeline = (React.FC = () => {
});
graph.on('dblclick', (e) => {
console.log(e.item);
graph.setItemState(e.item, 'nodeClicked', true);
handlerClick(e);
if (e.item) {
graph.setItemState(e.item, 'nodeClicked', true);
handlerClick(e);
}
});
graph.on('click', (e) => {
console.log(e.item);
@@ -690,11 +701,18 @@ const editPipeline = (React.FC = () => {
<ModelMenus onParDragEnd={onDragEnd}></ModelMenus>
<div className={Styles.centerContainer}>
<div className={Styles.buttonList}>
<Button
type="default"
icon={<Icon icon="local:parameter" style={{ verticalAlign: '-2px' }} />}
style={{ marginRight: '20px' }}
onClick={openParamsDrawer}
>
全局参数
</Button>
<Button
type="primary"
shape="round"
icon={<SaveOutlined />}
style={{ marginRight: '20px', background: '#1664ff' }}
style={{ marginRight: '20px' }}
onClick={() => {
savePipeline(false);
}}
@@ -703,9 +721,7 @@ const editPipeline = (React.FC = () => {
</Button>
<Button
type="primary"
shape="round"
icon={<SaveOutlined />}
style={{ background: '#1664ff' }}
onClick={() => {
savePipeline(true);
}}
@@ -716,7 +732,13 @@ const editPipeline = (React.FC = () => {
<div className={graphStyle} ref={graphRef} id={Styles.graphStyle}></div>
</div>
<Props ref={propsRef} onParentChange={formChange}></Props>
<GlobalParamsDrawer
ref={paramsDrawerRef}
open={paramsDrawerVisible}
globalParam={globalParam}
onClose={closeParamsDrawer}
></GlobalParamsDrawer>
</div>
);
});
export default editPipeline;
};
export default EditPipeline;

+ 1
- 1
react-ui/src/services/dataset/index.js View File

@@ -94,7 +94,7 @@ export function deleteModelVersion(params) {
}
// 新增数据集版本
export function addDatasetVersionDetail(data) {
return request(`/api/mmp//datasetVersion/addDatasetVersions`, {
return request(`/api/mmp/datasetVersion/addDatasetVersions`, {
method: 'POST',
headers: {
'Content-Type': 'application/json;charset=UTF-8',


+ 3
- 3
react-ui/src/services/experiment/index.js View File

@@ -53,10 +53,10 @@ export function getQueryByExperimentLog(data) {
});
}
// 查询实例节点结果
export function getNodeResult(params) {
export function getNodeResult(data) {
return request(`/api/mmp/experimentIns/nodeResult/`, {
method: 'GET',
params,
method: 'POST',
data,
});
}



+ 9
- 0
react-ui/src/types.ts View File

@@ -0,0 +1,9 @@
// 流水线全局参数
export type PipelineGlobalParam = {
workflow_id: number;
param_name: string;
description: string;
param_type: number;
param_value: number | string | boolean;
is_sensitive: number;
};

+ 1
- 1
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/annotations/CheckDuplicate.java View File

@@ -8,5 +8,5 @@ import java.lang.annotation.Target;
@Retention(RetentionPolicy.RUNTIME)
public @interface CheckDuplicate {
String value() default "";
String message() default "不能重复";
String message() default "不能重复";
}

ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/TensorBoardStatus.java → ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/domain/PodStatus.java View File

@@ -1,15 +1,15 @@
package com.ruoyi.platform.domain;

public enum TensorBoardStatus {
Pending("Pending",1), Running("Running",2),Terminated("未运行",3);
public enum PodStatus {
Pending("Pending",1), Running("Running",2),Terminated("Terminated",3), Failed("Failed",4), Unknown("Unknown",5);
private String name;
private int index;
private TensorBoardStatus(String name, int index) {
private PodStatus(String name, int index) {
this.name = name;
this.index = index;
}
public static String getName(int index) {
for (TensorBoardStatus c : TensorBoardStatus.values()) {
for (PodStatus c : PodStatus.values()) {
if (c.getIndex() == index) {
return c.name;
}

+ 4
- 4
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/DatasetServiceImpl.java View File

@@ -59,11 +59,9 @@ public class DatasetServiceImpl implements DatasetService {
// 固定存储桶名
private final String bucketName = "platform-data";

private final MinioUtil minioUtil;
@Resource
private MinioUtil minioUtil;

public DatasetServiceImpl(MinioUtil minioUtil) {
this.minioUtil = minioUtil;
}


/**
@@ -306,6 +304,8 @@ public class DatasetServiceImpl implements DatasetService {
.filter(version -> version != null && !version.isEmpty()) //忽略null或空字符串的version
.distinct() // 去重
.collect(Collectors.toList()); // 收集到List中


}




+ 2
- 5
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/ModelsServiceImpl.java View File

@@ -58,12 +58,9 @@ public class ModelsServiceImpl implements ModelsService {

// 固定存储桶名
private final String bucketName = "platform-data";
@Resource
private MinioUtil minioUtil;

private final MinioUtil minioUtil;

public ModelsServiceImpl(MinioUtil minioUtil) {
this.minioUtil = minioUtil;
}

/**
* 通过ID查询单条数据


+ 10
- 9
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/service/impl/TensorBoardServiceImpl.java View File

@@ -2,19 +2,15 @@ package com.ruoyi.platform.service.impl;

import com.ruoyi.common.core.utils.StringUtils;
import com.ruoyi.common.security.utils.SecurityUtils;
import com.ruoyi.platform.domain.TensorBoardStatus;
import com.ruoyi.platform.domain.PodStatus;
import com.ruoyi.platform.service.TensorBoardService;
import com.ruoyi.platform.utils.K8sClientUtil;
import com.ruoyi.platform.vo.FrameLogPathVo;
import com.ruoyi.system.api.model.LoginUser;
import io.kubernetes.client.openapi.models.V1Pod;
import net.sf.jsqlparser.schema.Database;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.text.SimpleDateFormat;
import java.util.Date;

@Service
public class TensorBoardServiceImpl implements TensorBoardService {
@@ -30,8 +26,8 @@ public class TensorBoardServiceImpl implements TensorBoardService {
private K8sClientUtil k8sClientUtil;
@Override
public String getTensorBoardStatus(FrameLogPathVo frameLogPathVo){
String status = TensorBoardStatus.Terminated.getName();
if (StringUtils.isEmpty(frameLogPathVo.getPath())||StringUtils.isEmpty(frameLogPathVo.getPvcName())){
String status = PodStatus.Terminated.getName();
if (StringUtils.isEmpty(frameLogPathVo.getPath())){
return status;
}
LoginUser loginUser = SecurityUtils.getLoginUser();
@@ -39,9 +35,14 @@ public class TensorBoardServiceImpl implements TensorBoardService {

try {
String podStatus = k8sClientUtil.getPodStatus(podName, StringUtils.isEmpty(frameLogPathVo.getNamespace()) ? "default" : frameLogPathVo.getNamespace());
System.out.println(podStatus);
for (PodStatus s : PodStatus.values()) {
if (s.getName().equals(podStatus)) {
status = s.getName();
break;
}
}
} catch (Exception e) {
return TensorBoardStatus.Terminated.getName();
return PodStatus.Terminated.getName();
}
return status;
}


+ 2
- 2
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/K8sClientUtil.java View File

@@ -50,7 +50,7 @@ public class K8sClientUtil {
* 3. service-account namespace
* 4. master endpoints(ip, port) from pre-set environment variables
*/
@Autowired
// @Autowired
public K8sClientUtil(@Value("${k8s.http}") String http, @Value("${k8s.token}") String token) {
this.http = http;
this.token = token;
@@ -91,7 +91,7 @@ public class K8sClientUtil {
// try {
// this.apiClient = new ClientBuilder().
// setBasePath("https://172.20.32.181:6443").setVerifyingSsl(false).
// setAuthentication(new AccessTokenAuthentication("eyJhbGciOiJSUzI1NiIsImtpZCI6IjRWcFBPWl9YSFFxQ2tVanRuNHdRT1dnUlJNTnB2bG5TQlVSRjNKdExWNDQifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJrdWJlLXN5c3RlbSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJkZWZhdWx0LXRva2VuLXNteGxuIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQubmFtZSI6ImRlZmF1bHQiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiIyZWY1ZjdkMC0zMTdkLTQxN2UtOWY4Ni1mYjA1OTFhYWVhZDQiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6a3ViZS1zeXN0ZW06ZGVmYXVsdCJ9.GMpReYK7YJ0nNy-F6VrUJQzjWQiSauAOeq0-DT8ik2Lx8f2eznYEm_3cHX4kIn_nYgfxo857urcHt4Ft6IgVtWzxLzVTCQVaNP_H2J8bnJn8W2tUKXzF_3d_GwO75H7kN8P3aoShULrOLpiIf3o3Az28_gwHkwCnd42npcKrCXfAKj8A2U7-KUFQXXA-etrWSw81C5t8ziL-2xaiDgwD3ewH-TNYsOpyWjGopNTxJn1F7GyJ7xDlmMJOaZhSnOrDggB7lqDEsE68YmZtqB7lcSaZHnKzvNhEdbKri4R7_urpjttz_k6qcfIi-l6GwPtJLatsPDg3OL3FFnzjvArJ-A")).build();
// setAuthentication(new AccessTokenAuthentication("eyJhbGciOiJSUzI1NiIsImtpZCI6IjRWcFBPWl9YSFFxQ2tVanRuNHdRT1dnUlJNTnB2bG5TQlVSRjNKdExWNDQifQ.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJkZWZhdWx0Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZWNyZXQubmFtZSI6ImFkbWluLXNlcnZpY2UtYWNjb3VudC10b2tlbi14ZDk5eiIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VydmljZS1hY2NvdW50Lm5hbWUiOiJhZG1pbi1zZXJ2aWNlLWFjY291bnQiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC51aWQiOiJmMGEzNmYyMS01MjQyLTQ4MTAtYWVmZS0xOTEwOTZlZjc5YmUiLCJzdWIiOiJzeXN0ZW06c2VydmljZWFjY291bnQ6ZGVmYXVsdDphZG1pbi1zZXJ2aWNlLWFjY291bnQifQ.fo-Wf0-5-IRC5fhRh65yfqCJqKfE9MrNFIXL2fd1CqVAHD7JBpWO2IsFiSmz9Bm7VfLmFAp2NB7DjW4ZLjC7ODiGhpSseBP8x4ceFuHL6pRGUsEBvHQBBBuQcGhNOcsxIDHnDqUdUzoLprj223lMZNTQowITuqYFU4GVbethyEuS6G5Wh9KHI3KYHFtG4_AeWBgI5Ppz8pDrhHzSFWTFbzxQ3RPGEwF0V-9wEtdrSYnfETi3rdRWif9W4a0RW8HwD9Gf7UCYcyFOs7e5_3-IvmctS85g87PYIfHXMhu_kOw-_Il4bkwPEK5uiBFDw0M1-s9YP-F9r5sXXvOJlsAr1g")).build();
// } catch (Exception e) {
// log.error("构建K8s-Client异常", e);
// throw new RuntimeException("构建K8s-Client异常");


+ 1
- 0
ruoyi-modules/management-platform/src/main/java/com/ruoyi/platform/utils/MinioUtil.java View File

@@ -31,6 +31,7 @@ public class MinioUtil {
@Value("${minio.secretKey}")
private String minioSecretKey;
private MinioClient minioClient;

@PostConstruct
public void init() {
this.minioClient = MinioClient.builder()


+ 2
- 2
ruoyi-modules/management-platform/src/main/resources/mapper/managementPlatform/ModelsVersionDaoMapper.xml View File

@@ -39,10 +39,10 @@
from models_version
<where>
state = 1
<if test="modelsId != null">
<if test="modelsVersion.modelsId != null">
and models_id = #{modelsVersion.modelsId}
</if>
<if test="version != null and version != ''">
<if test="modelsVersion.version != null and modelsVersion.version != ''">
and version = #{modelsVersion.version}
</if>
</where>


Loading…
Cancel
Save