From 76725eed7d3492f915723741ce16fa3aeef67c07 Mon Sep 17 00:00:00 2001 From: MahmoudAshraf97 Date: Thu, 7 Nov 2024 20:45:43 +0200 Subject: [PATCH 1/7] update action versions --- .github/workflows/ci.yml | 30 +++++++++++++++--------------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c6f376231..5f0368f79 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -21,7 +21,7 @@ jobs: backend: [mkl, dnnl] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -82,7 +82,7 @@ jobs: backend: [openblas] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -141,7 +141,7 @@ jobs: arch: arm64 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -150,7 +150,7 @@ jobs: name: Set up QEMU - name: Build wheels - uses: pypa/cibuildwheel@v2.16.5 + uses: pypa/cibuildwheel@v2.21.3 with: package-dir: python output-dir: python/wheelhouse @@ -168,7 +168,7 @@ jobs: CIBW_SKIP: pp* *-musllinux_* - name: Upload Python wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: python-wheels path: python/wheelhouse @@ -185,11 +185,11 @@ jobs: steps: - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Prepare test environment shell: bash @@ -197,7 +197,7 @@ jobs: ./python/tools/prepare_test_environment.sh - name: Download Python wheels - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: python-wheels @@ -222,10 +222,10 @@ jobs: runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 @@ -257,7 +257,7 @@ jobs: steps: - name: Download Python wheels - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: python-wheels @@ -272,7 +272,7 @@ jobs: build-and-push-docker-images: runs-on: ubuntu-20.04 steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 with: submodules: recursive @@ -299,15 +299,15 @@ jobs: needs: [check-python-style, build-python-wheels] steps: - - uses: actions/checkout@v3 + - uses: actions/checkout@v4 - name: Set up Python 3.8 - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: 3.8 - name: Download CTranslate2 wheels - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: python-wheels From ded37c8afe9b81a42f17e89a268c8bb1d4e35573 Mon Sep 17 00:00:00 2001 From: MahmoudAshraf97 Date: Thu, 7 Nov 2024 20:54:50 +0200 Subject: [PATCH 2/7] use more multi cpu in testing --- .github/workflows/ci.yml | 2 +- python/tests/requirements.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5f0368f79..f7adf41b1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -215,7 +215,7 @@ jobs: - name: Run tests shell: bash run: | - pytest -v python/tests/ + pytest -n auto -v python/tests/ check-python-style: diff --git a/python/tests/requirements.txt b/python/tests/requirements.txt index c5f4812a7..80ae88797 100644 --- a/python/tests/requirements.txt +++ b/python/tests/requirements.txt @@ -4,5 +4,6 @@ OpenNMT-py==2.2.*;platform_system=='Linux' or platform_system=='Darwin' OpenNMT-tf==2.30.* tensorflow-cpu==2.11.* pytest +pytest-xdist wurlitzer==3.0.*;platform_system=='Linux' torch==2.2.0 From feef427796d925920cf696edce5a902596c7445a Mon Sep 17 00:00:00 2001 From: Mahmoud Ashraf Date: Thu, 7 Nov 2024 22:08:31 +0200 Subject: [PATCH 3/7] fix uploading and downloading artifacts --- .github/workflows/ci.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f7adf41b1..b13acf90c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,7 +170,7 @@ jobs: - name: Upload Python wheels uses: actions/upload-artifact@v4 with: - name: python-wheels + name: python-wheels-${{ matrix.os }}-${{ matrix.arch }} path: python/wheelhouse @@ -199,7 +199,8 @@ jobs: - name: Download Python wheels uses: actions/download-artifact@v4 with: - name: python-wheels + name: python-wheels-* + merge-multiple: true - name: Install wheel if: startsWith(matrix.os, 'ubuntu') From ea7d2114f9c3b2d562ee358eefdd3ab7334b43d9 Mon Sep 17 00:00:00 2001 From: Mahmoud Ashraf Date: Thu, 7 Nov 2024 22:18:06 +0200 Subject: [PATCH 4/7] more fixes to download artifacts --- .github/workflows/ci.yml | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b13acf90c..58a31abbe 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -199,8 +199,9 @@ jobs: - name: Download Python wheels uses: actions/download-artifact@v4 with: - name: python-wheels-* + pattern: python-wheels-${{ matrix.os }}-* merge-multiple: true + path: . - name: Install wheel if: startsWith(matrix.os, 'ubuntu') @@ -260,7 +261,9 @@ jobs: - name: Download Python wheels uses: actions/download-artifact@v4 with: - name: python-wheels + pattern: python-wheels-* + merge-multiple: true + path: . - name: Publish Python wheels to PyPI uses: pypa/gh-action-pypi-publish@release/v1 @@ -310,7 +313,9 @@ jobs: - name: Download CTranslate2 wheels uses: actions/download-artifact@v4 with: - name: python-wheels + pattern: python-wheels-* + merge-multiple: true + path: . - name: Install CTranslate2 wheel run: | From 2a3cc02681bd8da79ea9f79153867382d6036629 Mon Sep 17 00:00:00 2001 From: Mahmoud Ashraf Date: Fri, 8 Nov 2024 01:56:07 +0300 Subject: [PATCH 5/7] upgrade `macos` to 13 --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58a31abbe..64fecfad7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -137,7 +137,7 @@ jobs: include: - os: ubuntu-20.04 arch: aarch64 - - os: macos-12 + - os: macos-13 arch: arm64 steps: From 3757355ff5f3189781027370e516aa5464763ace Mon Sep 17 00:00:00 2001 From: MahmoudAshraf97 Date: Fri, 8 Nov 2024 12:43:16 +0200 Subject: [PATCH 6/7] remove `xdist` --- .github/workflows/ci.yml | 2 +- python/tests/requirements.txt | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 64fecfad7..58e139136 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -217,7 +217,7 @@ jobs: - name: Run tests shell: bash run: | - pytest -n auto -v python/tests/ + pytest -v python/tests/ check-python-style: diff --git a/python/tests/requirements.txt b/python/tests/requirements.txt index 80ae88797..c5f4812a7 100644 --- a/python/tests/requirements.txt +++ b/python/tests/requirements.txt @@ -4,6 +4,5 @@ OpenNMT-py==2.2.*;platform_system=='Linux' or platform_system=='Darwin' OpenNMT-tf==2.30.* tensorflow-cpu==2.11.* pytest -pytest-xdist wurlitzer==3.0.*;platform_system=='Linux' torch==2.2.0 From 4f255c70689bbbac6573e4fe07fb6506c3230ab8 Mon Sep 17 00:00:00 2001 From: MahmoudAshraf97 Date: Fri, 8 Nov 2024 12:49:09 +0200 Subject: [PATCH 7/7] better artifact names --- .github/workflows/ci.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 58e139136..82fcfe6d2 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -170,7 +170,7 @@ jobs: - name: Upload Python wheels uses: actions/upload-artifact@v4 with: - name: python-wheels-${{ matrix.os }}-${{ matrix.arch }} + name: python-wheels-${{ runner.os }}-${{ matrix.arch }} path: python/wheelhouse @@ -199,7 +199,7 @@ jobs: - name: Download Python wheels uses: actions/download-artifact@v4 with: - pattern: python-wheels-${{ matrix.os }}-* + pattern: python-wheels-${{ runner.os }}-* merge-multiple: true path: . @@ -313,7 +313,7 @@ jobs: - name: Download CTranslate2 wheels uses: actions/download-artifact@v4 with: - pattern: python-wheels-* + pattern: python-wheels-${{ runner.os }}-* merge-multiple: true path: .