Browse Source

Merge pull request #21 from apache/dev

update code from apache
pull/3/MERGE
BoYiZhang 4 years ago committed by GitHub
parent
commit
5f817f2acd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      docker/build/Dockerfile
  2. 4
      docker/build/startup.sh
  3. 2
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java
  4. 16
      dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java
  5. 15
      dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.java
  6. 7
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml
  7. 3
      dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml
  8. 9
      dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue
  9. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js
  10. 1
      dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

2
docker/build/Dockerfile

@ -42,7 +42,7 @@ ADD ./apache-dolphinscheduler-incubating-${VERSION}-dolphinscheduler-bin.tar.gz
RUN mv /opt/apache-dolphinscheduler-incubating-${VERSION}-dolphinscheduler-bin/ /opt/dolphinscheduler/
ENV DOLPHINSCHEDULER_HOME /opt/dolphinscheduler
#4. install database, if use mysql as your backend database, the `mysql-client` package should be installed
#4. install database, if use mysql as your backend database, you should append `mysql-client` at the end of the sentence
RUN apk add --update --no-cache postgresql postgresql-contrib
#5. modify nginx

4
docker/build/startup.sh

@ -38,13 +38,13 @@ initDatabase() {
echo "connect ${DATABASE_TYPE} service"
if [ ${DATABASE_TYPE} = "mysql" ]; then
v=$(mysql -h${DATABASE_HOST} -P${DATABASE_PORT} -u${DATABASE_USERNAME} --password=${DATABASE_PASSWORD} -D ${DATABASE_DATABASE} -e "select 1" 2>&1)
if [ "$(echo '${v}' | grep 'ERROR' | wc -l)" -eq 1 ]; then
if [ "$(echo ${v} | grep 'ERROR' | wc -l)" -eq 1 ]; then
echo "Error: Can't connect to database...${v}"
exit 1
fi
else
v=$(sudo -u postgres PGPASSWORD=${DATABASE_PASSWORD} psql -h ${DATABASE_HOST} -p ${DATABASE_PORT} -U ${DATABASE_USERNAME} -d ${DATABASE_DATABASE} -tAc "select 1")
if [ "$(echo '${v}' | grep 'FATAL' | wc -l)" -eq 1 ]; then
if [ "$(echo ${v} | grep 'FATAL' | wc -l)" -eq 1 ]; then
echo "Error: Can't connect to database...${v}"
exit 1
fi

2
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/enums/Status.java

@ -133,7 +133,7 @@ public enum Status {
QUERY_TASK_INSTANCE_LOG_ERROR(10103, "view task instance log error", "查询任务实例日志错误"),
DOWNLOAD_TASK_INSTANCE_LOG_FILE_ERROR(10104, "download task instance log file error", "下载任务日志文件错误"),
CREATE_PROCESS_DEFINITION(10105, "create process definition", "创建工作流错误"),
VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR(10106, "verify process definition name unique error", "工作流名称已存在"),
VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR(10106, "verify process definition name unique error", "工作流定义名称已存在"),
UPDATE_PROCESS_DEFINITION_ERROR(10107, "update process definition error", "更新工作流定义错误"),
RELEASE_PROCESS_DEFINITION_ERROR(10108, "release process definition error", "上线工作流错误"),
QUERY_DATAIL_OF_PROCESS_DEFINITION_ERROR(10109, "query datail of process definition error", "查询工作流详细信息错误"),

16
dolphinscheduler-api/src/main/java/org/apache/dolphinscheduler/api/service/impl/ProcessDefinitionServiceImpl.java

@ -366,16 +366,24 @@ public class ProcessDefinitionServiceImpl extends BaseService implements
return checkProcessJson;
}
ProcessDefinition processDefine = processService.findProcessDefineById(id);
// check process definition exists
if (processDefine == null) {
// check process definition exists
putMsg(result, Status.PROCESS_DEFINE_NOT_EXIST, id);
return result;
} else if (processDefine.getReleaseState() == ReleaseState.ONLINE) {
}
if (processDefine.getReleaseState() == ReleaseState.ONLINE) {
// online can not permit edit
putMsg(result, Status.PROCESS_DEFINE_NOT_ALLOWED_EDIT, processDefine.getName());
return result;
} else {
putMsg(result, Status.SUCCESS);
}
if (!name.equals(processDefine.getName())) {
// check whether the new process define name exist
ProcessDefinition definition = processDefineMapper.verifyByDefineName(project.getId(), name);
if (definition != null) {
putMsg(result, Status.VERIFY_PROCESS_DEFINITION_NAME_UNIQUE_ERROR, name);
return result;
}
}
Date now = new Date();

15
dolphinscheduler-dao/src/main/java/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.java

@ -69,19 +69,6 @@ public interface ProcessInstanceMapper extends BaseMapper<ProcessInstance> {
List<ProcessInstance> queryByWorkerGroupIdAndStatus(@Param("workerGroupId") int workerGroupId,
@Param("states") int[] states);
/**
* process instance page
* @param page page
* @param projectId projectId
* @param processDefinitionId processDefinitionId
* @param searchVal searchVal
* @param statusArray statusArray
* @param host host
* @param startTime startTime
* @param endTime endTime
* @return process instance IPage
*/
/**
* process instance page
* @param page page
@ -93,7 +80,7 @@ public interface ProcessInstanceMapper extends BaseMapper<ProcessInstance> {
* @param host host
* @param startTime startTime
* @param endTime endTime
* @return process instance page
* @return process instance IPage
*/
IPage<ProcessInstance> queryProcessInstanceListPaging(Page<ProcessInstance> page,
@Param("projectId") int projectId,

7
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/ProcessInstanceMapper.xml

@ -76,7 +76,10 @@
</select>
<select id="queryProcessInstanceListPaging" resultType="org.apache.dolphinscheduler.dao.entity.ProcessInstance">
select instance.*
select instance.id,instance.name,instance.process_definition_id,instance.state,instance.recovery,instance.start_time,instance.end_time,instance.run_times,instance.host,instance.command_type,instance.command_param,
instance.task_depend_type,instance.max_try_times,instance.failure_strategy,instance.warning_type,instance.warning_group_id,instance.schedule_time,instance.command_start_time,instance.global_params,instance.flag,
instance.update_time,instance.is_sub_process,instance.executor_id,instance.locations,instance.connects,instance.history_cmd,instance.dependence_schedule_times,instance.process_instance_priority,instance.worker_group,
instance.timeout,instance.tenant_id
from t_ds_process_instance instance
join t_ds_process_definition define ON instance.process_definition_id = define.id
where 1=1
@ -202,4 +205,4 @@
order by id asc
</select>
</mapper>
</mapper>

3
dolphinscheduler-dao/src/main/resources/org/apache/dolphinscheduler/dao/mapper/TaskInstanceMapper.xml

@ -98,7 +98,8 @@
</if>
</select>
<select id="queryTaskInstanceListPaging" resultType="org.apache.dolphinscheduler.dao.entity.TaskInstance">
select instance.*,process.name as process_instance_name
select instance.id,instance.name,instance.task_type,instance.process_definition_id,instance.process_instance_id,instance.state,instance.submit_time,instance.start_time,instance.end_time,
instance.host,instance.execute_path,instance.log_path,instance.alert_flag,instance.retry_times,instance.pid,instance.app_link,instance.flag,instance.retry_interval,instance.max_retry_times,instance.task_instance_priority,instance.worker_group,instance.executor_id,process.name as process_instance_name
from t_ds_task_instance instance
join t_ds_process_definition define ON instance.process_definition_id = define.id
join t_ds_process_instance process on process.id=instance.process_instance_id

9
dolphinscheduler-ui/src/js/conf/home/pages/security/pages/tenement/_source/createTenement.vue

@ -146,6 +146,13 @@
this.$message.warning(`${i18n.$t('Please enter name')}`)
return false
}
// Verify tenant name cannot contain special characters
let isSpecial = /[~#^$@%&!*()<>《》:;'"{}【】 ]/gi
if (isSpecial.test(this.tenantName)) {
this.$message.warning(`${i18n.$t('Please enter tenant name without special characters')}`)
return false
}
return true
},
_submit () {
@ -192,4 +199,4 @@
},
components: { mPopup, mListBoxF }
}
</script>
</script>

1
dolphinscheduler-ui/src/js/module/i18n/locale/en_US.js

@ -187,6 +187,7 @@ export default {
'Please select a queue': 'default is tenant association queue',
'Please enter the tenant code in English': 'Please enter the tenant code in English',
'Please enter tenant code in English': 'Please enter tenant code in English',
'Please enter tenant name without special characters': 'Please enter tenant name without special characters',
'Edit User': 'Edit User',
Tenant: 'Tenant',
Email: 'Email',

1
dolphinscheduler-ui/src/js/module/i18n/locale/zh_CN.js

@ -189,6 +189,7 @@ export default {
Queue: 'Yarn 队列',
'Please enter the tenant code in English': '请输入租户编码只允许英文',
'Please enter tenant code in English': '请输入英文租户编码',
'Please enter tenant name without special characters': '请输入不包含特殊字符的租户名称',
'Edit User': '编辑用户',
Tenant: '租户',
Email: '邮件',

Loading…
Cancel
Save