diff --git a/.github/workflows/test-python.yaml b/.github/workflows/test-python.yaml index 074ea60e274..8e7ce751082 100644 --- a/.github/workflows/test-python.yaml +++ b/.github/workflows/test-python.yaml @@ -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'] diff --git a/cmd/earlystopping/medianstop/v1beta1/Dockerfile b/cmd/earlystopping/medianstop/v1beta1/Dockerfile index 1a5ebd35e2a..a32fbb06169 100644 --- a/cmd/earlystopping/medianstop/v1beta1/Dockerfile +++ b/cmd/earlystopping/medianstop/v1beta1/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.10-slim ARG TARGETARCH ENV TARGET_DIR /opt/katib diff --git a/cmd/metricscollector/v1beta1/tfevent-metricscollector/Dockerfile b/cmd/metricscollector/v1beta1/tfevent-metricscollector/Dockerfile index c5ff6427ec3..9bb78fcdd75 100644 --- a/cmd/metricscollector/v1beta1/tfevent-metricscollector/Dockerfile +++ b/cmd/metricscollector/v1beta1/tfevent-metricscollector/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.10-slim ARG TARGETARCH ENV TARGET_DIR /opt/katib diff --git a/cmd/metricscollector/v1beta1/tfevent-metricscollector/requirements.txt b/cmd/metricscollector/v1beta1/tfevent-metricscollector/requirements.txt index 1303e71856f..4c6afaae49f 100644 --- a/cmd/metricscollector/v1beta1/tfevent-metricscollector/requirements.txt +++ b/cmd/metricscollector/v1beta1/tfevent-metricscollector/requirements.txt @@ -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 diff --git a/cmd/suggestion/chocolate/v1beta1/Dockerfile b/cmd/suggestion/chocolate/v1beta1/Dockerfile index bff97750af4..246369ebbff 100644 --- a/cmd/suggestion/chocolate/v1beta1/Dockerfile +++ b/cmd/suggestion/chocolate/v1beta1/Dockerfile @@ -15,9 +15,7 @@ ENV PYTHONPATH ${TARGET_DIR}:${TARGET_DIR}/pkg/apis/manager/v1beta1/python:${TAR RUN apt-get -y update && \ apt-get -y install git && \ - if [ "${TARGETARCH}" = "ppc64le" ] || [ "${TARGETARCH}" = "arm64" ]; then \ apt-get -y install gfortran libopenblas-dev liblapack-dev g++; \ - fi && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* diff --git a/cmd/suggestion/chocolate/v1beta1/requirements.txt b/cmd/suggestion/chocolate/v1beta1/requirements.txt index 69e9408d121..ff491d43c5b 100644 --- a/cmd/suggestion/chocolate/v1beta1/requirements.txt +++ b/cmd/suggestion/chocolate/v1beta1/requirements.txt @@ -8,6 +8,5 @@ protobuf==3.19.5 googleapis-common-protos==1.6.0 SQLAlchemy==1.4.26 git+https://github.com/AIworx-Labs/chocolate@master -ghalton>=0.6.2; platform_machine=="x86_64" -git+https://github.com/fmder/ghalton@master; platform_machine=="aarch64" +git+https://github.com/fmder/ghalton@master cython>=0.29.24 diff --git a/cmd/suggestion/hyperband/v1beta1/Dockerfile b/cmd/suggestion/hyperband/v1beta1/Dockerfile index c116991242b..2afceb05e9f 100644 --- a/cmd/suggestion/hyperband/v1beta1/Dockerfile +++ b/cmd/suggestion/hyperband/v1beta1/Dockerfile @@ -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 diff --git a/cmd/suggestion/hyperopt/v1beta1/Dockerfile b/cmd/suggestion/hyperopt/v1beta1/Dockerfile index 2324c12753c..9c7bc2e6bf2 100644 --- a/cmd/suggestion/hyperopt/v1beta1/Dockerfile +++ b/cmd/suggestion/hyperopt/v1beta1/Dockerfile @@ -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 diff --git a/cmd/suggestion/nas/darts/v1beta1/Dockerfile b/cmd/suggestion/nas/darts/v1beta1/Dockerfile index e94341f0779..9f26214a3ca 100644 --- a/cmd/suggestion/nas/darts/v1beta1/Dockerfile +++ b/cmd/suggestion/nas/darts/v1beta1/Dockerfile @@ -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 diff --git a/cmd/suggestion/nas/enas/v1beta1/Dockerfile b/cmd/suggestion/nas/enas/v1beta1/Dockerfile index 639d21b2750..8b12354ee32 100644 --- a/cmd/suggestion/nas/enas/v1beta1/Dockerfile +++ b/cmd/suggestion/nas/enas/v1beta1/Dockerfile @@ -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 diff --git a/cmd/suggestion/optuna/v1beta1/Dockerfile b/cmd/suggestion/optuna/v1beta1/Dockerfile index 7b7129f7f44..9105b54d5dc 100644 --- a/cmd/suggestion/optuna/v1beta1/Dockerfile +++ b/cmd/suggestion/optuna/v1beta1/Dockerfile @@ -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 diff --git a/cmd/suggestion/pbt/v1beta1/Dockerfile b/cmd/suggestion/pbt/v1beta1/Dockerfile index e969ee39c21..795cdf009cb 100644 --- a/cmd/suggestion/pbt/v1beta1/Dockerfile +++ b/cmd/suggestion/pbt/v1beta1/Dockerfile @@ -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 diff --git a/cmd/suggestion/skopt/v1beta1/Dockerfile b/cmd/suggestion/skopt/v1beta1/Dockerfile index a0f934fafbf..c6d71b534b9 100644 --- a/cmd/suggestion/skopt/v1beta1/Dockerfile +++ b/cmd/suggestion/skopt/v1beta1/Dockerfile @@ -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 diff --git a/docs/developer-guide.md b/docs/developer-guide.md index 183e4fd99b6..f1fad64585d 100644 --- a/docs/developer-guide.md +++ b/docs/developer-guide.md @@ -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 diff --git a/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu b/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu index 067628cf06e..7437e1867bd 100644 --- a/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu +++ b/examples/v1beta1/trial-images/darts-cnn-cifar10/Dockerfile.cpu @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.10-slim ENV TARGET_DIR /opt/darts-cnn-cifar10 diff --git a/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu b/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu index c2cdb993edd..b5933d60a81 100644 --- a/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu +++ b/examples/v1beta1/trial-images/enas-cnn-cifar10/Dockerfile.cpu @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.10-slim ARG TARGETARCH ENV TARGET_DIR /opt/enas-cnn-cifar10 diff --git a/examples/v1beta1/trial-images/mxnet-mnist/Dockerfile b/examples/v1beta1/trial-images/mxnet-mnist/Dockerfile index d19c1aac175..6dce6a685bb 100644 --- a/examples/v1beta1/trial-images/mxnet-mnist/Dockerfile +++ b/examples/v1beta1/trial-images/mxnet-mnist/Dockerfile @@ -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" diff --git a/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu b/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu index 1ebab4fa036..5fef0094386 100644 --- a/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu +++ b/examples/v1beta1/trial-images/pytorch-mnist/Dockerfile.cpu @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.10-slim ADD examples/v1beta1/trial-images/pytorch-mnist /opt/pytorch-mnist diff --git a/examples/v1beta1/trial-images/simple-pbt/Dockerfile b/examples/v1beta1/trial-images/simple-pbt/Dockerfile index f7285447c14..b05de3d35e3 100644 --- a/examples/v1beta1/trial-images/simple-pbt/Dockerfile +++ b/examples/v1beta1/trial-images/simple-pbt/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.10-slim ADD examples/v1beta1/trial-images/simple-pbt /opt/pbt diff --git a/examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile b/examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile index c34b660f23a..f589dd4608f 100644 --- a/examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile +++ b/examples/v1beta1/trial-images/tf-mnist-with-summaries/Dockerfile @@ -1,4 +1,4 @@ -FROM python:3.9-slim +FROM python:3.10-slim ARG TARGETARCH diff --git a/test/unit/v1beta1/requirements.txt b/test/unit/v1beta1/requirements.txt index 06604d58cf1..2aa91b337e3 100644 --- a/test/unit/v1beta1/requirements.txt +++ b/test/unit/v1beta1/requirements.txt @@ -1,2 +1,2 @@ grpcio-testing==1.41.1 -pytest==5.1.2 +pytest==7.2.0 diff --git a/test/unit/v1beta1/suggestion/test_chocolate_service.py b/test/unit/v1beta1/suggestion/test_chocolate_service.py index 34809f4863f..d53e894cac1 100644 --- a/test/unit/v1beta1/suggestion/test_chocolate_service.py +++ b/test/unit/v1beta1/suggestion/test_chocolate_service.py @@ -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, 10): + 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 = {