XComp commented on a change in pull request #14367: URL: https://github.com/apache/flink/pull/14367#discussion_r542179801
########## File path: docs/deployment/cli.md ########## @@ -338,4 +338,74 @@ specified in the `config/flink-config.yaml`. For more details on the commands and the available options, please refer to the Resource Provider-specific pages of the documentation. +### Submitting PyFlink Jobs + +Currently, users are able to submit a PyFlink job via the CLI. It does not require to specify the +JAR file path or the entry main class, which is different from the Java job submission. + +<span class="label label-info">Note</span> When submitting Python job via `flink run`, Flink will run the command "python". Please run the following command to confirm that the python executable in current environment points to a supported Python version of 3.5+. +{% highlight bash %} +$ python --version +# the version printed here must be 3.5+ +{% endhighlight %} + +The following commands show different PyFlink job submission use-cases: + +- Run a PyFlink job: +{% highlight bash %} +$ ./bin/flink run --python examples/python/table/batch/word_count.py +{% endhighlight %} + +- Run a PyFlink job with pyFiles: +{% highlight bash %} +$ ./bin/flink run \ + --python examples/python/table/batch/word_count.py \ + --pyFiles file:///user.txt,hdfs:///$namenode_address/username.txt +{% endhighlight %} + +- Run a PyFlink job with a JAR file: Review comment: Can you come up with reasons here why the user might want to provide a JAR file for his/her PyFlink job? ########## File path: docs/deployment/cli.md ########## @@ -338,4 +338,74 @@ specified in the `config/flink-config.yaml`. For more details on the commands and the available options, please refer to the Resource Provider-specific pages of the documentation. +### Submitting PyFlink Jobs + +Currently, users are able to submit a PyFlink job via the CLI. It does not require to specify the +JAR file path or the entry main class, which is different from the Java job submission. + +<span class="label label-info">Note</span> When submitting Python job via `flink run`, Flink will run the command "python". Please run the following command to confirm that the python executable in current environment points to a supported Python version of 3.5+. +{% highlight bash %} +$ python --version +# the version printed here must be 3.5+ +{% endhighlight %} + +The following commands show different PyFlink job submission use-cases: + +- Run a PyFlink job: +{% highlight bash %} +$ ./bin/flink run --python examples/python/table/batch/word_count.py +{% endhighlight %} + +- Run a PyFlink job with pyFiles: Review comment: ```suggestion - Run a PyFlink job with additional source and resource files. Files specified in `--pyFiles` will be added to the `PYTHONPATH` and, therefore, available in the Python code. ``` Sorry for bringing this up that late but reading through it I realized: We might want to elaborate more on what the command does instead of just quoting the parameters used. Feel free to correct my proposal! ########## File path: docs/deployment/cli.md ########## @@ -338,4 +338,74 @@ specified in the `config/flink-config.yaml`. For more details on the commands and the available options, please refer to the Resource Provider-specific pages of the documentation. +### Submitting PyFlink Jobs + +Currently, users are able to submit a PyFlink job via the CLI. It does not require to specify the +JAR file path or the entry main class, which is different from the Java job submission. + +<span class="label label-info">Note</span> When submitting Python job via `flink run`, Flink will run the command "python". Please run the following command to confirm that the python executable in current environment points to a supported Python version of 3.5+. +{% highlight bash %} +$ python --version +# the version printed here must be 3.5+ +{% endhighlight %} + +The following commands show different PyFlink job submission use-cases: + +- Run a PyFlink job: +{% highlight bash %} +$ ./bin/flink run --python examples/python/table/batch/word_count.py +{% endhighlight %} + +- Run a PyFlink job with pyFiles: +{% highlight bash %} +$ ./bin/flink run \ + --python examples/python/table/batch/word_count.py \ + --pyFiles file:///user.txt,hdfs:///$namenode_address/username.txt +{% endhighlight %} + +- Run a PyFlink job with a JAR file: +{% highlight bash %} +$ ./bin/flink run \ + --python examples/python/table/batch/word_count.py \ + --jarfile <jarFile> +{% endhighlight %} + +- Run a PyFlink job with pyFiles and pyModule: +{% highlight bash %} +$ ./bin/flink run \ + --pyModule batch.word_count \ + --pyFiles examples/python/table/batch +{% endhighlight %} + +- Submit a PyFlink job on a specific JobManager running on host `<jobmanagerHost>` (adapt the command accordingly): +{% highlight bash %} +$ ./bin/flink run \ + --jobmanager <jobmanagerHost>:8081 \ + --python examples/python/table/batch/word_count.py +{% endhighlight %} + +- Run a PyFlink job using a [YARN cluster in Per-Job Mode]({% link deployment/resource-providers/yarn.md %}#per-job-cluster-mode): +{% highlight bash %} +$ ./bin/flink run \ + --target yarn-per-job + --python examples/python/table/batch/word_count.py +{% endhighlight %} + +- Run a PyFlink application on a native Kubernetes cluster having hte cluster ID `<ClusterId>`, it requires a docker image with PyFlink installed, please refer to [Enabling PyFlink in docker]({% link deployment/resource-providers/standalone/docker.md %}#enabling-python): Review comment: ```suggestion - Run a PyFlink application on a native Kubernetes cluster having the cluster ID `<ClusterId>`, it requires a docker image with PyFlink installed, please refer to [Enabling PyFlink in docker]({% link deployment/resource-providers/standalone/docker.md %}#enabling-python): ``` ########## File path: docs/deployment/cli.md ########## @@ -338,4 +338,74 @@ specified in the `config/flink-config.yaml`. For more details on the commands and the available options, please refer to the Resource Provider-specific pages of the documentation. +### Submitting PyFlink Jobs + +Currently, users are able to submit a PyFlink job via the CLI. It does not require to specify the +JAR file path or the entry main class, which is different from the Java job submission. + +<span class="label label-info">Note</span> When submitting Python job via `flink run`, Flink will run the command "python". Please run the following command to confirm that the python executable in current environment points to a supported Python version of 3.5+. +{% highlight bash %} +$ python --version +# the version printed here must be 3.5+ +{% endhighlight %} + +The following commands show different PyFlink job submission use-cases: + +- Run a PyFlink job: +{% highlight bash %} +$ ./bin/flink run --python examples/python/table/batch/word_count.py +{% endhighlight %} + +- Run a PyFlink job with pyFiles: +{% highlight bash %} +$ ./bin/flink run \ + --python examples/python/table/batch/word_count.py \ + --pyFiles file:///user.txt,hdfs:///$namenode_address/username.txt +{% endhighlight %} + +- Run a PyFlink job with a JAR file: +{% highlight bash %} +$ ./bin/flink run \ + --python examples/python/table/batch/word_count.py \ + --jarfile <jarFile> +{% endhighlight %} + +- Run a PyFlink job with pyFiles and pyModule: Review comment: The `--pyModule` parameter is used for specifying the job entry point, isn't it? Could you come up with a more descriptive text here as well? ---------------------------------------------------------------- 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: us...@infra.apache.org