Skip to content

Commit

Permalink
增加任务模板参数的长文本类型
Browse files Browse the repository at this point in the history
  • Loading branch information
data-infra committed Jun 29, 2024
1 parent 56e14c6 commit a9cbc70
Show file tree
Hide file tree
Showing 98 changed files with 413 additions and 219 deletions.
6 changes: 3 additions & 3 deletions install/docker/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,9 +746,9 @@ class CeleryConfig(object):
['ccr.ccs.tencentyun.com/cube-studio/notebook:jupyter-ubuntu-bigdata', 'jupyter(bigdata)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:jupyter-ubuntu-machinelearning', 'jupyter(machinelearning)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:jupyter-ubuntu-deeplearning', 'jupyter(deeplearning)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-jupyter-ubuntu-cpu-pro', 'jupyter-conda-pro(企业版)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-matlab-ubuntu-deeplearning', 'matlab(企业版)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-rstudio-ubuntu-bigdata', 'rstudio(企业版)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-jupyter-ubuntu-cpu-pro', 'jupyter-conda-pro(todo)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-matlab-ubuntu-deeplearning', 'matlab(todo)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-rstudio-ubuntu-bigdata', 'rstudio(todo)'],
]

# 定时检查大小的目录列表。需要再celery中启动检查任务
Expand Down
2 changes: 1 addition & 1 deletion install/docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ services:
myapp:
image: ccr.ccs.tencentyun.com/cube-studio/kubeflow-dashboard:2024.06.01
restart: unless-stopped
command: [ 'bash','-c','/entrypoint.sh' ]
command: [ 'bash','-c','sleep 10000000 && /entrypoint.sh' ]
environment:
STAGE: 'dev'
REDIS_HOST: 'redis'
Expand Down
6 changes: 3 additions & 3 deletions install/kubernetes/cube/overlays/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -746,9 +746,9 @@ class CeleryConfig(object):
['ccr.ccs.tencentyun.com/cube-studio/notebook:jupyter-ubuntu-bigdata', 'jupyter(bigdata)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:jupyter-ubuntu-machinelearning', 'jupyter(machinelearning)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:jupyter-ubuntu-deeplearning', 'jupyter(deeplearning)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-jupyter-ubuntu-cpu-pro', 'jupyter-conda-pro(企业版)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-matlab-ubuntu-deeplearning', 'matlab(企业版)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-rstudio-ubuntu-bigdata', 'rstudio(企业版)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-jupyter-ubuntu-cpu-pro', 'jupyter-conda-pro(todo)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-matlab-ubuntu-deeplearning', 'matlab(todo)'],
['ccr.ccs.tencentyun.com/cube-studio/notebook:enterprise-rstudio-ubuntu-bigdata', 'rstudio(todo)'],
]

# 定时检查大小的目录列表。需要再celery中启动检查任务
Expand Down
6 changes: 5 additions & 1 deletion myapp/frontend/src/components/DynamicForm/DynamicForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,11 @@ export default function DynamicForm(props: IProps) {
extra={config.description ? <span dangerouslySetInnerHTML={{ __html: config.description }}></span> : null}
{...itemProps}
>
<FileUploadPlus />
<FileUploadPlus
filetype={config.data.type}
format={config.data.format}
maxCount={config.data.maxCount || 1}
/>
</Form.Item>
}

Expand Down
23 changes: 12 additions & 11 deletions myapp/frontend/src/components/FileUploadPlus/FileUploadPlus.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import React, { useEffect, useState } from 'react'
import './FileUploadPlus.less';

