Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into upstream-main
Browse files Browse the repository at this point in the history
  • Loading branch information
dtpryce committed Sep 19, 2024
2 parents e7064b0 + c2dbbb9 commit c05889a
Show file tree
Hide file tree
Showing 192 changed files with 18,029 additions and 11,845 deletions.
7 changes: 7 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,13 @@ updates:
reviewers:
- "SeldonIO/mlops"

- package-ecosystem: "pip"
directory: "/runtimes/catboost"
schedule:
interval: "weekly"
reviewers:
- "SeldonIO/mlops"

- package-ecosystem: "docker"
directory: "/"
schedule:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/licenses.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@ jobs:
subdependency.
This automated PR will re-generate the licenses to keep them up to
date."
reviewers: adriangonz
reviewers: "SeldonIO/mlops"
4 changes: 2 additions & 2 deletions .github/workflows/release-sc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ jobs:
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
preflight --version
env:
PREFLIGHT_VERSION: 1.4.2
PREFLIGHT_VERSION: 1.10.0
- name: Submit preflight results
run: |
preflight check container \
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
preflight --version
env:
PREFLIGHT_VERSION: 1.4.2
PREFLIGHT_VERSION: 1.10.0
- name: Submit preflight results
run: |
preflight check container \
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
preflight --version
env:
PREFLIGHT_VERSION: 1.4.2
PREFLIGHT_VERSION: 1.10.0
- name: Submit preflight results
run: |
preflight check container \
Expand Down Expand Up @@ -164,7 +164,7 @@ jobs:
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
preflight --version
env:
PREFLIGHT_VERSION: 1.4.2
PREFLIGHT_VERSION: 1.10.0
- name: Submit preflight results
run: |
preflight check container \
Expand Down Expand Up @@ -216,6 +216,7 @@ jobs:
- mllib
- sklearn
- xgboost
- catboost
steps:
- name: Maximize build space
uses: easimon/maximize-build-space@master
Expand Down Expand Up @@ -287,7 +288,7 @@ jobs:
sudo mv preflight-linux-amd64 /usr/local/bin/preflight
preflight --version
env:
PREFLIGHT_VERSION: 1.4.2
PREFLIGHT_VERSION: 1.10.0
- name: Submit preflight results
run: |
preflight check container \
Expand Down
150 changes: 91 additions & 59 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,56 +9,80 @@ on:
branches: [master]

jobs:
generate:
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10"]
target: ["dataplane", "model-repository"]
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install dependencies
run: poetry install --sync --only dev
- name: Generate ${{ matrix.target }}
run: make generate-${{ matrix.target }}
- name: Check for changes
run: make lint-no-changes

lint:
runs-on: ubuntu-latest
strategy:
matrix:
python-version:
- "3.9"
- "3.10"
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
- name: Set up Python 3.10
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install dependencies
run: |
make install-dev
run: poetry install --sync --only dev
- name: Lint
run: |
make lint
run: make lint

