diff --git a/escheduler-common/src/main/java/cn/escheduler/common/Constants.java b/escheduler-common/src/main/java/cn/escheduler/common/Constants.java index 7eaa6b792617..8522992f9f1d 100644 --- a/escheduler-common/src/main/java/cn/escheduler/common/Constants.java +++ b/escheduler-common/src/main/java/cn/escheduler/common/Constants.java @@ -696,6 +696,10 @@ public final class Constants { */ public static final String SPARK_QUEUE = "--queue"; + /** + * --queue --qu + */ + public static final String FLINK_QUEUE = "--qu"; /** * exit code success diff --git a/escheduler-server/src/main/java/cn/escheduler/server/utils/FlinkArgsUtils.java b/escheduler-server/src/main/java/cn/escheduler/server/utils/FlinkArgsUtils.java index 308103073d4e..891110310fac 100644 --- a/escheduler-server/src/main/java/cn/escheduler/server/utils/FlinkArgsUtils.java +++ b/escheduler-server/src/main/java/cn/escheduler/server/utils/FlinkArgsUtils.java @@ -21,6 +21,7 @@ import cn.escheduler.common.enums.ProgramType; import cn.escheduler.common.task.flink.FlinkParameters; import org.apache.commons.lang.StringUtils; +import org.slf4j.LoggerFactory; import java.util.ArrayList; import java.util.List; @@ -36,39 +37,49 @@ public class FlinkArgsUtils { * @param param * @return */ + private static final org.slf4j.Logger logger = LoggerFactory.getLogger(FlinkArgsUtils.class); public static List buildArgs(FlinkParameters param) { List args = new ArrayList<>(); + String deployMode = "cluster"; + if(StringUtils.isNotEmpty(param.getDeployMode())){ + deployMode = param.getDeployMode(); - args.add(Constants.FLINK_RUN_MODE); //-m + } + if(!"local".equals(deployMode)){ + args.add(Constants.FLINK_RUN_MODE); //-m - args.add(Constants.FLINK_YARN_CLUSTER); //yarn-cluster + args.add(Constants.FLINK_YARN_CLUSTER); //yarn-cluster - if (param.getSlot() != 0) { - args.add(Constants.FLINK_YARN_SLOT); - args.add(String.format("%d", param.getSlot())); //-ys - } - if (StringUtils.isNotEmpty(param.getAppName())) { //-ynm - args.add(Constants.FLINK_APP_NAME); - args.add(param.getAppName()); - } + if (param.getSlot() != 0) { + args.add(Constants.FLINK_YARN_SLOT); + args.add(String.format("%d", param.getSlot())); //-ys + } - if (param.getTaskManager() != 0) { //-yn - args.add(Constants.FLINK_TASK_MANAGE); - args.add(String.format("%d", param.getTaskManager())); - } + if (StringUtils.isNotEmpty(param.getAppName())) { //-ynm + args.add(Constants.FLINK_APP_NAME); + args.add(param.getAppName()); + } - if (StringUtils.isNotEmpty(param.getJobManagerMemory())) { - args.add(Constants.FLINK_JOB_MANAGE_MEM); - args.add(param.getJobManagerMemory()); //-yjm - } + if (param.getTaskManager() != 0) { //-yn + args.add(Constants.FLINK_TASK_MANAGE); + args.add(String.format("%d", param.getTaskManager())); + } - if (StringUtils.isNotEmpty(param.getTaskManagerMemory())) { // -ytm - args.add(Constants.FLINK_TASK_MANAGE_MEM); - args.add(param.getTaskManagerMemory()); - } - args.add(Constants.FLINK_detach); //-d + if (StringUtils.isNotEmpty(param.getJobManagerMemory())) { + args.add(Constants.FLINK_JOB_MANAGE_MEM); + args.add(param.getJobManagerMemory()); //-yjm + } + if (StringUtils.isNotEmpty(param.getTaskManagerMemory())) { // -ytm + args.add(Constants.FLINK_TASK_MANAGE_MEM); + args.add(param.getTaskManagerMemory()); + } + + args.add(Constants.FLINK_detach); //-d + + + } if(param.getProgramType() !=null ){ if(param.getProgramType()!=ProgramType.PYTHON){ @@ -83,28 +94,29 @@ public static List buildArgs(FlinkParameters param) { args.add(param.getMainJar().getRes()); } + if (StringUtils.isNotEmpty(param.getMainArgs())) { + args.add(param.getMainArgs()); + } // --files --conf --libjar ... - if (StringUtils.isNotEmpty(param.getOthers())) { + if (StringUtils.isNotEmpty(param.getOthers())) { String others = param.getOthers(); - if(!others.contains("--queue")){ - if (StringUtils.isNotEmpty(param.getQueue())) { - args.add(Constants.SPARK_QUEUE); + if(!others.contains("--qu")){ + if (StringUtils.isNotEmpty(param.getQueue()) && !deployMode.equals("local")) { + args.add(Constants.FLINK_QUEUE); args.add(param.getQueue()); } } args.add(param.getOthers()); - }else if (StringUtils.isNotEmpty(param.getQueue())) { - args.add(Constants.SPARK_QUEUE); + }else if (StringUtils.isNotEmpty(param.getQueue()) && !deployMode.equals("local")) { + args.add(Constants.FLINK_QUEUE); args.add(param.getQueue()); } - if (StringUtils.isNotEmpty(param.getMainArgs())) { - args.add(param.getMainArgs()); - } return args; } -} + +} \ No newline at end of file diff --git a/escheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss b/escheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss index 37d3acaa191f..373c2c581986 100644 --- a/escheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss +++ b/escheduler-ui/src/js/conf/home/pages/dag/_source/dag.scss @@ -71,7 +71,7 @@ background: url("../img/toolbar_SPARK.png") no-repeat 50% 50%; } .icos-FLINK { - background: url("../img/toobar_flink.svg") no-repeat 50% 50%; + background: url("../img/toobar_FLINK.png") no-repeat 50% 50%; } .icos-MR { background: url("../img/toolbar_MR.png") no-repeat 50% 50%; diff --git a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue index 1c3b18a64c33..497987b97d81 100644 --- a/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue +++ b/escheduler-ui/src/js/conf/home/pages/dag/_source/formModel/tasks/flink.vue @@ -52,6 +52,7 @@
+
diff --git a/escheduler-ui/src/js/conf/home/pages/dag/img/toobar_FLINK.png b/escheduler-ui/src/js/conf/home/pages/dag/img/toobar_FLINK.png new file mode 100644 index 000000000000..3aab0231fa9a Binary files /dev/null and b/escheduler-ui/src/js/conf/home/pages/dag/img/toobar_FLINK.png differ diff --git a/escheduler-ui/src/js/conf/home/pages/dag/img/toobar_flink.svg b/escheduler-ui/src/js/conf/home/pages/dag/img/toobar_flink.svg deleted file mode 100644 index 33ba8b7b3d5f..000000000000 --- a/escheduler-ui/src/js/conf/home/pages/dag/img/toobar_flink.svg +++ /dev/null @@ -1,211 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -