Skip to content

Commit

Permalink
Bump Python to 3.10 as default (#1185)
Browse files Browse the repository at this point in the history
  • Loading branch information
Adrian Gonzalez-Martin authored Jun 1, 2023
1 parent f3da109 commit 2c0ad7e
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 27 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/benchmark.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,10 @@ jobs:
scenario: ["inference-rest.js", "inference-grpc.js"]
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- name: Install Dependencies
run: |
make install-dev
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@ jobs:
if: github.repository == 'SeldonIO/MLServer' # Do not run this on forks.
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- name: Install Dependencies
run: |
pip install -r requirements/dev.txt
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.version }}
- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- name: Install dependencies
run: |
pip install -r ./requirements/dev.txt
Expand Down Expand Up @@ -148,10 +148,10 @@ jobs:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.inputs.version }}
- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- name: Install dependencies
run: |
pip install -r ./requirements/dev.txt
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/security.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,10 @@ jobs:
steps:
- uses: actions/checkout@v3
- uses: snyk/actions/setup@master
- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- name: Install dependencies
run: |
make install-dev
Expand Down
12 changes: 7 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.8
uses: actions/setup-python@v2
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: 3.8
python-version: "3.10"
- name: Install dependencies
run: |
make install-dev
Expand All @@ -29,6 +29,8 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
# NOTE: There's no pre-built `grpcio` wheel for Python 3.11 yet
# https://github.com/grpc/grpc/issues/32454
python-version: ["3.8", "3.9", "3.10"]
tox-environment:
- mlserver
Expand Down Expand Up @@ -61,7 +63,7 @@ jobs:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
Expand Down Expand Up @@ -106,7 +108,7 @@ jobs:
brew install libomp.rb
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- uses: conda-incubator/setup-miniconda@v2
Expand Down
14 changes: 7 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM python:3.8-slim AS wheel-builder
FROM python:3.10-slim AS wheel-builder
SHELL ["/bin/bash", "-l", "-c"]

COPY ./hack/build-wheels.sh ./hack/build-wheels.sh
Expand All @@ -18,9 +18,9 @@ RUN ./hack/build-wheels.sh /opt/mlserver/dist
FROM registry.access.redhat.com/ubi9/ubi-minimal
SHELL ["/bin/bash", "-c"]

ARG PYTHON_VERSION=3.8.16
ARG CONDA_VERSION=22.11.1
ARG MINIFORGE_VERSION=${CONDA_VERSION}-4
ARG PYTHON_VERSION=3.10.11
ARG CONDA_VERSION=23.1.0
ARG MINIFORGE_VERSION=${CONDA_VERSION}-1
ARG RUNTIMES="all"

# Set a few default environment variables, including `LD_LIBRARY_PATH`
Expand All @@ -32,7 +32,7 @@ ENV MLSERVER_MODELS_DIR=/mnt/models \
MLSERVER_PATH=/opt/mlserver \
CONDA_PATH=/opt/conda \
PATH=/opt/mlserver/.local/bin:/opt/conda/bin:$PATH \
LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/opt/conda/lib/python3.8/site-packages/nvidia/cuda_runtime/lib:$LD_LIBRARY_PATH \
LD_LIBRARY_PATH=/usr/local/nvidia/lib64:/opt/conda/lib/python3.10/site-packages/nvidia/cuda_runtime/lib:$LD_LIBRARY_PATH \
TRANSFORMERS_CACHE=/opt/mlserver/.cache \
NUMBA_CACHE_DIR=/opt/mlserver/.cache

Expand All @@ -46,7 +46,7 @@ RUN microdnf update -y && \
glib2-devel \
shadow-utils

# Install Conda, Python 3.8 and FFmpeg
# Install Conda, Python 3.10 and FFmpeg
RUN microdnf install -y wget && \
wget "https://github.com/conda-forge/miniforge/releases/download/${MINIFORGE_VERSION}/Miniforge3-${MINIFORGE_VERSION}-Linux-x86_64.sh" \
-O miniforge3.sh && \
Expand Down Expand Up @@ -101,7 +101,7 @@ RUN . $CONDA_PATH/etc/profile.d/conda.sh && \
fi && \
pip install $(ls "./dist/mlserver-"*.whl) && \
pip install -r ./requirements/docker.txt && \
rm -f /opt/conda/lib/python3.8/site-packages/spacy/tests/package/requirements.txt && \
rm -f /opt/conda/lib/python3.10/site-packages/spacy/tests/package/requirements.txt && \
rm -rf /root/.cache/pip

COPY ./licenses/license.txt .
Expand Down

0 comments on commit 2c0ad7e

Please sign in to comment.