Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
53 commits
Select commit Hold shift + click to select a range
c830c3d
wip
jacobkahn Mar 30, 2023
610f0ba
[ci] Use CircleCI Linux arm64 runners for testing
jacobkahn Mar 30, 2023
1eb55b1
Use a machine executor for all Linux jobs
jacobkahn Mar 30, 2023
b9c6d85
Always find Threads in downstream projects, even w/o standalone
jacobkahn Mar 31, 2023
fd76a3b
Fix empty default option with run_codecov
jacobkahn Mar 31, 2023
9e31fc2
Merge remote-tracking branch 'upstream/fix_threads_config' into linux…
jacobkahn Mar 31, 2023
d37734c
Merge branch 'main' into linux_arm64_ci
jacobkahn Mar 31, 2023
4cad226
Always find the kenlm::kenlm target for downstream CMake deps
jacobkahn Mar 31, 2023
3a2046a
Don't need Findkenlm.cmake if installing from FetchContent
jacobkahn Mar 31, 2023
48c4c43
Merge branch 'find_kenlm_target' into linux_arm64_ci
jacobkahn Mar 31, 2023
e0d2079
Ubuntu 2204
jacobkahn Mar 31, 2023
5b6f97b
Add CMAKE_BUILD_TYPE
jacobkahn Mar 31, 2023
0231ebb
Only one static job, back to Ubuntu 2004
jacobkahn Mar 31, 2023
749c16f
Larger Windows resource class
jacobkahn Mar 31, 2023
2208fc2
2xlarge Windows runner
jacobkahn Mar 31, 2023
248d9a1
KenLM config
jacobkahn Mar 31, 2023
1ee0b4f
comment
jacobkahn Mar 31, 2023
a23e981
flashlight-text-config.cmake.in
jacobkahn Mar 31, 2023
91941ca
lm/CMakeLists.txt
jacobkahn Mar 31, 2023
94ccb40
Revert to old flashlight-text-config.cmake.in
jacobkahn Mar 31, 2023
cd44836
Revert to old lm/CMakeLists.txt
jacobkahn Mar 31, 2023
cb25d1e
Remove support for KenLM module find
jacobkahn Mar 31, 2023
155a8d9
CMake build type
jacobkahn Mar 31, 2023
2a3242e
Merge branch 'kenlm_find' into linux_arm64_ci
jacobkahn Mar 31, 2023
07e66b7
Merge branch 'main' into linux_arm64_ci
jacobkahn Mar 31, 2023
d666d67
Format
jacobkahn Mar 31, 2023
4d38313
Merge branch 'linux_arm64_ci' into circleci_macos_linux_arm64_wheels
jacobkahn Mar 31, 2023
4620c86
Build wheels on macOS and Linux arm64
jacobkahn Mar 31, 2023
3d6f940
Ubuntu tag
jacobkahn Mar 31, 2023
1801026
Syntax
jacobkahn Mar 31, 2023
d7a3246
Add env vars, consolidate
jacobkahn Mar 31, 2023
cb3df6d
Merge branch 'main' into circleci_macos_linux_arm64_wheels
jacobkahn Mar 31, 2023
a734bbb
Compute wheel version + use macOS arm64-compatible Python 3.8
jacobkahn Mar 31, 2023
50631ec
Install Rosetta
jacobkahn Mar 31, 2023
4652da2
install cmake in macos env
jacobkahn Mar 31, 2023
a5f3488
properly propagate version, only build cpython
jacobkahn Mar 31, 2023
a909e11
Use a venv before building wheels
jacobkahn Apr 1, 2023
247bfcc
Remove --user
jacobkahn Apr 1, 2023
129726d
Install dep
jacobkahn Apr 1, 2023
ac53c4d
Dependencies in wheel uploading, test twine component
jacobkahn Apr 3, 2023
aa56716
Temporarily constrain cibw to cpython3.11 for testing
jacobkahn Apr 3, 2023
f5b9df7
Actually persist wheels in workspaces
jacobkahn Apr 3, 2023
2e49263
twine upload --non-interactive
jacobkahn Apr 3, 2023
b61933f
Try password flag
jacobkahn Apr 3, 2023
fe7236c
Try env vars for Twine creds
jacobkahn Apr 3, 2023
55bb3e7
Verbose twine uploads
jacobkahn Apr 3, 2023
65d47a5
Use twine pass as configured env var
jacobkahn Apr 3, 2023
0528005
Fix twine env vars
jacobkahn Apr 3, 2023
e6751d0
No more twine env vars
jacobkahn Apr 3, 2023
f17d0bc
Try any env var
jacobkahn Apr 3, 2023
ffc1338
fix
jacobkahn Apr 3, 2023
5984d3c
fix pypi upload version
jacobkahn Apr 3, 2023
924c2a7
bump
jacobkahn Apr 4, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
117 changes: 113 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ macos_env: &macos_env
environment:
HOMEBREW_NO_AUTO_UPDATE: "1"

linux_env: &linux_env
machine:
image: ubuntu-2004:202201-02

orbs:
win: circleci/windows@5.0.0

