Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add data factory ui #3

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 11 additions & 7 deletions dolphinscheduler-ui/src/locales/en_US/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,10 @@ export default {
confirm: 'Confirm',
cancel: 'Cancel',
delete_confirm: 'Delete?',
authorize_level:'Authorize Level',
authorize_level: 'Authorize Level',
no_permission: 'No Permission',
read_permission: 'Read Permission',
all_permission: 'All Permission',
all_permission: 'All Permission'
},
workflow: {
on_line: 'Online',
Expand Down Expand Up @@ -215,7 +215,7 @@ export default {
workflow_relation_no_data_result_desc:
'There is not any workflows. Please create a workflow, and then visit this page again.',
ready_to_block: 'Ready to block',
block: 'Block',
block: 'Block'
},
task: {
on_line: 'Online',
Expand Down Expand Up @@ -329,7 +329,7 @@ export default {
online: 'Online'
},
node: {
is_cache: "Cache Execution",
is_cache: 'Cache Execution',
jvm_args: 'Java VM Parameters',
jvm_args_tips: 'Please enter virtual machine parameters',
run_type: 'Run Type',
Expand Down Expand Up @@ -377,7 +377,8 @@ export default {
image: 'Image',
image_tips: 'Please enter image',
command: 'Command',
command_tips: 'Please enter the container execution command, for example: /bin/echo hello world',
command_tips:
'Please enter the container execution command, for example: /bin/echo hello world',
min_memory_tips: 'Please enter min memory',
state: 'State',
branch_flow: 'Branch flow',
Expand Down Expand Up @@ -798,7 +799,10 @@ export default {
pytorch_requirements: 'Requirement File',
pytorch_conda_python_version: 'Python Version',
pytorch_conda_python_version_tips:
'Please enter the version number, such as 3.6, 3.7, 3.x'
'Please enter the version number, such as 3.6, 3.7, 3.x',
factory_name: 'Factory Name',
resource_group_name: 'Resource Group Name',
pipeline_name: 'Pipeline Name'
},
menu: {
fav: 'Favorites',
Expand All @@ -808,6 +812,6 @@ export default {
di: 'Data Integration',
dq: 'Data Quality',
ml: 'Machine Learning',
other: 'Other',
other: 'Other'
}
}
5 changes: 4 additions & 1 deletion dolphinscheduler-ui/src/locales/zh_CN/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -777,7 +777,10 @@ export default {
pytorch_python_env_tool: 'python环境管理工具',
pytorch_requirements: '依赖文件',
pytorch_conda_python_version: 'python版本',
pytorch_conda_python_version_tips: '请输入版本号,如 3.6, 3.7, 3.x等'
pytorch_conda_python_version_tips: '请输入版本号,如 3.6, 3.7, 3.x等',
factory_name: '工厂名称',
resource_group_name: '资源组名称',
pipeline_name: 'pipeline名称'
},
menu: {
fav: '收藏组件',
Expand Down
41 changes: 41 additions & 0 deletions dolphinscheduler-ui/src/service/modules/azure/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import { axios } from '@/service/service'
import { DataFactoryReq } from './types'

export function queryDataFactoryFactories(): any {
return axios({
url: '/cloud/azure/datafactory/factories',
method: 'get'
})
}

export function queryDataFactoryResourceGroups(): any {
return axios({
url: '/cloud/azure/datafactory/resourceGroups',
method: 'get'
})
}

export function queryDataFactoryPipelines(params: DataFactoryReq): any {
return axios({
url: '/cloud/azure/datafactory/pipelines',
method: 'get',
params
})
}
23 changes: 23 additions & 0 deletions dolphinscheduler-ui/src/service/modules/azure/types.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

interface DataFactoryReq {
factoryName: string
resourceGroupName: string
}

export { DataFactoryReq }
4 changes: 4 additions & 0 deletions dolphinscheduler-ui/src/store/project/task-type.ts
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ export const TASK_TYPES_MAP = {
LINKIS: {
alias: 'LINKIS',
helperLinkDisable: true
},
DATA_FACTORY: {
alias: 'DATA_FACTORY',
helperLinkDisable: true
}
} as {
[key in TaskType]: {
Expand Down
1 change: 1 addition & 0 deletions dolphinscheduler-ui/src/store/project/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@ type TaskType =
| 'DATASYNC'
| 'KUBEFLOW'
| 'LINKIS'
| 'DATA_FACTORY'

type ProgramType = 'JAVA' | 'SCALA' | 'PYTHON'

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,3 +85,4 @@ export { useDms } from './use-dms'
export { useDatasync } from './use-datasync'
export { useKubeflow } from './use-kubeflow'
export { useLinkis } from './use-linkis'
export { useDataFactory } from './use-data-factory'
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
* this work for additional information regarding copyright ownership.
* The ASF licenses this file to You under the Apache License, Version 2.0
* (the "License"); you may not use this file except in compliance with
* the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {
queryDataFactoryFactories,
queryDataFactoryPipelines,
queryDataFactoryResourceGroups
} from '@/service/modules/azure'
import { onMounted, ref, watch } from 'vue'
import { useI18n } from 'vue-i18n'
import { useCustomParams } from '.'
import type { IJsonItem } from '../types'

export function useDataFactory(model: { [field: string]: any }): IJsonItem[] {
const { t } = useI18n()

const factoryOptions = ref([] as { label: string; value: number }[])
const resourceGroupOptions = ref([] as { label: string; value: number }[])
const pipelineOptions = ref([] as { label: string; value: number }[])

const getFactoryOptions = async () => {
const factories = await queryDataFactoryFactories()
factoryOptions.value = factories.map((factory: string) => ({
label: factory,
value: factory
}))
}

const getResourceGroupName = async () => {
const groupNames = await queryDataFactoryResourceGroups()
resourceGroupOptions.value = groupNames.map((groupName: string) => ({
label: groupName,
value: groupName
}))
}

const getPipelineName = async (
factoryName: string,
resourceGroupName: string
) => {
const pipelineNames = await queryDataFactoryPipelines({
factoryName,
resourceGroupName
})
pipelineOptions.value = pipelineNames.map((pipelineName: string) => ({
label: pipelineName,
value: pipelineName
}))
}

const onChange = () => {
model['pipelineName'] = ''
if (model['factoryName'] && model['resourceGroupName']) {
getPipelineName(model['factoryName'], model['resourceGroupName'])
}
}

watch(
() => model['pipelineName'],
() => {
if (model['pipelineName'] && pipelineOptions.value.length === 0) {
getPipelineName(model['factoryName'], model['resourceGroupName'])
}
}
)

onMounted(() => {
getFactoryOptions()
getResourceGroupName()
})

return [
{
type: 'select',
field: 'factoryName',
span: 24,
name: t('project.node.factory_name'),
options: factoryOptions,
props: {
'on-update:value': onChange
},
validate: {
required: true
}
},
{
type: 'select',
field: 'resourceGroupName',
span: 24,
name: t('project.node.resource_group_name'),
options: resourceGroupOptions,
props: {
'on-update:value': onChange
},
validate: {
required: true
}
},
{
type: 'select',
field: 'pipelineName',
span: 24,
name: t('project.node.pipeline_name'),
options: pipelineOptions,
validate: {
required: true
}
},
...useCustomParams({
model,
field: 'localParams',
isSimple: true
})
]
}
Original file line number Diff line number Diff line change
Expand Up @@ -449,13 +449,19 @@ export function formatParams(data: INodeData): {
taskParams.yamlContent = data.yamlContent
taskParams.namespace = data.namespace
}

if (data.taskType === 'LINKIS') {
taskParams.useCustom = data.useCustom
taskParams.paramScript = data.paramScript
taskParams.rawScript = data.rawScript
}

if (data.taskType === 'DATA_FACTORY') {
taskParams.factoryName = data.factoryName
taskParams.resourceGroupName = data.resourceGroupName
taskParams.pipelineName = data.pipelineName
}

let timeoutNotifyStrategy = ''
if (data.timeoutNotifyStrategy) {
if (data.timeoutNotifyStrategy.length === 1) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ import { useDms } from './use-dms'
import { useDatasync } from './use-datasync'
import { useKubeflow } from './use-kubeflow'
import { useLinkis } from './use-linkis'
import { useDataFactory } from './use-data-factory'

export default {
SHELL: useShell,
Expand Down Expand Up @@ -86,5 +87,6 @@ export default {
DMS: useDms,
DATASYNC: useDatasync,
KUBEFLOW: useKubeflow,
LINKIS: useLinkis
LINKIS: useLinkis,
DATA_FACTORY: useDataFactory
}
Loading