Skip to content

Commit

Permalink
Upgrade Flink Services Operator to use python 3.12 and Kopf 1.37
Browse files Browse the repository at this point in the history
A recent update of python-json-logger is incompatible with kopf library.
Therefore an update is needed to force selection of a previos version. In this
context kopf and python versions are updated.

Signed-off-by: marcel <[email protected]>
  • Loading branch information
wagmarcel authored and abhijith-hr committed Dec 13, 2024
1 parent 670f3c2 commit 128617c
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 15 deletions.
15 changes: 7 additions & 8 deletions FlinkSqlServicesOperator/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,21 +1,20 @@
FROM python:3.8 as precheck
RUN pip3 install kubernetes kopf==1.32.1 oisp pycodestyle pylint coverage aiounittest pytimeparse
FROM python:3.12 as precheck
RUN pip3 install kubernetes kopf==1.37.3 oisp pycodestyle pylint coverage aiounittest pytimeparse
ADD test/requirements.txt /opt/test/
RUN cd /opt/test && pip install -r requirements.txt
RUN cd /opt/test && pip3 install -r requirements.txt
ADD *.py /opt/
ADD test/*.py /opt/test/
#RUN PYTHONPATH=/opt python3 -m pycodestyle /opt/*.py
RUN PYTHONPATH=/opt python3 -m pylint --disable=fixme /opt/*.py
RUN PYTHONPATH=/opt coverage run /opt/test/test_beamservicesoperator.py && \
RUN PYTHONPATH=/opt python3 -m pylint --disable=fixme,R0917,C0103 /opt/*.py
RUN PYTHONPATH=/opt coverage run /opt/test/test_beamservicesoperator.py && \
PYTHONPATH=/opt coverage run -a /opt/test/test_tables_and_views.py && \
PYTHONPATH=/opt coverage run -a /opt/test/test_util.py && \
PYTHONPATH=/opt coverage run -a /opt/test/test_beamsqlstatementsetoperator.py && \
PYTHONPATH=/opt coverage run -a /opt/test/test_flink_util.py && \
PYTHONPATH=/opt coverage run -a /opt/test/test_util.py
RUN coverage report --omit "*/test*" -m --fail-under 80

FROM python:3.8
RUN pip install kubernetes kopf==1.32.1 oisp pytimeparse
FROM python:3.12
RUN pip3 install kubernetes python-json-logger==2.0.7 kopf==1.37.3 oisp pytimeparse
COPY --from=precheck /opt/*.py /opt/
WORKDIR /opt
RUN groupadd -r bsoperator && useradd -r -g bsoperator bsoperator
Expand Down
5 changes: 3 additions & 2 deletions FlinkSqlServicesOperator/test/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
bunch==1.0.1
mock==4.0.3
bunch-py3==2.0.0
mock==4.0.3
python-json-logger==2.0.7
2 changes: 1 addition & 1 deletion FlinkSqlServicesOperator/test/test_beamservicesoperator.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""Unit test for beamservicesoperator.py"""
from unittest import TestCase, mock
import unittest
from bunch import Bunch
from bunch_py3 import Bunch
from mock import patch, mock_open
import aiounittest

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
"""
from unittest import TestCase
import unittest
from bunch import Bunch
from bunch_py3 import Bunch
from mock import patch
import kopf
import requests
Expand Down
2 changes: 1 addition & 1 deletion FlinkSqlServicesOperator/test/test_flink_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from unittest import TestCase
import unittest
from bunch import Bunch
from bunch_py3 import Bunch
from mock import patch
import requests

Expand Down
2 changes: 1 addition & 1 deletion FlinkSqlServicesOperator/test/test_tables_and_views.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"""
from unittest import TestCase
import unittest
from bunch import Bunch
from bunch_py3 import Bunch
from mock import patch

import tables_and_views as target
Expand Down
2 changes: 1 addition & 1 deletion FlinkSqlServicesOperator/test/test_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

from unittest import TestCase
import unittest
from bunch import Bunch
from bunch_py3 import Bunch
from mock import patch

import util as target
Expand Down

0 comments on commit 128617c

Please sign in to comment.