Building Flink ML from Source
This documentation is for an unreleased version of Apache Flink Machine Learning Library. We recommend you use the latest stable version.

Building Flink ML from Source #

This page covers how to build Flink ML from sources.

In order to build Flink ML you need the source code. Either download the source of a release or clone the git repository.

In addition, you need Maven 3 and a JDK (Java Development Kit). Flink ML requires at least Java 8 to build.

To clone from git, enter:

git clone https://github.com/apache/flink-ml.git

The simplest way of building Flink ML is by running:

mvn clean install -DskipTests

This instructs Maven (mvn) to first remove all existing builds (clean) and then create a new Flink binary (install).

After the build finishes, you can acquire the build result in the following path from the root directory of Flink ML:

./flink-ml-dist/target/flink-ml-*-bin/flink-ml*/

Prerequisites #

  1. Building Flink ML Java SDK

    If you want to build Flink ML’s Python SDK that can be used for pip installation, you must first build the Java SDK, as described in the section above.

  2. Python version(3.6, 3.7, or 3.8) is required

    $ python --version
    # the version printed here must be 3.6, 3.7 or 3.8
    
  3. Install the dependencies with the following command:

    $ python -m pip install -r flink-ml-python/dev/dev-requirements.txt
    

Installation #

Then go to the root directory of Flink ML source code and run this command to build the sdist package of apache-flink-ml:

cd flink-ml-python; python setup.py sdist; cd ..;

The sdist package of apache-flink-ml will be found under ./flink-ml-python/dist/. It could be installed as follows:

python -m pip install flink-ml-python/dist/*.tar.gz