| @@ -153,7 +153,7 @@ function ActiveLearnInstance() { | |||||
| className={styles['active-learn-instance__basic']} | className={styles['active-learn-instance__basic']} | ||||
| info={experimentInfo} | info={experimentInfo} | ||||
| runStatus={workflowStatus} | runStatus={workflowStatus} | ||||
| instanceStatus={instanceInfo?.status} | |||||
| instanceStatus={instanceInfo?.status as ExperimentStatus} | |||||
| isInstance | isInstance | ||||
| /> | /> | ||||
| ), | ), | ||||
| @@ -17,6 +17,11 @@ import { | |||||
| function ExecuteConfig() { | function ExecuteConfig() { | ||||
| const form = Form.useFormInstance(); | const form = Form.useFormInstance(); | ||||
| const task_type = Form.useWatch('task_type', form); | |||||
| const queryStrategiesOptions = | |||||
| task_type === AutoMLTaskType.Classification | |||||
| ? queryStrategies.slice(0, 2) | |||||
| : queryStrategies.slice(2); | |||||
| return ( | return ( | ||||
| <> | <> | ||||
| <SubAreaTitle | <SubAreaTitle | ||||
| @@ -488,7 +493,12 @@ function ExecuteConfig() { | |||||
| }, | }, | ||||
| ]} | ]} | ||||
| > | > | ||||
| <Select placeholder="请选择查询策略" options={queryStrategies} showSearch allowClear /> | |||||
| <Select | |||||
| placeholder="请选择查询策略" | |||||
| options={queryStrategiesOptions} | |||||
| showSearch | |||||
| allowClear | |||||
| /> | |||||
| </Form.Item> | </Form.Item> | ||||
| </Col> | </Col> | ||||
| </Row> | </Row> | ||||
| @@ -87,4 +87,8 @@ export const queryStrategies = [ | |||||
| label: 'upper_confidence_bound', | label: 'upper_confidence_bound', | ||||
| value: 'upper_confidence_bound', | value: 'upper_confidence_bound', | ||||
| }, | }, | ||||
| { | |||||
| label: 'probability_of_improvement', | |||||
| value: 'probability_of_improvement', | |||||
| }, | |||||
| ]; | ]; | ||||
| @@ -1,5 +1,6 @@ | |||||
| import { ExperimentStatus } from '@/enums'; | import { ExperimentStatus } from '@/enums'; | ||||
| import { ActiveLearnInstanceData } from '@/pages/ActiveLearn/types'; | import { ActiveLearnInstanceData } from '@/pages/ActiveLearn/types'; | ||||
| import EmptyLog from '@/pages/AutoML/components/ExperimentLog/empty'; | |||||
| import LogList from '@/pages/Experiment/components/LogList'; | import LogList from '@/pages/Experiment/components/LogList'; | ||||
| import { NodeStatus } from '@/types'; | import { NodeStatus } from '@/types'; | ||||
| import { Tabs } from 'antd'; | import { Tabs } from 'antd'; | ||||
| @@ -64,7 +65,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| // icon: <KFIcon type="icon-rizhi1" />, | // icon: <KFIcon type="icon-rizhi1" />, | ||||
| children: ( | children: ( | ||||
| <div className={styles['experiment-log__tabs__log']}> | <div className={styles['experiment-log__tabs__log']}> | ||||
| {trainCloneNodeStatus && ( | |||||
| {trainCloneNodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -73,6 +74,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={trainCloneNodeStatus.startedAt} | instanceNodeStartTime={trainCloneNodeStatus.startedAt} | ||||
| instanceNodeStatus={trainCloneNodeStatus.phase as ExperimentStatus} | instanceNodeStatus={trainCloneNodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| ), | ), | ||||
| @@ -83,7 +86,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| // icon: <KFIcon type="icon-rizhi1" />, | // icon: <KFIcon type="icon-rizhi1" />, | ||||
| children: ( | children: ( | ||||
| <div className={styles['experiment-log__tabs__log']}> | <div className={styles['experiment-log__tabs__log']}> | ||||
| {hpoNodeStatus && ( | |||||
| {hpoNodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -92,6 +95,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={hpoNodeStatus.startedAt} | instanceNodeStartTime={hpoNodeStatus.startedAt} | ||||
| instanceNodeStatus={hpoNodeStatus.phase as ExperimentStatus} | instanceNodeStatus={hpoNodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| ), | ), | ||||
| @@ -95,7 +95,10 @@ function AutoMLInstance() { | |||||
| }; | }; | ||||
| const setupSSE = (name: string, namespace: string) => { | const setupSSE = (name: string, namespace: string) => { | ||||
| const { origin } = location; | |||||
| let { origin } = location; | |||||
| if (process.env.NODE_ENV === 'development') { | |||||
| origin = 'http://172.20.32.235:31213'; | |||||
| } | |||||
| const params = encodeURIComponent(`metadata.namespace=${namespace},metadata.name=${name}`); | const params = encodeURIComponent(`metadata.namespace=${namespace},metadata.name=${name}`); | ||||
| const evtSource = new EventSource( | const evtSource = new EventSource( | ||||
| `${origin}/api/v1/realtimeStatus?listOptions.fieldSelector=${params}`, | `${origin}/api/v1/realtimeStatus?listOptions.fieldSelector=${params}`, | ||||
| @@ -156,7 +159,7 @@ function AutoMLInstance() { | |||||
| className={styles['auto-ml-instance__basic']} | className={styles['auto-ml-instance__basic']} | ||||
| info={autoMLInfo} | info={autoMLInfo} | ||||
| runStatus={workflowStatus} | runStatus={workflowStatus} | ||||
| instanceStatus={instanceInfo?.status} | |||||
| instanceStatus={instanceInfo?.status as ExperimentStatus} | |||||
| isInstance | isInstance | ||||
| /> | /> | ||||
| ), | ), | ||||
| @@ -34,7 +34,14 @@ function ExperimentInstanceList({ | |||||
| }: ExperimentInstanceListProps) { | }: ExperimentInstanceListProps) { | ||||
| const { message } = App.useApp(); | const { message } = App.useApp(); | ||||
| const allIntanceIds = useMemo(() => { | const allIntanceIds = useMemo(() => { | ||||
| return experimentInsList?.map((item) => item.id) || []; | |||||
| return ( | |||||
| experimentInsList | |||||
| ?.filter( | |||||
| (item) => | |||||
| item.status !== ExperimentStatus.Running && item.status !== ExperimentStatus.Pending, | |||||
| ) | |||||
| .map((item) => item.id) || [] | |||||
| ); | |||||
| }, [experimentInsList]); | }, [experimentInsList]); | ||||
| const [ | const [ | ||||
| selectedIns, | selectedIns, | ||||
| @@ -126,7 +133,12 @@ function ExperimentInstanceList({ | |||||
| <div> | <div> | ||||
| <div className={styles.tableExpandBox} style={{ paddingBottom: '16px' }}> | <div className={styles.tableExpandBox} style={{ paddingBottom: '16px' }}> | ||||
| <div className={styles.check}> | <div className={styles.check}> | ||||
| <Checkbox checked={checked} indeterminate={indeterminate} onChange={checkAll}></Checkbox> | |||||
| <Checkbox | |||||
| checked={checked} | |||||
| indeterminate={indeterminate} | |||||
| disabled={allIntanceIds.length === 0} | |||||
| onChange={checkAll} | |||||
| ></Checkbox> | |||||
| </div> | </div> | ||||
| <div className={styles.index}>序号</div> | <div className={styles.index}>序号</div> | ||||
| <div className={styles.description}>运行时长</div> | <div className={styles.description}>运行时长</div> | ||||
| @@ -0,0 +1,7 @@ | |||||
| import styles from './index.less'; | |||||
| function EmptyLog() { | |||||
| return <div className={styles['empty-log']}>暂无日志</div>; | |||||
| } | |||||
| export default EmptyLog; | |||||
| @@ -5,3 +5,14 @@ | |||||
| height: 100%; | height: 100%; | ||||
| } | } | ||||
| } | } | ||||
| .empty-log { | |||||
| height: 100%; | |||||
| padding: 15px; | |||||
| color: white; | |||||
| font-size: 14px; | |||||
| white-space: pre-line; | |||||
| text-align: center; | |||||
| word-break: break-all; | |||||
| background: #19253b; | |||||
| } | |||||
| @@ -2,6 +2,7 @@ import { ExperimentStatus } from '@/enums'; | |||||
| import { AutoMLInstanceData } from '@/pages/AutoML/types'; | import { AutoMLInstanceData } from '@/pages/AutoML/types'; | ||||
| import LogList from '@/pages/Experiment/components/LogList'; | import LogList from '@/pages/Experiment/components/LogList'; | ||||
| import { NodeStatus } from '@/types'; | import { NodeStatus } from '@/types'; | ||||
| import EmptyLog from './empty'; | |||||
| import styles from './index.less'; | import styles from './index.less'; | ||||
| const NodePrefix = 'auto-ml'; | const NodePrefix = 'auto-ml'; | ||||
| @@ -19,7 +20,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| return ( | return ( | ||||
| <div className={styles['experiment-log']}> | <div className={styles['experiment-log']}> | ||||
| <div className={styles['experiment-log__log']}> | <div className={styles['experiment-log__log']}> | ||||
| {nodeStatus && ( | |||||
| {nodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -28,6 +29,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={nodeStatus.startedAt} | instanceNodeStartTime={nodeStatus.startedAt} | ||||
| instanceNodeStatus={nodeStatus.phase as ExperimentStatus} | instanceNodeStatus={nodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| @@ -39,7 +39,14 @@ function ExperimentInstanceList({ | |||||
| }: ExperimentInstanceListProps) { | }: ExperimentInstanceListProps) { | ||||
| const { message } = App.useApp(); | const { message } = App.useApp(); | ||||
| const allIntanceIds = useMemo(() => { | const allIntanceIds = useMemo(() => { | ||||
| return experimentInsList?.map((item) => item.id) || []; | |||||
| return ( | |||||
| experimentInsList | |||||
| ?.filter( | |||||
| (item) => | |||||
| item.status !== ExperimentStatus.Running && item.status !== ExperimentStatus.Pending, | |||||
| ) | |||||
| .map((item) => item.id) || [] | |||||
| ); | |||||
| }, [experimentInsList]); | }, [experimentInsList]); | ||||
| const [ | const [ | ||||
| selectedIns, | selectedIns, | ||||
| @@ -127,7 +134,12 @@ function ExperimentInstanceList({ | |||||
| <div> | <div> | ||||
| <div className={styles.tableExpandBox} style={{ paddingBottom: '16px' }}> | <div className={styles.tableExpandBox} style={{ paddingBottom: '16px' }}> | ||||
| <div className={styles.check}> | <div className={styles.check}> | ||||
| <Checkbox checked={checked} indeterminate={indeterminate} onChange={checkAll}></Checkbox> | |||||
| <Checkbox | |||||
| checked={checked} | |||||
| indeterminate={indeterminate} | |||||
| disabled={allIntanceIds.length === 0} | |||||
| onChange={checkAll} | |||||
| ></Checkbox> | |||||
| </div> | </div> | ||||
| <div className={styles.index}>序号</div> | <div className={styles.index}>序号</div> | ||||
| <div className={styles.tensorBoard}>可视化</div> | <div className={styles.tensorBoard}>可视化</div> | ||||
| @@ -54,7 +54,10 @@ function LogGroup({ | |||||
| useEffect(() => { | useEffect(() => { | ||||
| // 建立 socket 连接 | // 建立 socket 连接 | ||||
| const setupSockect = () => { | const setupSockect = () => { | ||||
| const { host } = location; | |||||
| let { host } = location; | |||||
| if (process.env.NODE_ENV === 'development') { | |||||
| host = '172.20.32.235:31213'; | |||||
| } | |||||
| const socket = new WebSocket( | const socket = new WebSocket( | ||||
| `ws://${host}/newlog/realtimeLog?start=${start_time}&query={pod="${pod_name}"}`, | `ws://${host}/newlog/realtimeLog?start=${start_time}&query={pod="${pod_name}"}`, | ||||
| ); | ); | ||||
| @@ -168,7 +168,7 @@ function HyperParameterInstance() { | |||||
| className={styles['hyper-parameter-instance__basic']} | className={styles['hyper-parameter-instance__basic']} | ||||
| info={experimentInfo} | info={experimentInfo} | ||||
| runStatus={workflowStatus} | runStatus={workflowStatus} | ||||
| instanceStatus={instanceInfo?.status} | |||||
| instanceStatus={instanceInfo?.status as ExperimentStatus} | |||||
| isInstance | isInstance | ||||
| /> | /> | ||||
| ), | ), | ||||
| @@ -1,4 +1,5 @@ | |||||
| import { ExperimentStatus } from '@/enums'; | import { ExperimentStatus } from '@/enums'; | ||||
| import EmptyLog from '@/pages/AutoML/components/ExperimentLog/empty'; | |||||
| import LogList from '@/pages/Experiment/components/LogList'; | import LogList from '@/pages/Experiment/components/LogList'; | ||||
| import { HyperParameterInstanceData } from '@/pages/HyperParameter/types'; | import { HyperParameterInstanceData } from '@/pages/HyperParameter/types'; | ||||
| import { NodeStatus } from '@/types'; | import { NodeStatus } from '@/types'; | ||||
| @@ -64,7 +65,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| // icon: <KFIcon type="icon-rizhi1" />, | // icon: <KFIcon type="icon-rizhi1" />, | ||||
| children: ( | children: ( | ||||
| <div className={styles['experiment-log__tabs__log']}> | <div className={styles['experiment-log__tabs__log']}> | ||||
| {trainCloneNodeStatus && ( | |||||
| {trainCloneNodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -73,6 +74,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={trainCloneNodeStatus.startedAt} | instanceNodeStartTime={trainCloneNodeStatus.startedAt} | ||||
| instanceNodeStatus={trainCloneNodeStatus.phase as ExperimentStatus} | instanceNodeStatus={trainCloneNodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| ), | ), | ||||
| @@ -83,7 +86,7 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| // icon: <KFIcon type="icon-rizhi1" />, | // icon: <KFIcon type="icon-rizhi1" />, | ||||
| children: ( | children: ( | ||||
| <div className={styles['experiment-log__tabs__log']}> | <div className={styles['experiment-log__tabs__log']}> | ||||
| {hpoNodeStatus && ( | |||||
| {hpoNodeStatus ? ( | |||||
| <LogList | <LogList | ||||
| instanceName={instanceInfo.argo_ins_name} | instanceName={instanceInfo.argo_ins_name} | ||||
| instanceNamespace={instanceInfo.argo_ins_ns} | instanceNamespace={instanceInfo.argo_ins_ns} | ||||
| @@ -92,6 +95,8 @@ function ExperimentLog({ instanceInfo, nodes }: ExperimentLogProps) { | |||||
| instanceNodeStartTime={hpoNodeStatus.startedAt} | instanceNodeStartTime={hpoNodeStatus.startedAt} | ||||
| instanceNodeStatus={hpoNodeStatus.phase as ExperimentStatus} | instanceNodeStatus={hpoNodeStatus.phase as ExperimentStatus} | ||||
| ></LogList> | ></LogList> | ||||
| ) : ( | |||||
| <EmptyLog /> | |||||
| )} | )} | ||||
| </div> | </div> | ||||
| ), | ), | ||||