Hi Nix,

The PythonDriverOptionsParserFactory still doesn't support parsing
arguments other than "--python" and "-pym", see [1] for more details.
Regarding how to work around your current requirements, I guess you
could use
configurations for now as all the CLI options have corresponding
configurations, see [2] for more details. For example, you could use
configuration `python.files` for `pyFiles` arguments.

Regards,
Dian

[1] 
https://github.com/apache/flink/blob/cae5fb4d3b6d9e0c10c3539ea4994fc1ad463b70/flink-python/src/main/java/org/apache/flink/client/python/PythonDriverOptionsParserFactory.java#L36
[1] 
https://nightlies.apache.org/flink/flink-docs-release-1.20/docs/dev/python/dependency_management/

On Tue, Aug 5, 2025 at 8:08 PM Nikola Milutinovic
<n.milutino...@levi9.com> wrote:
>
> Hi all.
>
> PROBLEM: We cannot run a PyFlink job with our custom libraries, using K8s 
> Operator.
>
> We have a Kubernetes deployment of Flink 1.20.2, session cluster mode.
>
> We have a bunch of PyFlink jobs, which have a structure:
>
> Entrypoint Python script: defines the job.
> Core library: core Python classes, shared by all environments.
> Client library: client-specific Python classes.
>
>
> We can successfully launch those jobs from command line, even from a 
> specialized deployer pod. The command we use is:
>
> bin/flink run \
>   --pyFiles core-1.1.0-…whl \
>   --pyFiles clinet1-1.2.1…whl \
>   --python workflows/SCHED/entrypoint.py \
>     --lookup Name
>
> And this is fine. However, when we try to launch them with K8s operator, we 
> are using the following snippet:
>
> apiVersion: flink.apache.org/v1beta1
>
> kind: FlinkSessionJob
>
> metadata:
>
>   name: client-shed-job
>
> spec:
>
>   deploymentName: client1-main-flink
>
>   job:
>
>     args:
>
>     - --python
>
>     - /opt/flink/workflows/SCHED/entrypoint.py
>
>     entryClass: org.apache.flink.client.python.PythonDriver
>
>     parallelism: 1
>
>     state: running
>
>     upgradeMode: savepoint
>
>   restartNonce: 1
>
>
> If we try to add pyFiles arguments, PythonRunner complains about that. And, 
> looking into the source, there is no such option in the PythonDriver.
>
> So, how is it intended to be used? Do we have to have our libraries 
> pre-installed in the Docker image?
>
> Nix.
>

Reply via email to