tillrohrmann commented on a change in pull request #8609:
[FLINK-12541][container][python] Add support for Python jobs in build script
URL: https://github.com/apache/flink/pull/8609#discussion_r290737083
##########
File path:
flink-container/src/main/java/org/apache/flink/container/entrypoint/ClassPathJobGraphRetriever.java
##########
@@ -110,19 +117,38 @@ public JobGraph retrieveJobGraph(Configuration
configuration) throws FlinkExcept
}
}
- private PackagedProgram createPackagedProgram() throws FlinkException {
- final String entryClass = getJobClassNameOrScanClassPath();
+ private PackagedProgram createPackagedProgram(final String entryClass,
final boolean isPythonProgram) throws FlinkException {
try {
final Class<?> mainClass =
getClass().getClassLoader().loadClass(entryClass);
- return new PackagedProgram(mainClass, programArguments);
- } catch (ClassNotFoundException | ProgramInvocationException e)
{
+ return new PackagedProgram(mainClass,
getProgramArguments(isPythonProgram));
+ } catch (ProgramInvocationException e) {
throw new FlinkException("Could not load the provided
entrypoint class.", e);
+ } catch (ClassNotFoundException e) {
+ if (!isPythonProgram && jobPythonArtifacts != null) {
+ return
createPackagedProgram("org.apache.flink.python.client.PythonDriver", true);
Review comment:
This is overly complicated and error prone. Why not starting the cluster
entrypoint with `o.a.f.python.client.PythonDriver` as `jobClassName`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services