interface Iprops {
type?: TFileType
filetype?: TFileType
onChange?: (value: any) => void
value?: string[]
maxCount?: number
Expand All @@ -33,9 +33,9 @@ export default function FileUploadPlus(props: Iprops) {
reader.addEventListener('load', () => callback(reader.result));
reader.readAsDataURL(img);
}

// console.log('props', props);
function beforeUpload(file: RcFile) {
console.log('file', file);
// console.log('file', file);

const maxCount = props.maxCount || 1
if (fileList.length >= maxCount) {
Expand Down Expand Up @@ -103,10 +103,10 @@ export default function FileUploadPlus(props: Iprops) {
return url;
}

const createMediaPreview = (file: UploadFile<any>, fileIndex: number, type: TFileType) => {
const createMediaPreview = (file: UploadFile<any>, fileIndex: number, filetype: TFileType) => {
const url = getObjectURL(file)
const key = Math.random().toString(36).substring(2);
if (type === 'video') {
if (filetype === 'video') {
return <div className="p-r" key={key}>
<span
onClick={() => {
Expand All @@ -121,7 +121,7 @@ export default function FileUploadPlus(props: Iprops) {
</span>
<video className="w100 mb8" src={url} controls></video>
</div>
} else if (type === 'audio') {
} else if (filetype === 'audio') {
return <div className="d-f ac mb8" key={key}>
<audio className="w100 flex1" src={url} controls></audio>
<span
Expand All @@ -145,7 +145,7 @@ export default function FileUploadPlus(props: Iprops) {
<div>
{
fileList.map((file, fileIndex) => {
return createMediaPreview(file, fileIndex, props.type || 'file')
return createMediaPreview(file, fileIndex, props.filetype || 'file')
})
}
</div>
Expand All @@ -154,8 +154,9 @@ export default function FileUploadPlus(props: Iprops) {
fileList={fileList}
showUploadList={false}
customRequest={(options) => {
console.log(options.file);
console.log("options.file",options.file);
const tarList = [...fileList, options.file as RcFile]
console.log("tarList",tarList);
setFileList(tarList)

Promise.all(tarList.map((item: any) => file2Bin(item))).then(res => {
Expand All @@ -176,13 +177,13 @@ export default function FileUploadPlus(props: Iprops) {
>
<p className="ant-upload-drag-icon">
{
(props.type === 'file' || !props.type) ? <InboxOutlined /> : null
(props.filetype === 'file' || !props.filetype) ? <InboxOutlined /> : null
}
{
props.type === 'video' ? <VideoCameraAddOutlined /> : null
props.filetype === 'video' ? <VideoCameraAddOutlined /> : null
}
{
props.type === 'audio' ? <AudioOutlined /> : null
props.filetype === 'audio' ? <AudioOutlined /> : null
}
</p>
<p className="ant-upload-text">点击或拖拽文件上传</p>
Expand Down
5 changes: 3 additions & 2 deletions myapp/frontend/src/locales/main.en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const translation = {
"CPU申请": "CPU req",
"CPU的资源使用限制(单位核),示例 0.4,10,最大50核,如需更多联系管理员": "CPU resource usage limit (in units of cores), example 0.4, 10, maximum 50 cores, contact administrator for more.",
"GPU申请": "GPU req",
"gpu的资源使用限制(单位卡),示例:1,2,训练任务每个容器独占整卡。申请具体的卡型号,可以类似 1(V100),目前支持T4/V100/A100/VGPU": "GPU resource usage limit (in units of cards), example: 1, 2, training tasks occupy the entire card per container. To apply for specific card models, you can use something like 1(V100). Currently supports T4/V100/A100/VGPU.",
"gpu的资源使用限制(单位卡),示例:1,2,训练任务每个容器独占整卡。申请具体的卡型号,可以类似 1(V100)": "GPU resource usage limit (in units of cards), example: 1, 2, training tasks occupy the entire card per container. To apply for specific card models, you can use something like 1(V100).",
"RDMA申请": "RDMA req",
"RDMA的资源使用限制,示例 0,1,10,填写方式咨询管理员": "RDMA resource usage limit, example 0, 1, 10, consult administrator for filling method.",
"超时中断": "timeout",
Expand Down Expand Up @@ -213,7 +213,8 @@ const translation = {
"项目设置": "setting",
"智能推荐下游节点":"Intelligent recommendation of downstream nodes",
"请先选择推荐节点":"Please select the recommended node first.",
"导出数据": "Export data"
"导出数据": "Export data",
"备份":"backup"
}

export default translation
5 changes: 3 additions & 2 deletions myapp/frontend/src/locales/main.zh.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ const translation = {
"CPU申请": "CPU申请",
"CPU的资源使用限制(单位核),示例 0.4,10,最大50核,如需更多联系管理员": "CPU的资源使用限制(单位核),示例 0.4,10,最大50核,如需更多联系管理员",
"GPU申请": "GPU申请",
"gpu的资源使用限制(单位卡),示例:1,2,训练任务每个容器独占整卡。申请具体的卡型号,可以类似 1(V100),目前支持T4/V100/A100/VGPU": "gpu的资源使用限制(单位卡),示例:1,2,训练任务每个容器独占整卡。申请具体的卡型号,可以类似 1(V100),目前支持T4/V100/A100/VGPU",
"gpu的资源使用限制(单位卡),示例:1,2,训练任务每个容器独占整卡。申请具体的卡型号,可以类似 1(V100)": "gpu的资源使用限制(单位卡),示例:1,2,训练任务每个容器独占整卡。申请具体的卡型号,可以类似 1(V100)",
"RDMA申请": "RDMA申请",
"RDMA的资源使用限制,示例 0,1,10,填写方式咨询管理员": "RDMA的资源使用限制,示例 0,1,10,填写方式咨询管理员",
"超时中断": "超时中断",
Expand Down Expand Up @@ -213,7 +213,8 @@ const translation = {
"项目设置": "项目设置",
"智能推荐下游节点":"智能推荐下游节点",
"请先选择推荐节点":"请先选择推荐节点",
"导出数据": "导出数据"
"导出数据": "导出数据",
"备份":"备份"
}

export default translation
2 changes: 1 addition & 1 deletion myapp/frontend/src/pages/CommonPipeline/NodeDetail.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,7 @@ export default function NodeDetail(props: IProps) {
{
tab.content.map((group, groupIndex) => {
return <div className="mb32" key={`nodeGroup${groupIndex}`}>
<div className="fs16 mb16 bor-l b-theme pl4" style={{ borderLeftWidth: 2 }}>{group.groupName}</div>
<div className="fs16 mb16 bor-l b-theme pl4" style={{ borderLeftWidth: 2 }} dangerouslySetInnerHTML={{ __html: group.groupName }}></div>
<div>
{handleGroupContent(group.groupContent.type, group.groupContent.value, tab.tabName, group.groupName)}
</div>
Expand Down
2 changes: 1 addition & 1 deletion myapp/frontend/src/pages/DataSearch/DataSearch.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -534,7 +534,7 @@ export default function DataSearch() {
}}
options={[
'test',
]} placeholder={t('AI智能生成(企业版)')} width={'240px'} /> : null
]} placeholder={t('AI智能生成')} width={'240px'} /> : null
}
</div>
<div className="d-f ac">
Expand Down
Loading

0 comments on commit a9cbc70

Please sign in to comment.