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

[Fix] Fix pyflink yarn remote mode bug #3339

Merged
merged 23 commits into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
a646af1
[Improve] Console core module code optimization
ChengJie1053 Sep 27, 2023
9ffcfc8
Merge branch 'apache:dev' into dev
ChengJie1053 Sep 27, 2023
87202b8
Revert "[Improve] Console core module code optimization"
ChengJie1053 Sep 28, 2023
814da8e
Merge branch 'apache:dev' into dev
ChengJie1053 Sep 28, 2023
81f8693
Merge remote-tracking branch 'origin/dev' into dev
ChengJie1053 Sep 28, 2023
92bdbbb
Merge branch 'apache:dev' into dev
ChengJie1053 Sep 28, 2023
1e323cc
Merge branch 'apache:dev' into dev
ChengJie1053 Oct 6, 2023
4172a4f
Merge branch 'apache:dev' into dev
ChengJie1053 Oct 6, 2023
c42946d
Merge branch 'apache:dev' into dev
ChengJie1053 Oct 13, 2023
58682b6
Merge branch 'apache:dev' into dev
ChengJie1053 Oct 16, 2023
beb0c15
Merge branch 'apache:dev' into dev
ChengJie1053 Oct 23, 2023
eaa2241
Merge branch 'apache:dev' into dev
ChengJie1053 Oct 24, 2023
f865fa2
Merge branch 'apache:dev' into dev
ChengJie1053 Oct 24, 2023
e69549b
Merge branch 'apache:dev' into dev
ChengJie1053 Nov 2, 2023
8766787
Merge branch 'apache:dev' into dev
ChengJie1053 Nov 2, 2023
5e7f36b
Merge branch 'apache:dev' into dev
ChengJie1053 Nov 4, 2023
f227f77
Merge branch 'apache:dev' into dev
ChengJie1053 Nov 6, 2023
34c510e
Merge branch 'apache:dev' into dev
ChengJie1053 Nov 7, 2023
7dc08e1
Merge branch 'apache:dev' into dev
ChengJie1053 Nov 10, 2023
487945a
Merge branch 'apache:dev' into dev
ChengJie1053 Nov 12, 2023
4a3dd8f
Merge branch 'apache:dev' into dev
ChengJie1053 Nov 13, 2023
1ced87e
[Fix] Fix pyflink yarn remote mode bug
ChengJie1053 Nov 13, 2023
e905c7c
[Fix] Fix pyflink yarn remote mode bug
ChengJie1053 Nov 13, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -70,12 +70,13 @@ case class SubmitRequest(
lazy val effectiveAppName: String =
if (this.appName == null) appProperties(KEY_FLINK_APP_NAME) else this.appName

lazy val classPaths: List[URL] = {
lazy val libs: List[URL] = {
val path = s"${Workspace.local.APP_WORKSPACE}/$id/lib"
val lib = Try(new File(path).listFiles().map(_.toURI.toURL).toList).getOrElse(List.empty[URL])
flinkVersion.flinkLibs ++ lib
Try(new File(path).listFiles().map(_.toURI.toURL).toList).getOrElse(List.empty[URL])
}

lazy val classPaths: List[URL] = flinkVersion.flinkLibs ++ libs

lazy val flinkSQL: String = extraParameter.get(KEY_FLINK_SQL()).toString

lazy val allowNonRestoredState: Boolean = Try(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@ import org.apache.flink.runtime.jobgraph.{JobGraph, SavepointConfigOptions}
import org.apache.flink.util.FlinkException
import org.apache.flink.util.Preconditions.checkNotNull

import java.io.File
import java.net.URL
import java.util
import java.util.{Collections, List => JavaList, Map => JavaMap}

import scala.collection.convert.ImplicitConversions._
Expand Down Expand Up @@ -257,7 +254,6 @@ trait FlinkClientTrait extends Logger {
flinkConfig: Configuration): (PackagedProgram, JobGraph) = {

val pkgBuilder = PackagedProgram.newBuilder
.setUserClassPaths(Lists.newArrayList(submitRequest.classPaths: _*))
.setEntryPointClassName(
flinkConfig.getOptional(ApplicationConfiguration.APPLICATION_MAIN_CLASS).get()
)
Expand All @@ -281,8 +277,13 @@ trait FlinkClientTrait extends Logger {
.safeSet(PythonOptions.PYTHON_CLIENT_EXECUTABLE, Constant.PYTHON_EXECUTABLE)
// python.executable
.safeSet(PythonOptions.PYTHON_EXECUTABLE, Constant.PYTHON_EXECUTABLE)
if (submitRequest.libs.nonEmpty) {
pkgBuilder.setUserClassPaths(submitRequest.libs)
}
case _ =>
pkgBuilder.setJarFile(submitRequest.userJarFile)
pkgBuilder
.setUserClassPaths(submitRequest.classPaths)
.setJarFile(submitRequest.userJarFile)
}

val packageProgram = pkgBuilder.build()
Expand Down
Loading