#497 #478;#488

Merged
liwei03 merged 10 commits from openioctopus/octopus:master into master 1 year ago
  1. +1
    -1
      deploy/charts/octopus/values.yaml
  2. +1
    -1
      deploy/single_master_k8s_install/base.config
  3. +2
    -0
      openai-portal/src/views/deployManager/components/dialogForm.vue
  4. +2
    -0
      openai-portal/src/views/modelDev/components/notebook/notebookCreation.vue
  5. +4
    -4
      openai-portal/src/views/setting/ftp.vue
  6. +14
    -56
      openai-portal/src/views/trainingManager/components/createDialog/distributedTask.vue
  7. +18
    -3
      openai-portal/src/views/trainingManager/components/createDialog/index.vue
  8. +17
    -10
      openai-portal/src/views/trainingManager/components/createDialog/traningList.vue
  9. +6
    -1
      openai-portal/src/views/trainingManager/components/editDialog/distributedTask.vue
  10. +104
    -42
      openai-portal/src/views/trainingManager/components/editDialog/index.vue
  11. +15
    -8
      openai-portal/src/views/trainingManager/components/editDialog/traningList.vue
  12. +1
    -20
      openai-portal/src/views/trainingManager/taskTemplate.vue

+ 1
- 1
deploy/charts/octopus/values.yaml View File

@@ -147,7 +147,7 @@ baseserver:
baseUrl: 192.168.202.73
pytorchServer:
imageAddr: 192.168.202.110:5000/octopus/pytorchserver
version: 2.0.4
version: 2.0.5
sftpgo:
username: admin
password: abcde


+ 1
- 1
deploy/single_master_k8s_install/base.config View File

@@ -4,7 +4,7 @@ masterip="192.168.0.2"
# 过滤IP段,用于过滤得到服务器的IP地址
ip_segment="192.168.0"

k8s_version="v1.18.20"
k8s_version="v1.20.1"
kube_version=${k8s_version/v/}

# root用户密码,请设置k8s集群所有服务器root用户密码为统一密码


+ 2
- 0
openai-portal/src/views/deployManager/components/dialogForm.vue View File

