diff --git a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnApplicationGateway.java b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnApplicationGateway.java index aae4b6092c..2193be4ca9 100644 --- a/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnApplicationGateway.java +++ b/dinky-gateway/src/main/java/org/dinky/gateway/yarn/YarnApplicationGateway.java @@ -28,6 +28,7 @@ import org.dinky.gateway.result.GatewayResult; import org.dinky.gateway.result.YarnResult; import org.dinky.utils.LogUtil; +import org.dinky.utils.URLUtils; import org.apache.flink.client.deployment.ClusterSpecification; import org.apache.flink.client.deployment.application.ApplicationConfiguration; @@ -42,6 +43,8 @@ import java.util.Collections; import java.util.stream.Collectors; +import cn.hutool.core.util.URLUtil; + /** * YarnApplicationGateway * @@ -54,6 +57,20 @@ public GatewayType getType() { return GatewayType.YARN_APPLICATION; } + /** + * format url + *
if url is rs protocol, convert to file path
+ * @param url url + * @return formatted url + */ + private String formatUrl(String url) { + if (URLUtil.url(url).getProtocol().equals("rs")) { + return URLUtils.toFile(url).getAbsolutePath(); + } else { + return url; + } + } + @Override public GatewayResult submitJar(FlinkUdfPathContextHolder udfPathContextHolder) { if (Asserts.isNull(yarnClient)) { @@ -61,7 +78,7 @@ public GatewayResult submitJar(FlinkUdfPathContextHolder udfPathContextHolder) { } AppConfig appConfig = config.getAppConfig(); - configuration.set(PipelineOptions.JARS, Collections.singletonList(appConfig.getUserJarPath())); + configuration.set(PipelineOptions.JARS, Collections.singletonList(formatUrl(appConfig.getUserJarPath()))); configuration.setString( "python.files", udfPathContextHolder.getPyUdfFile().stream().map(File::getName).collect(Collectors.joining(","))); diff --git a/dinky-web/src/locales/en-US/pages.ts b/dinky-web/src/locales/en-US/pages.ts index f3db9970e6..fbd9956fc2 100644 --- a/dinky-web/src/locales/en-US/pages.ts +++ b/dinky-web/src/locales/en-US/pages.ts @@ -785,8 +785,10 @@ export default { 'rc.cc.sqlSubmitJarPath': 'Jar File Path', 'rc.cc.sqlSubmitJarPathHelp': 'Please enter the Jar file path! eg: hdfs:///dinky/dinky-app-1.16-with-dependencies.jar', + 'rc.cc.sqlSubmitJarPathHelpTips': + 'In Yarn mode, this parameter can be set to: hdfs:///dinky/dinky-app-1.17-with-dependencies.jar Alternatively, if rs:/dinky/inky app 1.17 with dependencies. jar is set to the rs:/ protocol, the jar package needs to be uploaded to Dinky`s resource center and the path filled in. In K8s mode, only the local://protocol is supported', 'rc.cc.start': 'Start Session Cluster', - 'rc.cc.submitSqlConfig': 'Submit FlinkSQL Config items (required in Application mode)', + 'rc.cc.submitSqlConfig': 'Submit FlinkSQL Config items', 'rc.cc.tmHeap': 'TaskManager Heap Memory', 'rc.cc.tmHeapHelp': 'Please enter the TaskManager heap memory size! This parameter configuration item is', diff --git a/dinky-web/src/locales/zh-CN/pages.ts b/dinky-web/src/locales/zh-CN/pages.ts index 631004e3e0..35bfcf9b32 100644 --- a/dinky-web/src/locales/zh-CN/pages.ts +++ b/dinky-web/src/locales/zh-CN/pages.ts @@ -752,8 +752,10 @@ export default { 'rc.cc.sqlSubmitJarPath': 'Jar 文件路径', 'rc.cc.sqlSubmitJarPathHelp': '请输入 Jar 文件路径! eg: hdfs:///dinky/dinky-app-1.16-with-dependencies.jar', + 'rc.cc.sqlSubmitJarPathHelpTips': + 'Yarn 模式下此参数可以设置为: hdfs:///dinky/dinky-app-1.17-with-dependencies.jar 或者 rs:/dinky/dinky-app-1.17-with-dependencies.jar 如果设置为 rs:/ 协议,则需要将该jar包上传到 Dinky 的资源中心中,然后填写该路径。K8s 模式下仅支持 local:// 协议', 'rc.cc.start': '启动 Session 集群', - 'rc.cc.submitSqlConfig': '提交 FlinkSQL 配置项 (Application 模式必填)', + 'rc.cc.submitSqlConfig': '提交 FlinkSQL 配置项', 'rc.cc.tmHeap': 'TaskManager 堆内存', 'rc.cc.tmHeapHelp': '请输入 TaskManager 堆内存大小! 此参数配置项为', 'rc.cc.tmMem': 'TaskManager 内存', diff --git a/dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/ApplicationConfig/index.tsx b/dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/ApplicationConfig/index.tsx index fa18362ed7..ae9bdfa7c0 100644 --- a/dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/ApplicationConfig/index.tsx +++ b/dinky-web/src/pages/RegCenter/Cluster/Configuration/components/ConfigurationModal/ConfigurationForm/ApplicationConfig/index.tsx @@ -28,10 +28,16 @@ const ApplicationConfig = () => {