Skip to content

Commit

Permalink
Upgrade python version to v3.10
Browse files Browse the repository at this point in the history
Signed-off-by: tenzen-y <yuki.iwai.tz@gmail.com>
  • Loading branch information
tenzen-y committed Dec 11, 2022
1 parent f941ec6 commit 58d63a8
Show file tree
Hide file tree
Showing 20 changed files with 29 additions and 22 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/test-python.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,13 @@ jobs:
- name: Setup Python
uses: actions/setup-python@v4
with:
python-version: 3.9
python-version: ${{ matrix.python-version }}

- name: Run Python test
run: make pytest

# TODO (tenzen-y): Remove tests for Python 3.9 once we remove the Chocolate Suggestion Service from Katib.
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10']
2 changes: 1 addition & 1 deletion cmd/earlystopping/medianstop/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
psutil==5.8.0
psutil==5.9.4
rfc3339>=6.2
grpcio==1.41.1
googleapis-common-protos==1.6.0
Expand Down
2 changes: 1 addition & 1 deletion cmd/suggestion/hyperband/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV GRPC_HEALTH_PROBE_VERSION v0.4.11
RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \
&& chmod +x /bin/grpc_health_probe

FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
2 changes: 1 addition & 1 deletion cmd/suggestion/hyperopt/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV GRPC_HEALTH_PROBE_VERSION v0.4.11
RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \
&& chmod +x /bin/grpc_health_probe

FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
2 changes: 1 addition & 1 deletion cmd/suggestion/nas/darts/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV GRPC_HEALTH_PROBE_VERSION v0.4.11
RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \
&& chmod +x /bin/grpc_health_probe

FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
2 changes: 1 addition & 1 deletion cmd/suggestion/nas/enas/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV GRPC_HEALTH_PROBE_VERSION v0.4.11
RUN wget -qO/bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \
&& chmod +x /bin/grpc_health_probe

FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
2 changes: 1 addition & 1 deletion cmd/suggestion/optuna/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV GRPC_HEALTH_PROBE_VERSION v0.4.11
RUN wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \
&& chmod +x /bin/grpc_health_probe

FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
2 changes: 1 addition & 1 deletion cmd/suggestion/pbt/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV GRPC_HEALTH_PROBE_VERSION v0.4.11
RUN wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \
&& chmod +x /bin/grpc_health_probe

FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
2 changes: 1 addition & 1 deletion cmd/suggestion/skopt/v1beta1/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ ENV GRPC_HEALTH_PROBE_VERSION v0.4.11
RUN wget -qO /bin/grpc_health_probe https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} \
&& chmod +x /bin/grpc_health_probe

FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/katib
Expand Down
2 changes: 1 addition & 1 deletion docs/developer-guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ see the following user guides:
- [Docker](https://docs.docker.com/) (20.10 or later)
- [Docker Buildx](https://docs.docker.com/build/buildx/) (0.8.0 or later)
- [Java](https://docs.oracle.com/javase/8/docs/technotes/guides/install/install_overview.html) (8 or later)
- [Python](https://www.python.org/) (3.9 or later)
- [Python](https://www.python.org/) (3.10 or later)
- [kustomize](https://kustomize.io/) (4.0.5 or later)

## Build from source code
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ENV TARGET_DIR /opt/darts-cnn-cifar10

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV TARGET_DIR /opt/enas-cnn-cifar10
Expand Down
2 changes: 1 addition & 1 deletion examples/v1beta1/trial-images/mxnet-mnist/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH
ENV LD_LIBRARY_PATH "${LD_LIBRARY_PATH}:/opt/arm/armpl_22.0.2_gcc-11.2/lib"
Expand Down
2 changes: 1 addition & 1 deletion examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ADD examples/v1beta1/trial-images/pytorch-mnist /opt/pytorch-mnist

Expand Down
2 changes: 1 addition & 1 deletion examples/v1beta1/trial-images/simple-pbt/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ADD examples/v1beta1/trial-images/simple-pbt /opt/pbt

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.9-slim
FROM python:3.10-slim

ARG TARGETARCH

Expand Down
2 changes: 1 addition & 1 deletion test/unit/v1beta1/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
grpcio-testing==1.41.1
pytest==5.1.2
pytest==7.2.0
7 changes: 4 additions & 3 deletions test/unit/v1beta1/suggestion/test_chocolate_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
# limitations under the License.

import os

import sys
import grpc
import grpc_testing
import unittest
import pytest

from pkg.apis.manager.v1beta1.python import api_pb2

from pkg.suggestion.v1beta1.chocolate.service import ChocolateService
if sys.version_info <= (3, 9):
from pkg.suggestion.v1beta1.chocolate.service import ChocolateService

import utils


@unittest.skipIf(sys.version_info >= (3, 10), reason="Chocolate supports only Python 3.9 or lower")
class TestChocolate(unittest.TestCase):
def setUp(self):
servicers = {
Expand Down

0 comments on commit 58d63a8

Please sign in to comment.