mlserver:
test-mlserver:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
os:
- ubuntu-22.04
- macos-13
# NOTE: There's no pre-built `grpcio` wheel for Python 3.11 yet
# https://github.com/grpc/grpc/issues/32454
python-version: ["3.9", "3.10"]
python-version:
- "3.9"
- "3.10"
is-pr:
- ${{ github.event_name == 'pull_request' }}
exclude:
# MacOS tests take a lot of time, so we will run them only on merge
# From https://github.com/orgs/community/discussions/26253
- is-pr: true
os: macos-latest
os: macos-13
runs-on: ${{ matrix.os }}
steps:
- name: Setup docker (missing on MacOS)
if: runner.os == 'macos'
run: |
# From https://github.com/actions/runner-images/issues/17#issuecomment-1537238473
# From https://github.com/abiosoft/colima/discussions/273#discussioncomment-4959736
# NOTE: Use the `slirp` driver rather than the default to avoid
# random connection errors.
# From https://github.com/abiosoft/colima/issues/577
brew install docker docker-buildx
mkdir -p $HOME/.docker/cli-plugins
ln -sfn $(which docker-buildx) $HOME/.docker/cli-plugins/docker-buildx
colima start --memory 5 --network-driver slirp
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
- uses: actions/checkout@v4
- name: Setup Docker (missing on MacOS)
if: runner.os == 'macos'
run: ./hack/install-docker-macos.sh
- name: Install OpenMP (in MacOS)
if: runner.os == 'macOS'
run: brew install libomp
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -71,19 +95,25 @@ jobs:
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install Dependencies
run: |
poetry install --sync --only dev
- name: Install dependencies
run: poetry install --only test
- name: Test
run: |
tox -e mlserver
if [[ ${{ runner.os == 'macOS' }} ]]; then
source ./hack/activate-libomp-macos.sh
fi
poetry run tox -e mlserver
runtimes:
test-runtimes:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10"]
os:
- ubuntu-22.04
- macos-13
python-version:
- "3.9"
- "3.10"
tox-environment:
- sklearn
- xgboost
Expand All @@ -99,10 +129,13 @@ jobs:
# MacOS tests take a lot of time, so we will run them only on merge
# From https://github.com/orgs/community/discussions/26253
- is-pr: true
os: macos-latest
os: macos-13
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v4
- name: Install OpenMP (in MacOS)
if: runner.os == 'macOS'
run: brew install libomp
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -115,21 +148,27 @@ jobs:
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install Dependencies
run: |
poetry install --sync --only dev
- name: Install dependencies
run: poetry install --only test
- name: Test
run: |
tox -c ./runtimes/${{ matrix.tox-environment }}
if [[ ${{ runner.os == 'macOS' }} ]]; then
source ./hack/activate-libomp-macos.sh
fi
poetry run tox -c ./runtimes/${{ matrix.tox-environment }}
# Ensure that having all the runtimes installed together works
all-runtimes:
test-all-runtimes:
if: github.event_name == 'push'
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10"]
os:
- ubuntu-22.04
- macos-12
python-version:
- "3.9"
- "3.10"
runs-on: ${{ matrix.os }}
steps:
- name: Maximize build space
Expand All @@ -143,30 +182,21 @@ jobs:
remove-docker-images: 'true'
overprovision-lvm: 'true'
swap-size-mb: 1024
- name: Setup docker (missing on MacOS)
- uses: actions/checkout@v4
- name: Setup Docker (missing on MacOS)
if: runner.os == 'macOS'
run: |
# From https://github.com/actions/runner-images/issues/17#issuecomment-1537238473
# From https://github.com/abiosoft/colima/discussions/273#discussioncomment-4959736
# NOTE: Use the `slirp` driver rather than the default to avoid
# random connection errors.
# From https://github.com/abiosoft/colima/issues/577
brew install docker docker-buildx
mkdir -p $HOME/.docker/cli-plugins
ln -sfn $(which docker-buildx) $HOME/.docker/cli-plugins/docker-buildx
colima start --memory 5 --network-driver slirp
sudo ln -sf $HOME/.colima/default/docker.sock /var/run/docker.sock
run: ./hack/install-docker-macos.sh
- name: Downgrade OpenMP (in MacOS)
if: runner.os == 'macOS'
if: runner.os == 'macos'
run: |
# Recent versions of OpenMP cause segfaults in MacOS when training
# LightGBM / XGBoost models (but only when Torch is present)
# https://github.com/microsoft/LightGBM/issues/4229
# https://github.com/autogluon/autogluon/issues/1442
wget https://raw.githubusercontent.com/Homebrew/homebrew-core/fb8323f2b170bd4ae97e1bac9bf3e2983af3fdb0/Formula/libomp.rb
wget https://raw.githubusercontent.com/chenrui333/homebrew-core/0094d1513ce9e2e85e07443b8b5930ad298aad91/Formula/libomp.rb
brew unlink libomp
brew install libomp.rb
- uses: actions/checkout@v4
brew install --build-from-source ./libomp.rb
brew list --version libomp
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
Expand All @@ -179,9 +209,11 @@ jobs:
uses: snok/install-poetry@v1
with:
virtualenvs-create: false
- name: Install Dependencies
run: |
poetry install --sync --only dev
- name: Install dependencies
run: poetry install --only test
- name: Test
run: |
tox -e all-runtimes
if [[ ${{ runner.os == 'macOS' }} ]]; then
source ./hack/activate-libomp-macos.sh
fi
poetry run tox -e all-runtimes
6 changes: 4 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ bin

# Mac file system
**/.DS_Store

# editor and IDE paraphernalia
.idea
.vscode
Expand Down Expand Up @@ -51,6 +51,8 @@ mlruns
dataset
lightning_logs

# Runtime: CatBoost
catboost_info/

# Sphinx documentation
docs/_build/
Expand All @@ -59,7 +61,7 @@ docs/_build/
**/tests/testdata/.cache/**
## The .data path is longer used, but let's keep the line to avoid people
## pushing their old .data folder by mistake
runtimes/alibi-explain/tests/.data/**
runtimes/alibi-explain/tests/.data/**

# Docker metadata
.docker/
11 changes: 6 additions & 5 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,17 @@ formats:
build:
os: ubuntu-22.04
tools:
python: "3.8"
python: "3.10"
jobs:
# Set up Poetry
# From https://docs.readthedocs.io/en/stable/build-customization.html#install-dependencies-with-poetry
post_create_environment:
# Install poetry
# https://python-poetry.org/docs/#installing-manually
- pip install poetry==1.4.2
# Tell poetry to not use a virtual environment
- poetry config virtualenvs.create false
- pip install poetry==1.8.1
post_install:
# Install dependencies with 'docs' dependency group
# https://python-poetry.org/docs/managing-dependencies/#dependency-groups
- poetry install -vvv --without dev --with docs --with all-runtimes --with all-runtimes-dev
# VIRTUAL_ENV needs to be set manually for now.
# See https://github.com/readthedocs/readthedocs.org/pull/11152/
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH poetry install -vvv --without dev --with docs --with all-runtimes --with all-runtimes-dev
Loading

0 comments on commit c05889a

Please sign in to comment.