@@ -347,6 +347,8 @@
// 获取资源规格
getResourceList() {
this.specificationVisible = true
this.ruleForm.resourceSpecId = ""
this.resourceOptions = []
getResourceList(this.ruleForm.resourcePool).then(response => {
if (response.success) {
response.data.mapResourceSpecIdList.deploy.resourceSpecs.forEach(


+ 2
- 0
openai-portal/src/views/modelDev/components/notebook/notebookCreation.vue View File

@@ -292,6 +292,8 @@
},
getResource() {
this.specificationVisible = true
this.ruleForm.specification = ""
this.resourceList = []
getResourceList(this.ruleForm.resourcePool).then(response => {
if (response.success) {
response.data.mapResourceSpecIdList.debug.resourceSpecs.forEach(


+ 4
- 4
openai-portal/src/views/setting/ftp.vue View File

@@ -3,7 +3,7 @@
<el-row :gutter="20">
<div style="float:left;width:126px;height:40px;text-align:center;padding-top:12px;">ftp设置</div>
</el-row>
<el-divider class="demo"></el-divider>
<el-divider class="dividerClass"></el-divider>
<el-row :gutter="20">
<el-col :span="12" :offset="6">
<el-form ref="ftpForm" :rules="ftpRules" :model="ftpForm" style="margin: 0 auto;">
@@ -14,8 +14,8 @@
<el-input v-model="ftpForm.ftpUserName" placeholder="请填写账号" :disabled="isShow" minlength="4" maxlength="30" show-word-limit/>
</el-form-item>
<el-form-item label="ftp密码:" prop="ftpPassword">
<el-input v-model="ftpForm.ftpPassword" :type="[passFlag?'text':'password']" placeholder="请输入密码" minlength="8" maxlength="30" show-word-limit>
<i slot="suffix" :class="[passFlag?'el-icon-minus':'el-icon-view']" style="margin-top:8px;font-size:18px;" autocomplete="auto" @click="passFlag=!passFlag" />
<el-input v-model="ftpForm.ftpPassword" show-password placeholder="请输入密码" minlength="8" maxlength="30" show-word-limit>
<!-- <i slot="suffix" :class="[passFlag?'el-icon-minus':'el-icon-view']" style="margin-top:8px;font-size:18px;" autocomplete="auto" @click="passFlag=!passFlag" /> -->
</el-input>
</el-form-item>
<el-button style="float: right;" type="primary" @click="submit">创建</el-button>
@@ -113,7 +113,7 @@ export default {
padding: 20px;
min-height: 900px;
}
.demo {
.dividerClass {
margin:5px 0 5px 0 !important;
}
</style>

+ 14
- 56
openai-portal/src/views/trainingManager/components/createDialog/distributedTask.vue View File

@@ -33,24 +33,16 @@
<el-button type="primary" @click="addItem">增加</el-button>
<el-button type="text" :disabled="showArg" @click="open">预览</el-button>
</el-form-item>

<div>
<el-form-item label="资源池" prop="resourcePool" style="display:inline-block;">
<el-select v-model="ruleForm.resourcePool" placeholder="请选择资源池" @change="getResourceList">
<el-option v-for="(item, index) in poolList" :key="index" :label="item" :value="item" />
</el-select>
</el-form-item>
<el-form-item v-if="specificationVisible" label="资源规格" prop="resourceSpecId" style="display:inline-block;">
<el-select v-model="ruleForm.resourceSpecId" placeholder="请选择资源规格">
<el-option
v-for="item in resourceOptions"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
</div>
<el-form-item label="资源规格" prop="resourceSpecId">
<el-select v-model="ruleForm.resourceSpecId" placeholder="请选择资源规格" style="width:35%">
<el-option
v-for="item in resourceOptions"
:key="item.id"
:label="item.label"
:value="item.value"
/>
</el-select>
</el-form-item>
<el-form-item label="副本个数" prop="taskNumber">
<el-input v-model.number="ruleForm.taskNumber" />
</el-form-item>
@@ -76,7 +68,6 @@
</template>

<script>
import { mapGetters } from 'vuex'
import { getResourceList } from '@/api/trainingManager.js'
export default {
name: "DistributedTask",
@@ -92,8 +83,6 @@
},
data() {
return {
specificationVisible:false,
poolList: [],
ruleForm: {
name: '',
command: '',
@@ -106,7 +95,6 @@
key: "",
value: ""
}],
resourcePool: "",
},
CreateFormVisible: true,
resourceOptions: [],
@@ -140,9 +128,6 @@
],
isMainRole: [
{ required: true, message: '请选择是否为主任务', trigger: 'change' }
],
resourcePool: [
{ required: true, message: "请选择资源池", trigger: "blur" }
]
},
formLabelWidth: '160px',
@@ -166,26 +151,11 @@

return flag
}
},
...mapGetters([
'workspaces'
])
}
},
created() {
this.ruleForm = this.row
// this.getResourceList()
this.getSpacePools();
if(!this.flag) {
this.specificationVisible = true
this.ruleForm.resourceOptions.forEach(
item => {
if(item.value == this.ruleForm.resourceSpecId) {
this.ruleForm.resourceSpecId = item.label
}
}
)
this.getResourceList()
}
this.getResourceItem()
},
beforeDestroy() {
this.ruleForm = {}
@@ -229,22 +199,10 @@
handleDialogClose() {
this.$emit('close', false)
},
getSpacePools() {
let workspaceName = JSON.parse(sessionStorage.getItem('space')).workspaceName
this.workspaces.forEach(
item => {
// 获取当前群组绑定资源池列表
if(item.name == workspaceName) {
this.poolList = item.resourcePools
}
}
)
},
// 获取资源规格
getResourceList() {
getResourceList(this.ruleForm.resourcePool).then(response => {
getResourceItem() {
getResourceList(this.row.disResourcePool).then(response => {
if (response.success) {
this.specificationVisible = true
response.data.mapResourceSpecIdList.train.resourceSpecs.forEach(
item => {
this.resourceOptions.push({ label: item.name + ' ' + item.price + '机时/h', value: item.id })


+ 18
- 3
openai-portal/src/views/trainingManager/components/createDialog/index.vue View File

@@ -82,12 +82,19 @@
</el-form-item>
</div>
<el-divider />
<el-form-item label="分布式" prop="distributed ">
<el-form-item label="分布式" prop="distributed" style="display:inline-block;">
<el-select v-model="ruleForm.isDistributed">
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</el-form-item>
<div v-if="!show" style="display:inline-block;">
<el-form-item label="资源池" prop="disResourcePool">
<el-select v-model="ruleForm.disResourcePool" placeholder="请选择资源池" @change="getResourceList">
<el-option v-for="(item, index) in poolList" :key="index" :label="item" :value="item" />
</el-select>
</el-form-item>
</div>
<div v-if="show">
<el-form-item label="运行命令" prop="command">
<el-input v-model="ruleForm.command" type="textarea" />
@@ -120,7 +127,7 @@
</div>
</div>
<div v-if="!show">
<traningList :training-table="table" :resource="resourceOptions" @tableData="getTableData" />
<traningList :training-table="table" :disResourcePool="ruleForm.disResourcePool" @tableData="getTableData" />
</div>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -191,6 +198,7 @@
}],
resourceSpecId: "",
resourcePool: "",
disResourcePool: "",
command: ''
},
CreateFormVisible: true,
@@ -234,6 +242,9 @@
],
resourcePool: [
{ required: true, message: "请选择资源池", trigger: "blur" }
],
disResourcePool: [
{ required: true, message: "请选择资源池", trigger: "blur" }
]
},
formLabelWidth: '120px',
@@ -352,6 +363,8 @@
// 获取资源规格
getResourceList() {
this.specificationVisible = true
this.ruleForm.resourceSpecId = ""
this.resourceOptions = []
getResourceList(this.ruleForm.resourcePool).then(response => {
if (response.success) {
response.data.mapResourceSpecIdList.train.resourceSpecs.forEach(
@@ -451,15 +464,17 @@
this.ruleForm.config[0].taskNumber = 1
this.ruleForm.config[0].minFailedTaskCount = 1
this.ruleForm.config[0].minSucceededTaskCount = 1
this.ruleForm.config[0].resourcePool = this.ruleForm.resourcePool
this.ruleForm.disResourcePool = this.ruleForm.resourcePool
delete this.ruleForm.config[0].isMainRole
}
var data = JSON.parse(JSON.stringify(this.ruleForm))
data.resourcePool = data.disResourcePool
delete data.command;
delete data.resourceSpecId
delete data.algorithmSource
delete data.imageSource
delete data.dataSetSource
delete data.disResourcePool
if (this.flag === 3) {
if (!this.algorithmChange) {


+ 17
- 10
openai-portal/src/views/trainingManager/components/createDialog/traningList.vue View File

@@ -29,7 +29,7 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button type="text" @click="handleEdit(scope.$index,scope.row)">编辑</el-button>
<el-button type="text" @click.native.prevent="handleDelete(scope.$index, tableData)">删除
</el-button>
</template>
@@ -62,9 +62,9 @@
type: Array,
default: () => []
},
resource: {
type: Array,
default: () => []
disResourcePool: {
type: String,
default: () => ""
}
},
data() {
@@ -73,8 +73,8 @@
FormVisible: false,
row: {},
flag: true,
resourceOptions: []
resourceOptions: [],
currentIndex: undefined
}
},
watch: {
@@ -84,15 +84,22 @@
},
created() {
this.tableData = this.trainingTable
// this.getResourceList()
},
methods: {
add() {
if(!this.disResourcePool) {
this.$message({
message: '请先选择资源池',
type: 'warning'
});
return
}
this.FormVisible = true
this.flag = true
this.row = { parameters: [] }
this.row = { parameters: [], disResourcePool: this.disResourcePool }
},
handleEdit(row) {
handleEdit(index,row) {
this.currentIndex = index
this.FormVisible = true
this.row = row
this.flag = false
@@ -111,7 +118,7 @@
val.taskNumber = parseInt(val.taskNumber)
val.minFailedTaskCount = parseInt(val.minFailedTaskCount)
val.minSucceededTaskCount = parseInt(val.minSucceededTaskCount)
console.log(this.tableData,val)
this.tableData[this.currentIndex] = val
// flag为true新增
// flag为false编辑
if (this.flag) { this.tableData.push(val); }


+ 6
- 1
openai-portal/src/views/trainingManager/components/editDialog/distributedTask.vue View File

@@ -79,6 +79,10 @@
flag: {
type: Boolean,
default: false
},
resourcePool: {
type: String,
default: () => ""
}
},
data() {
@@ -201,7 +205,8 @@
},
// 获取资源规格
getResourceList() {
getResourceList().then(response => {
this.resourceOptions = []
getResourceList(this.resourcePool).then(response => {
if (response.success) {
response.data.mapResourceSpecIdList.train.resourceSpecs.forEach(
item => {


+ 104
- 42
openai-portal/src/views/trainingManager/components/editDialog/index.vue View File

@@ -80,12 +80,19 @@
</el-form-item>
</div>
<el-divider />
<el-form-item label="分布式" prop="distributed ">
<el-form-item label="分布式" prop="distributed" style="display:inline-block;">
<el-select v-model="ruleForm.isDistributed" :disabled="true">
<el-option label="是" :value="true" />
<el-option label="否" :value="false" />
</el-select>
</el-form-item>
<div v-if="!show" style="display:inline-block;">
<el-form-item label="资源池" prop="resourcePool">
<el-select v-model="ruleForm.resourcePool" placeholder="请选择资源池" @change="changeDisResourceList">
<el-option v-for="(item, index) in poolList" :key="index" :label="item" :value="item" />
</el-select>
</el-form-item>
</div>
<div v-if="show">
<el-form-item label="运行命令" prop="command">
<el-input v-model="ruleForm.command" type="textarea" />
@@ -102,15 +109,23 @@
<el-button type="primary" @click="addItem">增加</el-button>
<el-button type="text" :disabled="showArg" @click="open">预览</el-button>
</el-form-item>
<el-form-item label="资源规格" prop="resourceSpecId">
<el-select v-model="ruleForm.resourceSpecId" placeholder="请选择资源规格" style="width:35%">
<el-option v-for="(item,index) in resourceOptions" :key="index" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>

<div>
<el-form-item label="资源池" prop="resourcePool" style="display:inline-block;">
<el-select v-model="ruleForm.resourcePool" placeholder="请选择资源池" @change="changeResourceList">
<el-option v-for="(item, index) in poolList" :key="index" :label="item" :value="item" />
</el-select>
</el-form-item>
<el-form-item label="资源规格" prop="resourceSpecId" style="display:inline-block;">
<el-select v-model="ruleForm.resourceSpecId" placeholder="请选择资源规格" @click.native="getResourceItem">
<el-option v-for="(item,index) in resourceOptions" :key="index" :label="item.label"
:value="item.value" />
</el-select>
</el-form-item>
</div>
</div>
<div v-if="!show">
<traningList :training-table="table" :resource="resourceOptions" @tableData="getTableData" />
<traningList :resourcePool="ruleForm.resourcePool" :training-table="table" @tableData="getTableData" />
</div>
</el-form>
<div slot="footer" class="dialog-footer">
@@ -125,6 +140,7 @@
</template>

<script>
import { mapGetters } from 'vuex'
import traningList from './traningList.vue'
import { createTask, getResourceList, editTemplate } from '@/api/trainingManager'
import { getPresetAlgorithmList, getPublicAlgorithmList, getMyAlgorithmList, getAlgorithmVersionList } from '@/api/modelDev'
@@ -148,6 +164,7 @@
},
data() {
return {
poolList: [],
// 模板id
id: '',
show: true,
@@ -179,6 +196,7 @@

}],
resourceSpecId: "",
resourcePool: "",
command: ''
},

@@ -214,6 +232,9 @@
],
resourceSpecId: [
{ required: true, message: '请选择活资源规格', trigger: 'change' }
],
resourcePool: [
{ required: true, message: "请选择资源池", trigger: "blur" }
]
},
formLabelWidth: '120px',
@@ -291,8 +312,10 @@

return flag
}
}

},
...mapGetters([
'workspaces'
])
},
watch: {
'ruleForm.isDistributed': {
@@ -302,7 +325,6 @@
}

}

},
created() {
this.algorithmName = true
@@ -311,46 +333,76 @@
this.dataSetName = true
this.dataSetVersion = true
// 获取模板信息
// 1编辑模块2创建训练任务
this.getResourceList()
this.getSpacePools()
},
methods: {
getSpacePools() {
let workspaceName = JSON.parse(sessionStorage.getItem('space')).workspaceName
this.workspaces.forEach(
item => {
// 获取当前群组绑定资源池列表
if(item.name == workspaceName) {
this.poolList = item.resourcePools
}
}
)
const data = JSON.parse(JSON.stringify(this.row))
this.temp.imageVersion = data.imageVersion
this.temp.algorithmId = data.algorithmId
this.temp.imageId = data.imageId
this.temp.dataSetId = data.dataSetId
this.id = data.id
delete this.row.createdAt
delete this.row.workspaceId
delete this.row.userId
delete this.row.updatedAt
delete this.row.id
delete this.row.imageVersion
this.ruleForm = this.row
this.ruleForm.imageId = this.row.imageName + ':' + this.temp.imageVersion
this.ruleForm.algorithmId = this.row.algorithmName
this.ruleForm.dataSetId = this.row.dataSetName
delete this.ruleForm.algorithmName
delete this.ruleForm.imageName
delete this.ruleForm.dataSetName
this.$set(this.ruleForm, "command", data.config[0].command)
this.$set(this.ruleForm, "resourceSpecId", data.config[0].resourceSpecId)
this.ruleForm.resourceSpecId = data.config[0].resourceSpecName + " " + data.config[0].resourceSpecPrice + "机时/h"
if (this.ruleForm.isDistributed) {
this.table = this.ruleForm.config
}
if (this.flag === 2) {
this.ruleForm.name = ''
}
this.getResourceList()
},
changeDisResourceList() {
this.resourceOptions = []
this.ruleForm.resourceSpecId = ""
this.table.forEach(
item => {
item.resourceSpecId = ""
}
)
},
changeResourceList() {
this.resourceOptions = []
this.ruleForm.resourceSpecId = ""
},
getResourceItem() {
this.resourceOptions = []
this.ruleForm.resourceSpecId = ""
this.getResourceList()
},
// 获取资源规格
getResourceList() {
getResourceList().then(response => {
getResourceList(this.row.resourcePool).then(response => {
if (response.success) {
response.data.mapResourceSpecIdList.train.resourceSpecs.forEach(
item => {
this.resourceOptions.push({ label: item.name + ' ' + item.price + '机时/h', value: item.id })
}
)
const data = JSON.parse(JSON.stringify(this.row))
this.temp.imageVersion = data.imageVersion
this.temp.algorithmId = data.algorithmId
this.temp.imageId = data.imageId
this.temp.dataSetId = data.dataSetId
this.id = data.id
delete this.row.createdAt
delete this.row.workspaceId
delete this.row.userId
delete this.row.updatedAt
delete this.row.id
delete this.row.imageVersion
this.ruleForm = this.row
this.ruleForm.imageId = this.row.imageName + ':' + this.temp.imageVersion
this.ruleForm.algorithmId = this.row.algorithmName
this.ruleForm.dataSetId = this.row.dataSetName
delete this.ruleForm.algorithmName
delete this.ruleForm.imageName
delete this.ruleForm.dataSetName
this.$set(this.ruleForm, "command", data.config[0].command)
this.$set(this.ruleForm, "resourceSpecId", data.config[0].resourceSpecId)
if (this.ruleForm.isDistributed) {
this.table = this.ruleForm.config
}
if (this.flag === 2) {
this.ruleForm.name = ''
}
}
})
},
@@ -410,13 +462,23 @@
if (!this.ruleForm.isDistributed) {
this.ruleForm.config = [this.ruleForm.config[0]]
this.ruleForm.config[0].command = this.ruleForm.command
this.ruleForm.config[0].resourceSpecId = this.ruleForm.resourceSpecId
this.ruleForm.config[0].name = this.ruleForm.name
this.ruleForm.config[0].taskNumber = 1
this.ruleForm.config[0].minFailedTaskCount = 1
this.ruleForm.config[0].minSucceededTaskCount = 1
delete this.ruleForm.config[0].isMainRole
delete this.ruleForm.config[0].name
if(this.ruleForm.resourceSpecId.slice(-2) == "/h") {
this.resourceOptions.forEach(
item => {
if(item.label == this.ruleForm.resourceSpecId) {
this.ruleForm.config[0].resourceSpecId = item.value
}
}
)
} else {
this.ruleForm.config[0].resourceSpecId = this.ruleForm.resourceSpecId
}
}
var data = JSON.parse(JSON.stringify(this.ruleForm))
if (!this.algorithmChange) {


+ 15
- 8
openai-portal/src/views/trainingManager/components/editDialog/traningList.vue View File

@@ -29,7 +29,7 @@
</el-table-column>
<el-table-column label="操作">
<template slot-scope="scope">
<el-button type="text" @click="handleEdit(scope.row)">编辑</el-button>
<el-button type="text" @click="handleEdit(scope.$index,scope.row)">编辑</el-button>
<el-button type="text" @click.native.prevent="handleDelete(scope.$index, tableData)">删除
</el-button>
</template>
@@ -41,6 +41,8 @@
v-if="FormVisible"
:row="row"
:flag="flag"
:resourcePool="resourcePool"
:disResourceOptions="resourceOptions"
@cancel="cancel"
@confirm="confirm"
@close="close"
@@ -62,9 +64,9 @@
type: Array,
default: () => []
},
resource: {
type: Array,
default: () => []
resourcePool: {
type: String,
default: () => ""
}
},
data() {
@@ -73,13 +75,16 @@
FormVisible: false,
row: {},
flag: true,
resourceOptions: []
resourceOptions: [],
currentIndex: undefined
}
},
watch: {
tableData() {
this.$emit('tableData', this.tableData)
},
resourcePool() {
this.getResourceList()
}
},
created() {
@@ -92,7 +97,8 @@
this.flag = true
this.row = { parameters: [] }
},
handleEdit(row) {
handleEdit(index,row) {
this.currentIndex = index
this.FormVisible = true
this.row = row
this.flag = false
@@ -114,6 +120,7 @@
val.taskNumber = parseInt(val.taskNumber)
val.minFailedTaskCount = parseInt(val.minFailedTaskCount)
val.minSucceededTaskCount = parseInt(val.minSucceededTaskCount)
this.tableData[this.currentIndex] = val
// flag为true新增
// flag为false编辑

@@ -130,7 +137,7 @@
},
// 获取资源规格
getResourceList() {
getResourceList().then(response => {
getResourceList(this.resourcePool).then(response => {
if (response.success) {
response.data.mapResourceSpecIdList.train.resourceSpecs.forEach(
item => {


+ 1
- 20
openai-portal/src/views/trainingManager/taskTemplate.vue View File

@@ -127,16 +127,6 @@
if (response.success) {
this.tableData = response.data.jobTemplates
this.total = response.data.totalSize
getResourceList().then(response => {
if (response.success) {
this.resourceOptions = response.data.mapResourceSpecIdList.train.resourceSpecs
} else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
type: 'warning'
});
}
})
} else {
this.$message({
message: this.getErrorMsg(response.error.subcode),
@@ -146,9 +136,7 @@
})
},
handleEdit(val, name) {
getResourceList().then(response => {
if (response.success && response.data.mapResourceSpecIdList.train.resourceSpecs.length !== 0) {
getTempalteDetail(val.id).then(response => {
getTempalteDetail(val.id).then(response => {
if (response.success) {
this.editDialog = true
this.row = response.data.jobTemplate
@@ -160,13 +148,6 @@
});
}
})
} else {
this.$message({
message: '资源规格为空',
type: 'warning'
});
}
})
},
handleDelete(val) {
let templateIds = []


Loading…
Cancel
Save