0
votes

When packaging a flink job which uses for example some flink connectors and some third-party libraries (for processing), which dependencies should end up in the jobs jar so it can be launched in a flink-cluster using ("flink run [jarfile]")?

Is making a fat-jar the desired approach?

If writing a job in scala, do you include the scala default library in the jar?

I didn't find any documentation on how to package a job for flink once it is written.

1

1 Answers

1
votes

Yes, a fat-jar is the standard way to package a Flink job. Everything that is contained in the Flink distribution must not be included (ie, Java and Scale default libraries, Flink core, ...). Only some Flink libraries that are not contained (plus user defined external dependencies) must be included in the fat-jar.

You can follow this guideline from the Flink documenation: https://ci.apache.org/projects/flink/flink-docs-release-1.0/apis/cluster_execution.html#linking-with-modules-not-contained-in-the-binary-distribution

This might also be helpful: https://ci.apache.org/projects/flink/flink-docs-release-1.0/apis/common/index.html#program-packaging-and-distributed-execution