Skip to content
This repository has been archived by the owner on Jan 9, 2024. It is now read-only.

Commit

Permalink
Provide more prebuilt wheels (#35)
Browse files Browse the repository at this point in the history
Matrix now configured for

1. Ubuntu-18.04 py3.6 (default), py3.7 (for google colaboratary).
2. Ubuntu-20.04 py3.8 (default), py3.9, py3.10

Fixes chaotic earlier fix for pip --force-reinstall by using
--ignore-installed.
  • Loading branch information
jerinphilip committed Jan 13, 2022
1 parent 487e1a6 commit 3cb4d8b
Showing 1 changed file with 41 additions and 9 deletions.
50 changes: 41 additions & 9 deletions .github/workflows/python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,42 +18,72 @@ env:

jobs:
python-ubuntu:
name: "ubuntu pybindings"
runs-on: "ubuntu-latest"
strategy:
fail-fast: false
matrix:
include:
- name: "Ubuntu 18.04 / py3.6"
os: "ubuntu-18.04"
python-version: "3.6"
- name: "Ubuntu 18.04 / py3.7"
os: "ubuntu-18.04"
python-version: "3.7"
- name: "Ubuntu 20.04 / py3.8"
os: "ubuntu-20.04"
python-version: "3.8"
- name: "Ubuntu 20.04 / py3.9"
os: "ubuntu-20.04"
python-version: "3.9"
- name: "Ubuntu 20.04 / py3.10"
os: "ubuntu-20.04"
python-version: "3.10"

name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive

- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}


- name: Install Dependencies
run: |-
sudo apt-get update
sudo apt-get install -y \
ccache libprotobuf-dev protobuf-compiler \
libboost-all-dev libibus-1.0-dev \
qttools5-dev qtbase5-dev libqt5svg5-dev libarchive-dev \
python3-pybind11 pybind11-dev
pybind11-dev python3-setuptools python3-pybind11
- name: Install MKL
run: |-
wget -qO- "https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2019.PUB" | sudo apt-key add -
sudo sh -c "echo deb https://apt.repos.intel.com/mkl all main > /etc/apt/sources.list.d/intel-mkl.list"
sudo apt-get update -o Dir::Etc::sourcelist="/etc/apt/sources.list.d/intel-mkl.list"
sudo apt-get install -y --no-install-recommends intel-mkl-64bit-2020.0-088
- name: Generate ccache_vars for ccache based on machine
shell: bash
id: ccache_vars
run: |-
echo "::set-output name=hash::$(echo ${{ env.ccache_compilercheck }})"
echo "::set-output name=timestamp::$(date '+%Y-%m-%dT%H.%M.%S')"
- name: Cache-op for build-cache through ccache
uses: actions/cache@v2
with:
path: ${{ env.ccache_dir }}
key: ccache-${{ job.id }}-${{ steps.ccache_vars.outputs.hash }}-${{ github.ref }}-${{ steps.ccache_vars.outputs.timestamp }}
key: ccache-${{ matrix.name }}-${{ steps.ccache_vars.outputs.hash }}-${{ github.ref }}-${{ steps.ccache_vars.outputs.timestamp }}
restore-keys: |-
ccache-${{ job.id }}-${{ steps.ccache_vars.outputs.hash }}-${{ github.ref }}
ccache-${{ job.id }}-${{ steps.ccache_vars.outputs.hash }}
ccache-${{ job.id }}
ccache-${{ matrix.name }}-${{ steps.ccache_vars.outputs.hash }}-${{ github.ref }}
ccache-${{ matrix.name }}-${{ steps.ccache_vars.outputs.hash }}
ccache-${{ matrix.name }}
- name: ccache environment setup
run: |-
echo "CCACHE_COMPILER_CHECK=${{ env.ccache_compilercheck }}" >> $GITHUB_ENV
Expand All @@ -62,18 +92,20 @@ jobs:
echo "CCACHE_COMPRESSLEVEL=${{ env.ccache_compresslevel }}" >> $GITHUB_ENV
echo "CCACHE_DIR=${{ env.ccache_dir }}" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=${{ env.ccache_maxsize }}" >> $GITHUB_ENV
- name: ccache prolog
run: |-
ccache -s # Print current cache stats
ccache -z # Zero cache entry
- name: setup.py
run: |-
python3 -m pip install wheel
BUILD_ARCH=core-avx-i python3 setup.py bdist_wheel --universal
# We're happy with just compile for the moment, so cache gets some seeding.
- name: Install onto root python lib
run: |-
sudo python3 -m pip install --force-reinstall dist/bergamot-*.whl
python3 -m pip install --ignore-installed dist/bergamot-*.whl
- name: Fetch models from translateLocally repository.
run: |-
Expand Down Expand Up @@ -167,7 +199,7 @@ jobs:
# We're happy with just compile for the moment, so cache gets some seeding.
- name: Install onto root python lib
run: |-
python3 -m pip install --force-reinstall dist/bergamot-*.whl
python3 -m pip install dist/bergamot-*.whl
- name: Fetch models from translateLocally repository.
run: |-
Expand Down

0 comments on commit 3cb4d8b

Please sign in to comment.