Nancy Yang
04/02/2023, 1:11 AMCaused by: java.nio.file.NoSuchFileException: /tmp/pyflink/3e67a85b-296d-4586-aa5b-b654963e6464/7fc3a4b9-0c8f-4d6a-9178-8cff5e5c58e6/word_count.py
I looked at the PythonDriver.java codes, seems it should either create a soft link for the original word_count.py file under the /tmp/pyflink/xxx/yyy/word.py or copy the file over to the /tmp directory. I don't understand why it complaint.
Also the weird thing is if I changed the codes to do different things in python_demo.py. the deployment still succeeded and ran the same stream job. Looks to me the pod was running something from pod template, not from my python-example.yaml.
Has anybody met the same issue? Or I missed something? Thanks in advance!! gratitude thank you
python-example.yaml
apiVersion: <http://flink.apache.org/v1beta1|flink.apache.org/v1beta1>
kind: FlinkDeployment
metadata:
name: python-demo
namespace: flink-operator
spec:
image: registry.localhost:5000/flink-python-demo:latest
flinkVersion: v1_16
flinkConfiguration:
taskmanager.numberOfTaskSlots: "1"
serviceAccount: flink
jobManager:
resource:
memory: "2048m"
cpu: 1
taskManager:
resource:
memory: "2048m"
cpu: 1
job:
jarURI: local:///opt/flink/opt/flink-python-1.16.1.jar # Note, this jarURI is actually a placeholder
entryClass: "org.apache.flink.client.python.PythonDriver"
args: ["-pyclientexec", "/usr/local/bin/python3", "-py", "/opt/flink/usrlib/word_count.py"]
parallelism: 1
upgradeMode: stateless
Gyula Fóra
04/02/2023, 8:31 AMregistry.localhost:5000/flink-python-demo:latest
Gyula Fóra
04/02/2023, 8:31 AMGyula Fóra
04/02/2023, 8:32 AMNancy Yang
04/02/2023, 3:51 PMNancy Yang
04/02/2023, 3:51 PM# Check <https://nightlies.apache.org/flink/flink-docs-release-1.15/docs/deployment/resource-providers/standalone/docker/#using-flink-python-on-docker> for more details
FROM flink:1.16
# install python3: it has updated Python to 3.9 in Debian 11 and so install Python 3.7 from source, \
# it currently only supports Python 3.6, 3.7 and 3.8 in PyFlink officially.
RUN apt-get update -y && \
apt-get install -y build-essential libssl-dev zlib1g-dev libbz2-dev libffi-dev && \
wget <https://www.python.org/ftp/python/3.7.9/Python-3.7.9.tgz> && \
tar -xvf Python-3.7.9.tgz && \
cd Python-3.7.9 && \
./configure --without-tests --enable-shared && \
make -j6 && \
make install && \
ldconfig /usr/local/lib && \
cd .. && rm -f Python-3.7.9.tgz && rm -rf Python-3.7.9 && \
ln -s /usr/local/bin/python3 /usr/local/bin/python && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
# install PyFlink
RUN pip3 install "apache-flink>=1.16.0,<1.17.0"
# add python script
USER flink
RUN mkdir /opt/flink/usrlib
ADD word_count.py /opt/flink/usrlib/word_count.py
Nancy Yang
04/02/2023, 3:53 PMNancy Yang
04/02/2023, 3:54 PMGyula Fóra
04/02/2023, 3:55 PMNancy Yang
04/02/2023, 3:56 PMGyula Fóra
04/02/2023, 3:57 PMNancy Yang
04/02/2023, 4:02 PMNancy Yang
04/02/2023, 4:03 PMvscode ➜ /workspaces/flux (main) $ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b59bde4de198 <http://ghcr.io/k3d-io/k3d-proxy:5.4.8|ghcr.io/k3d-io/k3d-proxy:5.4.8> "/bin/sh -c nginx-pr…" 10 days ago Up 9 days 0.0.0.0:80->80/tcp, :::80->80/tcp, 0.0.0.0:443->443/tcp, 0.0.0.0:6443->6443/tcp, :::443->443/tcp, 0.0.0.0:9093-9094->9093-9094/tcp, :::9093-9094->9093-9094/tcp k3d-k3s-default-serverlb
4cd1b5cf880d rancher/k3s:v1.25.6-k3s1 "/bin/k3d-entrypoint…" 10 days ago Up 9 days k3d-k3s-default-agent-0
0bf17549dc3f rancher/k3s:v1.25.6-k3s1 "/bin/k3d-entrypoint…" 10 days ago Up 9 days k3d-k3s-default-server-0
10494f92ba6c registry:2 "/entrypoint.sh /etc…" 10 days ago Up 9 days 0.0.0.0:5000->5000/tcp registry.localhost
360322be10cd vsc-flux-a10c43daac5c024fe6e7274f561a88ca "/bin/sh -c 'echo Co…" 2 weeks ago Up 9 days nervous_allen
Nancy Yang
04/03/2023, 12:49 AMGyula Fóra
04/03/2023, 4:19 AM