Skip to content

Commit ff36738

Browse files
authored
chore: free pydantic version (#6150)
1 parent 64f9f75 commit ff36738

40 files changed

+809
-631
lines changed

.github/workflows/cd.yml

+33-37
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ jobs:
4545
- run: |
4646
pip install . --no-cache-dir
4747
pip install docarray==0.21.0 # only valid for this version. I think we should remove this schema loading
48+
pip install docarray==1.10.3
4849
JINA_VERSION=$(sed -n '/^__version__/p' ./jina/__init__.py | cut -d \' -f2)-master
4950
echo "JINA_VERSION=${JINA_VERSION}" >> $GITHUB_ENV
5051
cd schema
@@ -108,6 +109,7 @@ jobs:
108109
matrix:
109110
python-version: ["3.10"]
110111
protobuf-version: ['==3.19.6', '']
112+
pydantic-version: ['==1.10.3', '<3.0.0']
111113
steps:
112114
- uses: actions/[email protected]
113115
- name: Set up Python ${{ matrix.python-version }}
@@ -118,6 +120,7 @@ jobs:
118120
uses: actions/setup-go@v2
119121
with:
120122
go-version: 1.19.5
123+
121124
- name: Install dependencies
122125
run: |
123126
python -m pip install --upgrade pip
@@ -130,7 +133,8 @@ jobs:
130133
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
131134
- name: Prepare environment
132135
run: |
133-
docker build -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
136+
# Take into account in the `test-pip` the versions
137+
docker build --build-arg PYDANTIC_VERSION="${{ matrix.pydantic-version }}" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
134138
python -m pip install --upgrade pip
135139
python -m pip install wheel
136140
WHEEL_FILE=$(ls dist/*whl)
@@ -140,22 +144,24 @@ jobs:
140144
else
141145
pip install -U protobuf${{ matrix.protobuf-version }} grpcio==1.65.5 grpcio-reflection==1.65.5 grpcio-health-checking==1.65.5
142146
fi
147+
pip install pydantic"${{ matrix.pydantic-version }}"
143148
jina
144149
export JINA_LOG_LEVEL="ERROR"
145150
- name: Test
146151
id: test
147152
run: |
148153
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/unit/serve/runtimes/test_helper.py
149-
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/docarray_v2/test_v2.py
150154
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/deployment_http_composite
151155
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/docarray_v2/test_singleton.py
152156
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/docarray_v2/test_parameters_as_pydantic.py
153157
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/docarray_v2/test_streaming.py
154158
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/docarray_v2/csp
155159
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/docarray_v2/docker
160+
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/docarray_v2/test_v2.py
161+
pytest --suppress-no-test-exit-code --force-flaky --min-passes 1 --max-runs 5 --cov=jina --cov-report=xml --timeout=600 -v -s --ignore-glob='tests/integration/hub_usage/dummyhub*' tests/integration/docarray_v2/test_errors.py
156162
echo "flag it as jina for codeoverage"
157163
echo "codecov_flag=jina" >> $GITHUB_OUTPUT
158-
timeout-minutes: 45
164+
timeout-minutes: 60
159165
env:
160166
JINA_AUTH_TOKEN: "${{ secrets.JINA_AUTH_TOKEN }}"
161167
- name: Check codecov file
@@ -165,13 +171,14 @@ jobs:
165171
files: "coverage.xml"
166172
- name: Upload coverage from test to Codecov
167173
uses: codecov/[email protected]
168-
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
174+
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.10'
169175
with:
170176
file: coverage.xml
171177
name: ${{ matrix.test-path }}-codecov
172178
flags: ${{ steps.test.outputs.codecov_flag }}
173179
fail_ci_if_error: false
174180

181+
175182
stateful-docarray-v-two-test:
176183
needs: prep-testbed
177184
runs-on: ubuntu-latest
@@ -182,6 +189,7 @@ jobs:
182189
matrix:
183190
python-version: ["3.10"]
184191
protobuf-version: ['==3.19.6', '']
192+
pydantic-version: ['==1.10.3', '<3.0.0']
185193
steps:
186194
- uses: actions/[email protected]
187195
- name: Set up Python ${{ matrix.python-version }}
@@ -205,7 +213,8 @@ jobs:
205213
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
206214
- name: Prepare environment
207215
run: |
208-
docker build -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
216+
# Take into account in the `test-pip` the versions
217+
docker build --build-arg PYDANTIC_VERSION="${{ matrix.pydantic-version }}" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
209218
python -m pip install --upgrade pip
210219
python -m pip install wheel
211220
WHEEL_FILE=$(ls dist/*whl)
@@ -215,6 +224,7 @@ jobs:
215224
else
216225
pip install -U protobuf${{ matrix.protobuf-version }} grpcio==1.65.5 grpcio-reflection==1.65.5 grpcio-health-checking==1.65.5
217226
fi
227+
pip install pydantic"${{ matrix.pydantic-version }}"
218228
jina
219229
export JINA_LOG_LEVEL="ERROR"
220230
- name: Test stateful
@@ -233,7 +243,7 @@ jobs:
233243
files: "coverage.xml"
234244
- name: Upload coverage from test to Codecov
235245
uses: codecov/[email protected]
236-
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.8'
246+
if: steps.check_files.outputs.files_exists == 'true' && ${{ matrix.python-version }} == '3.10'
237247
with:
238248
file: coverage.xml
239249
name: ${{ matrix.test-path }}-codecov
@@ -474,12 +484,13 @@ jobs:
474484
setuptools-golang-build-manylinux-wheels --pythons cp310-cp310
475485
- name: Prepare environment
476486
run: |
477-
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
487+
docker build --build-arg DOCARRAY_VERSION="0.21.0" --build-arg PYDANTIC_VERSION="==1.10.3" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
478488
python -m pip install --upgrade pip
479489
python -m pip install wheel
480490
WHEEL_FILE=$(ls dist/*whl)
481491
pip install "$WHEEL_FILE[all]" --no-cache-dir
482492
pip install docarray==0.21.0
493+
pip install pydantic==1.10.3
483494
pip install grpcio==1.65.5 grpcio-reflection==1.65.5 grpcio-health-checking==1.65.5
484495
jina
485496
export JINA_LOG_LEVEL="ERROR"
@@ -517,7 +528,7 @@ jobs:
517528
matrix:
518529
core: ['', 'true']
519530
perf: ['', 'true']
520-
python-env: ['3.7', '3.8', '3.9', '3.10', '3.11']
531+
python-version: ["3.8", "3.9", "3.10", "3.11"]
521532
exclude:
522533
- core: 'true'
523534
perf: 'true'
@@ -532,6 +543,7 @@ jobs:
532543
python -m pip install --upgrade pip
533544
python -m pip install wheel
534545
pip install --no-cache-dir .
546+
pip list
535547
env:
536548
JINA_PIP_INSTALL_CORE: ${{ matrix.core }}
537549
JINA_PIP_INSTALL_PERF: ${{ matrix.perf }}
@@ -576,28 +588,6 @@ jobs:
576588
- run: |
577589
docker run --platform ${{ matrix.test-arch }} localhost:5000/jina/multiarch:latest -v
578590
579-
hub-test:
580-
needs: update-schema
581-
runs-on: ubuntu-latest
582-
if: ${{ !github.event.pull_request.head.repo.fork }}
583-
steps:
584-
# - name: Cancel Previous Runs
585-
# uses: styfle/[email protected]
586-
# with:
587-
# access_token: ${{ github.token }}
588-
- uses: actions/[email protected]
589-
- name: Set up Python 3.10
590-
uses: actions/setup-python@v4
591-
with:
592-
python-version: "3.10"
593-
- name: Test hubapp with hubpods
594-
run: |
595-
./tests/jinahub/test_integration.sh
596-
timeout-minutes: 30
597-
env:
598-
JINAHUB_USERNAME: ${{ secrets.JINAHUB_USERNAME }}
599-
JINAHUB_PASSWORD: ${{ secrets.JINAHUB_PASSWORD }}
600-
601591
k8s-flow-test:
602592
needs: update-schema
603593
runs-on: ubuntu-latest
@@ -609,11 +599,12 @@ jobs:
609599
python-version: "3.10"
610600
- name: Prepare enviroment
611601
run: |
612-
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
602+
docker build --build-arg DOCARRAY_VERSION="0.21.0" --build-arg PYDANTIC_VERSION="==1.10.3" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
613603
python -m pip install --upgrade pip
614604
python -m pip install wheel
615605
pip install ".[all]" --no-cache-dir
616606
pip install docarray==0.21.0
607+
pip install pydantic==1.10.3
617608
jina
618609
export JINA_LOG_LEVEL="ERROR"
619610
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
@@ -651,11 +642,12 @@ jobs:
651642
python-version: "3.10"
652643
- name: Prepare enviroment
653644
run: |
654-
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
645+
docker build --build-arg DOCARRAY_VERSION="0.21.0" --build-arg PYDANTIC_VERSION="==1.10.3" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
655646
python -m pip install --upgrade pip
656647
python -m pip install wheel
657648
pip install ".[all]" --no-cache-dir
658649
pip install docarray==0.21.0
650+
pip install pydantic==1.10.3
659651
jina
660652
export JINA_LOG_LEVEL="ERROR"
661653
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
@@ -693,11 +685,12 @@ jobs:
693685
python-version: "3.10"
694686
- name: Prepare enviroment
695687
run: |
696-
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
688+
docker build --build-arg DOCARRAY_VERSION="0.21.0" --build-arg PYDANTIC_VERSION="==1.10.3" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
697689
python -m pip install --upgrade pip
698690
python -m pip install wheel
699691
pip install ".[all]" --no-cache-dir
700692
pip install docarray==0.21.0
693+
pip install pydantic==1.10.3
701694
jina
702695
export JINA_LOG_LEVEL="ERROR"
703696
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
@@ -735,11 +728,12 @@ jobs:
735728
python-version: "3.10"
736729
- name: Prepare enviroment
737730
run: |
738-
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
731+
docker build --build-arg DOCARRAY_VERSION="0.21.0" --build-arg PYDANTIC_VERSION="==1.10.3" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
739732
python -m pip install --upgrade pip
740733
python -m pip install wheel
741734
pip install ".[all]" --no-cache-dir
742735
pip install docarray==0.21.0
736+
pip install pydantic==1.10.3
743737
jina
744738
export JINA_LOG_LEVEL="ERROR"
745739
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
@@ -778,11 +772,12 @@ jobs:
778772
python-version: "3.10"
779773
- name: Prepare enviroment
780774
run: |
781-
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
775+
docker build --build-arg DOCARRAY_VERSION="0.21.0" --build-arg PYDANTIC_VERSION="==1.10.3" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
782776
python -m pip install --upgrade pip
783777
python -m pip install wheel
784778
pip install ".[all]" --no-cache-dir
785779
pip install docarray==0.21.0
780+
pip install pydantic==1.10.3
786781
jina
787782
export JINA_LOG_LEVEL="ERROR"
788783
curl -LO https://dl.k8s.io/release/v1.21.1/bin/linux/amd64/kubectl
@@ -818,11 +813,12 @@ jobs:
818813
python-version: "3.10"
819814
- name: Prepare enviroment
820815
run: |
821-
docker build --build-arg DOCARRAY_VERSION="0.21.0" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
816+
docker build --build-arg DOCARRAY_VERSION="0.21.0" --build-arg PYDANTIC_VERSION="==1.10.3" -f Dockerfiles/test-pip.Dockerfile -t jinaai/jina:test-pip .
822817
python -m pip install --upgrade pip
823818
python -m pip install wheel
824819
pip install ".[all]" --no-cache-dir
825820
pip install docarray==0.21.0
821+
pip install pydantic==1.10.3
826822
jina
827823
export JINA_LOG_LEVEL="ERROR"
828824
env:
@@ -867,7 +863,7 @@ jobs:
867863
# just for blocking the merge until all parallel core-test are successful
868864
success-all-steps:
869865
runs-on: ubuntu-latest
870-
needs: [core-test, docarray-v-two-test, stateful-docarray-v-two-test, import-test, hub-test, k8s-flow-test, k8s-deployment-test, k8s-graceful-test, k8s-failures-test, k8s-otel-test, docker-compose-test, docker-image-test, benchmark-pre-release, update-schema, update-docker] #, pre-release]
866+
needs: [core-test, docarray-v-two-test, stateful-docarray-v-two-test, import-test, k8s-flow-test, k8s-deployment-test, k8s-graceful-test, k8s-failures-test, k8s-otel-test, docker-compose-test, docker-image-test, benchmark-pre-release, update-schema, update-docker] #, pre-release]
871867
if: always()
872868
steps:
873869
- uses: technote-space/workflow-conclusion-action@v2

0 commit comments

Comments
 (0)