Expand Down Expand Up @@ -214,6 +218,28 @@ commands:
cd test_project && mkdir -p build
cmake -S . -B build -DBUILD_SHARED_LIBS=<< parameters.build_shared_libs >> && \
cmake --build build --parallel && ./build/main
cibw_build_wheels:
steps:
- run:
name: Compute wheel version
command: |
pip install packaging
echo "$(python bindings/python/compute_version.py)" > BUILD_VERSION.txt
echo "Building version $(cat BUILD_VERSION.txt)"
# TODO: delete these below lines
echo "0.0.0.dev1" > BUILD_VERSION.txt
echo "Building version $(cat BUILD_VERSION.txt)"
- run:
name: Build wheels
command: |
python -m pip install cibuildwheel==2.12.1
python -m cibuildwheel --output-dir wheelhouse
environment:
CIBW_BEFORE_BUILD: pip install -v git+https://github.com/kpu/kenlm.git && pip install cmake
CIBW_PRERELEASE_PYTHONS: 0
CIBW_BUILD_VERBOSITY: 1
# TODO: delete me
CIBW_BUILD: cp311-manylinux_aarch64 cp311-macosx_arm64
run_codecov:
steps:
- run:
Expand Down Expand Up @@ -246,8 +272,7 @@ jobs:
run_codecov:
type: string
default: "OFF"
machine:
image: ubuntu-2004:202101-01
<<: *linux_env
resource_class: << parameters.resource_class >>
steps:
- checkout
Expand Down Expand Up @@ -283,8 +308,7 @@ jobs:
use_kenlm:
type: string
default: "ON"
machine:
image: ubuntu-2004:202101-01
<<: *linux_env
resource_class: << parameters.resource_class >>
steps:
- checkout
Expand Down Expand Up @@ -386,6 +410,77 @@ jobs:
- run_python_tests:
use_kenlm: << parameters.use_kenlm >>

linux_arm64_wheels:
working_directory: ~/linux_arm64_wheels
<<: *linux_env
resource_class: arm.2xlarge
steps:
- checkout
- setup_python_virtualenv:
platform: "linux"
- cibw_build_wheels
- store_artifacts:
path: wheelhouse/
- persist_to_workspace:
root: ~/linux_arm64_wheels
paths:
- wheelhouse/

macos_arm64_wheels:
working_directory: ~/macos_arm64_wheels
<<: *macos_env
resource_class: macos.m1.large.gen1
steps:
- checkout
- run:
name: Install Rosetta
command: sudo softwareupdate --install-rosetta --agree-to-license
- run:
name: Install macOS arm64-compatible Python 3.8.10
command: |
curl -o /tmp/Python38.pkg https://www.python.org/ftp/python/3.8.10/python-3.8.10-macos11.pkg
sudo installer -pkg /tmp/Python38.pkg -target /
sh "/Applications/Python 3.8/Install Certificates.command"
- setup_python_virtualenv:
platform: "macos"
- cibw_build_wheels
- store_artifacts:
path: wheelhouse/
- persist_to_workspace:
root: ~/macos_arm64_wheels
paths:
- wheelhouse/

upload_wheels_pypi:
<<: *linux_env
resource_class: xlarge
steps:
- attach_workspace:
at: ~/linux_arm64_wheels
- attach_workspace:
at: ~/macos_arm64_wheels
- run:
name: Consolidate wheels
command: |
mkdir wheelhouse
cp ~/linux_arm64_wheels/wheelhouse/*.whl wheelhouse/
cp ~/macos_arm64_wheels/wheelhouse/*.whl wheelhouse/
ls wheelhouse/*.whl
- setup_python_virtualenv:
platform: "linux"
- run:
name: Upload wheels to PyPI
command: |
pip install twine
# TODO: remove testpypi
twine upload wheelhouse/*.whl \
--skip-existing \
--verbose \
--non-interactive \
--username "__token__" \
--password "${TWINE_PASSWORD}" \
--repository testpypi

workflows:
build-test:
jobs:
Expand Down Expand Up @@ -436,3 +531,17 @@ workflows:
- windows_msvc_python:
name: "Windows VS 17 2022 | MSVC 19.33 Python + KenLM"
use_kenlm: "ON"
build-wheels:
jobs:
- linux_arm64_wheels:
name: "Build Python Wheels | Build wheels on ubuntu-20.04 arm64"
- macos_arm64_wheels:
name: "Build Python Wheels | Build wheels on macOS-14 arm64"
- upload_wheels_pypi:
requires:
- "Build Python Wheels | Build wheels on ubuntu-20.04 arm64"
- "Build Python Wheels | Build wheels on macOS-14 arm64"
# filters:
# branches:
# only:
# - main
2 changes: 1 addition & 1 deletion .github/workflows/wheels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
if: runner.os == 'macOS'

- name: Install cibuildwheel
run: python -m pip install cibuildwheel==2.12.0
run: python -m pip install cibuildwheel==2.12.1
- name: Compute version
run: echo "$(python bindings/python/compute_version.py)" > BUILD_VERSION.txt
- name: Build wheels
Expand Down