diff --git a/.github/workflows/build-act-wheels.yml b/.github/workflows/build-act-wheels.yml deleted file mode 100644 index b85f151a89..0000000000 --- a/.github/workflows/build-act-wheels.yml +++ /dev/null @@ -1,577 +0,0 @@ -name: build-act-wheels -'on': - workflow_dispatch: - inputs: - name: - type: string - description: Pkg to build (empty for all) - required: false - graalpy: - type: string - description: GraalPy download url prefix (empty for default) - required: false -jobs: - numpy-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y gcc-toolset-12-gcc-gfortran openblas-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-linux-amd64 - path: numpy*.whl - if-no-files-found: error - numpy-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y gcc-toolset-12-gcc-gfortran openblas-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-linux-aarch64 - path: numpy*.whl - if-no-files-found: error - numpy-macos-amd64: - runs-on: macos-12 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install gcc openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-macos-amd64 - path: numpy*.whl - if-no-files-found: error - numpy-macos-aarch64: - runs-on: macos-latest - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install gcc openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-macos-aarch64 - path: numpy*.whl - if-no-files-found: error - PyYAML-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: numpy-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-linux-amd64 - path: PyYAML*.whl - if-no-files-found: error - PyYAML-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: numpy-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-linux-aarch64 - path: PyYAML*.whl - if-no-files-found: error - PyYAML-macos-amd64: - runs-on: macos-12 - needs: numpy-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-macos-amd64 - path: PyYAML*.whl - if-no-files-found: error - PyYAML-macos-aarch64: - runs-on: macos-latest - needs: numpy-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-macos-aarch64 - path: PyYAML*.whl - if-no-files-found: error - PyYAML-windows-amd64: - runs-on: windows-latest - needs: numpy-windows-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip -OutFile patch.zip - Expand-Archive patch.zip -DestinationPath ../patch -Force - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest ${{ inputs.graalpy }}-windows-amd64.zip -OutFile graalpy-windows-amd64.zip - Expand-Archive graalpy-windows-amd64.zip - mv graalpy-windows-amd64/* graalpy - graalpy/bin/graalpy.exe -s -m ensurepip - graalpy/bin/graalpy.exe -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-windows-amd64 - - name: Build wheel - run: |- - $env:PIP_FIND_LINKS=$PWD - $env:PATH+=";$PWD\graalpy\bin;$PWD\graalpy\Scripts;$PWD\..\patch\bin" - graalpy/bin/graalpy -m pip wheel --find-links $PWD PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-windows-amd64 - path: PyYAML*.whl - if-no-files-found: error - ujson-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: PyYAML-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ujson - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ujson-linux-amd64 - path: ujson*.whl - if-no-files-found: error - ujson-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: PyYAML-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ujson - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ujson-linux-aarch64 - path: ujson*.whl - if-no-files-found: error - ujson-macos-amd64: - runs-on: macos-12 - needs: PyYAML-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ujson - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ujson-macos-amd64 - path: ujson*.whl - if-no-files-found: error - ujson-macos-aarch64: - runs-on: macos-latest - needs: PyYAML-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ujson - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ujson-macos-aarch64 - path: ujson*.whl - if-no-files-found: error diff --git a/.github/workflows/build-linux-aarch64-wheels.yml b/.github/workflows/build-linux-aarch64-wheels.yml index c5ab981b23..d35b84cbeb 100644 --- a/.github/workflows/build-linux-aarch64-wheels.yml +++ b/.github/workflows/build-linux-aarch64-wheels.yml @@ -2,946 +2,42 @@ name: build-linux-aarch64-wheels 'on': workflow_dispatch: inputs: - name: + packages: type: string - description: Pkg to build (empty for all) + description: Pkgs to build (comma-separated, empty for all) required: false - graalpy: + graalpy_url: type: string - description: GraalPy download url prefix (empty for default) - required: false + description: GraalPy download url + required: true jobs: - psutil-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'psutil') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) psutil - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: psutil-linux-aarch64 - path: psutil*.whl - if-no-files-found: error - numpy-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: psutil-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy' || inputs.name - == 'pandas' || inputs.name == 'contourpy' || inputs.name == 'matplotlib' || - inputs.name == 'scipy' || inputs.name == 'scikit-learn' || inputs.name == 'torch') - }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y gcc-toolset-12-gcc-gfortran openblas-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from psutil - uses: actions/download-artifact@main - continue-on-error: true - with: - name: psutil-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-linux-aarch64 - path: numpy*.whl - if-no-files-found: error - pandas-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: numpy-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pandas') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pandas - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pandas-linux-aarch64 - path: pandas*.whl - if-no-files-found: error - pybind11-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: pandas-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pybind11' || inputs.name - == 'contourpy' || inputs.name == 'kiwisolver' || inputs.name == 'torch' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pandas - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pandas-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pybind11 - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pybind11-linux-aarch64 - path: pybind11*.whl - if-no-files-found: error - ninja-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: pybind11-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ninja' || inputs.name - == 'contourpy' || inputs.name == 'torch' || inputs.name == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ninja - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ninja-linux-aarch64 - path: ninja*.whl - if-no-files-found: error - pillow-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: ninja-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pillow' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel freetype-devel lcms2-devel libwebp-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pillow - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pillow-linux-aarch64 - path: pillow*.whl - if-no-files-found: error - contourpy-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: - - ninja-linux-aarch64 - - pybind11-linux-aarch64 - - numpy-linux-aarch64 - - pillow-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'contourpy' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-linux-aarch64 - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-linux-aarch64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-aarch64 - - name: Download artifacts from pillow - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pillow-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) contourpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: contourpy-linux-aarch64 - path: contourpy*.whl - if-no-files-found: error - kiwisolver-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: - - pybind11-linux-aarch64 - - contourpy-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'kiwisolver' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-linux-aarch64 - - name: Download artifacts from contourpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: contourpy-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) kiwisolver - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: kiwisolver-linux-aarch64 - path: kiwisolver*.whl - if-no-files-found: error - matplotlib-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: - - pillow-linux-aarch64 - - kiwisolver-linux-aarch64 - - numpy-linux-aarch64 - - contourpy-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pillow - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pillow-linux-aarch64 - - name: Download artifacts from kiwisolver - uses: actions/download-artifact@main - continue-on-error: true - with: - name: kiwisolver-linux-aarch64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-aarch64 - - name: Download artifacts from contourpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: contourpy-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) matplotlib - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: matplotlib-linux-aarch64 - path: matplotlib*.whl - if-no-files-found: error - scipy-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: - - numpy-linux-aarch64 - - matplotlib-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'scipy' || inputs.name - == 'scikit-learn') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y gcc-toolset-12-gcc-gfortran openblas-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-aarch64 - - name: Download artifacts from matplotlib - uses: actions/download-artifact@main - continue-on-error: true - with: - name: matplotlib-linux-aarch64 - - name: Build wheel - run: |- - export FFLAGS=-fallow-argument-mismatch - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) scipy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: scipy-linux-aarch64 - path: scipy*.whl - if-no-files-found: error - scikit-learn-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: - - numpy-linux-aarch64 - - scipy-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'scikit-learn') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-aarch64 - - name: Download artifacts from scipy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: scipy-linux-aarch64 - - name: Build wheel - run: |- - export FFLAGS=-fallow-argument-mismatch - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) scikit-learn - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: scikit-learn-linux-aarch64 - path: scikit*learn*.whl - if-no-files-found: error - cffi-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: scikit-learn-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'cffi' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y libffi-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from scikit-learn - uses: actions/download-artifact@main - continue-on-error: true - with: - name: scikit-learn-linux-aarch64 - - name: Build wheel - run: |- - graalpy/bin/graalpy -m pip install wheel - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) cffi - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: cffi-linux-aarch64 - path: cffi*.whl - if-no-files-found: error - PyYAML-linux-aarch64: + build_wheels: runs-on: - self-hosted - Linux - ARM64 container: quay.io/pypa/manylinux_2_28_aarch64 - needs: cffi-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from cffi - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cffi-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-linux-aarch64 - path: PyYAML*.whl - if-no-files-found: error - cmake-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: PyYAML-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'cmake' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) cmake - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: cmake-linux-aarch64 - path: cmake*.whl - if-no-files-found: error - ujson-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: cmake-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from cmake - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cmake-linux-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ujson - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ujson-linux-aarch64 - path: ujson*.whl - if-no-files-found: error - torch-linux-aarch64: - runs-on: - - self-hosted - - Linux - - ARM64 - container: quay.io/pypa/manylinux_2_28_aarch64 - needs: - - numpy-linux-aarch64 - - ninja-linux-aarch64 - - cmake-linux-aarch64 - - pybind11-linux-aarch64 - - cffi-linux-aarch64 - - PyYAML-linux-aarch64 - - ujson-linux-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'torch') }} env: - MAX_JOBS: 4 - BUILD_TEST: 0 + PACKAGES_TO_BUILD: ${{ inputs.packages }} steps: - - uses: ilammy/msvc-dev-cmd@v1 - name: Install dependencies - run: |- + run: | dnf install -y epel-release crb enable dnf makecache --refresh dnf module install -y nodejs:18 dnf install -y /usr/bin/patch - dnf install -y openblas-devel /usr/bin/cmake /usr/bin/sudo libffi-devel - name: Checkout uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy + - name: Setup Python uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-aarch64 - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-linux-aarch64 - - name: Download artifacts from cmake - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cmake-linux-aarch64 - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-linux-aarch64 - - name: Download artifacts from cffi - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cffi-linux-aarch64 - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-linux-aarch64 - - name: Download artifacts from ujson - uses: actions/download-artifact@main - continue-on-error: true with: - name: ujson-linux-aarch64 - - name: Build wheel - run: |- - export USE_CUDA=0 - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) torch + python-version: 3.12 + - name: Build wheels + run: python3 scripts/wheelbuilder/build_wheels.py ${{ inputs.graalpy_url }} - name: Store wheels uses: actions/upload-artifact@main with: - name: torch-linux-aarch64 - path: torch*.whl + name: wheels + path: wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-linux-amd64-wheels.yml b/.github/workflows/build-linux-amd64-wheels.yml index ee070f604b..9aab57bcbc 100644 --- a/.github/workflows/build-linux-amd64-wheels.yml +++ b/.github/workflows/build-linux-amd64-wheels.yml @@ -2,969 +2,24 @@ name: build-linux-amd64-wheels 'on': workflow_dispatch: inputs: - name: + packages: type: string - description: Pkg to build (empty for all) + description: Pkgs to build (comma-separated, empty for all) required: false - graalpy: + graalpy_url: type: string - description: GraalPy download url prefix (empty for default) - required: false + description: GraalPy download url + required: true jobs: - psutil-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'psutil' || inputs.name - == 'tensorflow') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) psutil - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: psutil-linux-amd64 - path: psutil*.whl - if-no-files-found: error - numpy-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: psutil-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy' || inputs.name - == 'pandas' || inputs.name == 'contourpy' || inputs.name == 'matplotlib' || - inputs.name == 'scipy' || inputs.name == 'scikit-learn' || inputs.name == 'torch' - || inputs.name == 'opt_einsum' || inputs.name == 'Keras_Preprocessing' || inputs.name - == 'tensorflow') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y gcc-toolset-12-gcc-gfortran openblas-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from psutil - uses: actions/download-artifact@main - continue-on-error: true - with: - name: psutil-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-linux-amd64 - path: numpy*.whl - if-no-files-found: error - pandas-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: numpy-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pandas') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pandas - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pandas-linux-amd64 - path: pandas*.whl - if-no-files-found: error - pybind11-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: pandas-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pybind11' || inputs.name - == 'contourpy' || inputs.name == 'kiwisolver' || inputs.name == 'torch' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pandas - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pandas-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pybind11 - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pybind11-linux-amd64 - path: pybind11*.whl - if-no-files-found: error - ninja-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: pybind11-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ninja' || inputs.name - == 'contourpy' || inputs.name == 'torch' || inputs.name == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ninja - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ninja-linux-amd64 - path: ninja*.whl - if-no-files-found: error - pillow-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: ninja-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pillow' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel freetype-devel lcms2-devel libwebp-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pillow - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pillow-linux-amd64 - path: pillow*.whl - if-no-files-found: error - contourpy-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - ninja-linux-amd64 - - pybind11-linux-amd64 - - numpy-linux-amd64 - - pillow-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'contourpy' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-linux-amd64 - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-linux-amd64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Download artifacts from pillow - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pillow-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) contourpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: contourpy-linux-amd64 - path: contourpy*.whl - if-no-files-found: error - kiwisolver-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - pybind11-linux-amd64 - - contourpy-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'kiwisolver' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-linux-amd64 - - name: Download artifacts from contourpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: contourpy-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) kiwisolver - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: kiwisolver-linux-amd64 - path: kiwisolver*.whl - if-no-files-found: error - matplotlib-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - pillow-linux-amd64 - - kiwisolver-linux-amd64 - - numpy-linux-amd64 - - contourpy-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pillow - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pillow-linux-amd64 - - name: Download artifacts from kiwisolver - uses: actions/download-artifact@main - continue-on-error: true - with: - name: kiwisolver-linux-amd64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Download artifacts from contourpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: contourpy-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) matplotlib - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: matplotlib-linux-amd64 - path: matplotlib*.whl - if-no-files-found: error - scipy-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - numpy-linux-amd64 - - matplotlib-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'scipy' || inputs.name - == 'scikit-learn') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y gcc-toolset-12-gcc-gfortran openblas-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Download artifacts from matplotlib - uses: actions/download-artifact@main - continue-on-error: true - with: - name: matplotlib-linux-amd64 - - name: Build wheel - run: |- - export FFLAGS=-fallow-argument-mismatch - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) scipy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: scipy-linux-amd64 - path: scipy*.whl - if-no-files-found: error - scikit-learn-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - numpy-linux-amd64 - - scipy-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'scikit-learn') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Download artifacts from scipy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: scipy-linux-amd64 - - name: Build wheel - run: |- - export FFLAGS=-fallow-argument-mismatch - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) scikit-learn - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: scikit-learn-linux-amd64 - path: scikit*learn*.whl - if-no-files-found: error - cffi-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: scikit-learn-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'cffi' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y libffi-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from scikit-learn - uses: actions/download-artifact@main - continue-on-error: true - with: - name: scikit-learn-linux-amd64 - - name: Build wheel - run: |- - graalpy/bin/graalpy -m pip install wheel - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) cffi - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: cffi-linux-amd64 - path: cffi*.whl - if-no-files-found: error - PyYAML-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: cffi-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from cffi - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cffi-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-linux-amd64 - path: PyYAML*.whl - if-no-files-found: error - cmake-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: PyYAML-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'cmake' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) cmake - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: cmake-linux-amd64 - path: cmake*.whl - if-no-files-found: error - ujson-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: cmake-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from cmake - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cmake-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ujson - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ujson-linux-amd64 - path: ujson*.whl - if-no-files-found: error - torch-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - numpy-linux-amd64 - - ninja-linux-amd64 - - cmake-linux-amd64 - - pybind11-linux-amd64 - - cffi-linux-amd64 - - PyYAML-linux-amd64 - - ujson-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'torch') }} + build_wheels: + runs-on: + - self-hosted + - Linux + - ARM64 + container: quay.io/pypa/manylinux_2_28_amd64 env: - MAX_JOBS: 4 - BUILD_TEST: 0 - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y openblas-devel /usr/bin/cmake /usr/bin/sudo libffi-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-linux-amd64 - - name: Download artifacts from cmake - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cmake-linux-amd64 - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-linux-amd64 - - name: Download artifacts from cffi - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cffi-linux-amd64 - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-linux-amd64 - - name: Download artifacts from ujson - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ujson-linux-amd64 - - name: Build wheel - run: |- - export USE_CUDA=0 - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) torch - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: torch-linux-amd64 - path: torch*.whl - if-no-files-found: error - opt_einsum-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - numpy-linux-amd64 - - torch-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'opt_einsum' || inputs.name - == 'tensorflow') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Download artifacts from torch - uses: actions/download-artifact@main - continue-on-error: true - with: - name: torch-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) opt_einsum - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: opt_einsum-linux-amd64 - path: opt*einsum*.whl - if-no-files-found: error - Keras_Preprocessing-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - numpy-linux-amd64 - - opt_einsum-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'Keras_Preprocessing' - || inputs.name == 'tensorflow') }} + PACKAGES_TO_BUILD: ${{ inputs.packages }} steps: - - uses: ilammy/msvc-dev-cmd@v1 - name: Install dependencies run: | dnf install -y epel-release @@ -974,336 +29,15 @@ jobs: dnf install -y /usr/bin/patch - name: Checkout uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy + - name: Setup Python uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Download artifacts from opt_einsum - uses: actions/download-artifact@main - continue-on-error: true - with: - name: opt_einsum-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) Keras_Preprocessing - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: Keras_Preprocessing-linux-amd64 - path: Keras*Preprocessing*.whl - if-no-files-found: error - grpcio-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: Keras_Preprocessing-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'grpcio' || inputs.name - == 'tensorflow') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from Keras_Preprocessing - uses: actions/download-artifact@main - continue-on-error: true - with: - name: Keras_Preprocessing-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) grpcio - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: grpcio-linux-amd64 - path: grpcio*.whl - if-no-files-found: error - ml_dtypes-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: grpcio-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ml_dtypes' || inputs.name - == 'tensorflow') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from grpcio - uses: actions/download-artifact@main - continue-on-error: true - with: - name: grpcio-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ml_dtypes - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ml_dtypes-linux-amd64 - path: ml*dtypes*.whl - if-no-files-found: error - wrapt-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: ml_dtypes-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'wrapt' || inputs.name - == 'tensorflow') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ml_dtypes - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ml_dtypes-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) wrapt - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: wrapt-linux-amd64 - path: wrapt*.whl - if-no-files-found: error - h5py-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: wrapt-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'h5py' || inputs.name - == 'tensorflow') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y hdf5-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from wrapt - uses: actions/download-artifact@main - continue-on-error: true - with: - name: wrapt-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) h5py - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: h5py-linux-amd64 - path: h5py*.whl - if-no-files-found: error - tensorflow-linux-amd64: - runs-on: ubuntu-latest - container: quay.io/pypa/manylinux_2_28_x86_64 - needs: - - grpcio-linux-amd64 - - psutil-linux-amd64 - - wrapt-linux-amd64 - - ml_dtypes-linux-amd64 - - h5py-linux-amd64 - - numpy-linux-amd64 - - opt_einsum-linux-amd64 - - Keras_Preprocessing-linux-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'tensorflow') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: |- - dnf install -y epel-release - crb enable - dnf makecache --refresh - dnf module install -y nodejs:18 - dnf install -y /usr/bin/patch - dnf install -y openblas-devel /usr/bin/cmake /usr/bin/sudo /usr/bin/curl java-11-openjdk-devel - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-linux-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from grpcio - uses: actions/download-artifact@main - continue-on-error: true - with: - name: grpcio-linux-amd64 - - name: Download artifacts from psutil - uses: actions/download-artifact@main - continue-on-error: true - with: - name: psutil-linux-amd64 - - name: Download artifacts from wrapt - uses: actions/download-artifact@main - continue-on-error: true - with: - name: wrapt-linux-amd64 - - name: Download artifacts from ml_dtypes - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ml_dtypes-linux-amd64 - - name: Download artifacts from h5py - uses: actions/download-artifact@main - continue-on-error: true - with: - name: h5py-linux-amd64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-linux-amd64 - - name: Download artifacts from opt_einsum - uses: actions/download-artifact@main - continue-on-error: true - with: - name: opt_einsum-linux-amd64 - - name: Download artifacts from Keras_Preprocessing - uses: actions/download-artifact@main - continue-on-error: true with: - name: Keras_Preprocessing-linux-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - pip install pip numpy wheel packaging requests opt_einsum - pip install keras_preprocessing --no-deps - curl -L https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-x86_64 -o $(pwd)/graalpy/bin/bazel - chmod +x graalpy/bin/bazel - export PATH=$(pwd)/graalpy/bin/:$PATH - bazel --version - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) tensorflow + python-version: 3.12 + - name: Build wheels + run: python3 scripts/wheelbuilder/build_wheels.py ${{ inputs.graalpy_url }} - name: Store wheels uses: actions/upload-artifact@main with: - name: tensorflow-linux-amd64 - path: tensorflow*.whl + name: wheels + path: wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-macos-aarch64-wheels.yml b/.github/workflows/build-macos-aarch64-wheels.yml index f69141f605..7275d62b62 100644 --- a/.github/workflows/build-macos-aarch64-wheels.yml +++ b/.github/workflows/build-macos-aarch64-wheels.yml @@ -1,782 +1,32 @@ -name: build-macos-aarch64-wheels +name: build-macos-amd64-wheels 'on': workflow_dispatch: inputs: - name: + packages: type: string - description: Pkg to build (empty for all) + description: Pkgs to build (comma-separated, empty for all) required: false - graalpy: + graalpy_url: type: string - description: GraalPy download url prefix (empty for default) - required: false + description: GraalPy download url + required: true jobs: - psutil-macos-aarch64: - runs-on: macos-latest - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'psutil') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) psutil - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: psutil-macos-aarch64 - path: psutil*.whl - if-no-files-found: error - numpy-macos-aarch64: - runs-on: macos-latest - needs: psutil-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy' || inputs.name - == 'pandas' || inputs.name == 'contourpy' || inputs.name == 'matplotlib' || - inputs.name == 'scipy' || inputs.name == 'scikit-learn' || inputs.name == 'torch') - }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install gcc openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from psutil - uses: actions/download-artifact@main - continue-on-error: true - with: - name: psutil-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-macos-aarch64 - path: numpy*.whl - if-no-files-found: error - pandas-macos-aarch64: - runs-on: macos-latest - needs: numpy-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pandas') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pandas - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pandas-macos-aarch64 - path: pandas*.whl - if-no-files-found: error - pybind11-macos-aarch64: - runs-on: macos-latest - needs: pandas-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pybind11' || inputs.name - == 'contourpy' || inputs.name == 'kiwisolver' || inputs.name == 'torch' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pandas - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pandas-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pybind11 - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pybind11-macos-aarch64 - path: pybind11*.whl - if-no-files-found: error - ninja-macos-aarch64: - runs-on: macos-latest - needs: pybind11-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ninja' || inputs.name - == 'contourpy' || inputs.name == 'torch' || inputs.name == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ninja - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ninja-macos-aarch64 - path: ninja*.whl - if-no-files-found: error - pillow-macos-aarch64: - runs-on: macos-latest - needs: ninja-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pillow' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install libjpeg libtiff little-cms2 openjpeg webp - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pillow - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pillow-macos-aarch64 - path: pillow*.whl - if-no-files-found: error - contourpy-macos-aarch64: - runs-on: macos-latest - needs: - - ninja-macos-aarch64 - - pybind11-macos-aarch64 - - numpy-macos-aarch64 - - pillow-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'contourpy' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-macos-aarch64 - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-macos-aarch64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-aarch64 - - name: Download artifacts from pillow - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pillow-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) contourpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: contourpy-macos-aarch64 - path: contourpy*.whl - if-no-files-found: error - kiwisolver-macos-aarch64: - runs-on: macos-latest - needs: - - pybind11-macos-aarch64 - - contourpy-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'kiwisolver' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-macos-aarch64 - - name: Download artifacts from contourpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: contourpy-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) kiwisolver - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: kiwisolver-macos-aarch64 - path: kiwisolver*.whl - if-no-files-found: error - matplotlib-macos-aarch64: - runs-on: macos-latest - needs: - - pillow-macos-aarch64 - - kiwisolver-macos-aarch64 - - numpy-macos-aarch64 - - contourpy-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pillow - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pillow-macos-aarch64 - - name: Download artifacts from kiwisolver - uses: actions/download-artifact@main - continue-on-error: true - with: - name: kiwisolver-macos-aarch64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-aarch64 - - name: Download artifacts from contourpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: contourpy-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) matplotlib - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: matplotlib-macos-aarch64 - path: matplotlib*.whl - if-no-files-found: error - scipy-macos-aarch64: - runs-on: macos-latest - needs: - - numpy-macos-aarch64 - - matplotlib-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'scipy' || inputs.name - == 'scikit-learn') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install gcc openblas pkg-config - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-aarch64 - - name: Download artifacts from matplotlib - uses: actions/download-artifact@main - continue-on-error: true - with: - name: matplotlib-macos-aarch64 - - name: Build wheel - run: |- - export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig - export FFLAGS=-fallow-argument-mismatch - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) scipy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: scipy-macos-aarch64 - path: scipy*.whl - if-no-files-found: error - scikit-learn-macos-aarch64: - runs-on: macos-latest - needs: - - numpy-macos-aarch64 - - scipy-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'scikit-learn') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-aarch64 - - name: Download artifacts from scipy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: scipy-macos-aarch64 - - name: Build wheel - run: |- - export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig - export FFLAGS=-fallow-argument-mismatch - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) scikit-learn - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: scikit-learn-macos-aarch64 - path: scikit*learn*.whl - if-no-files-found: error - cffi-macos-aarch64: - runs-on: macos-latest - needs: scikit-learn-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'cffi' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install libffi - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from scikit-learn - uses: actions/download-artifact@main - continue-on-error: true - with: - name: scikit-learn-macos-aarch64 - - name: Build wheel - run: |- - graalpy/bin/graalpy -m pip install wheel - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) cffi - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: cffi-macos-aarch64 - path: cffi*.whl - if-no-files-found: error - PyYAML-macos-aarch64: - runs-on: macos-latest - needs: cffi-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from cffi - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cffi-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-macos-aarch64 - path: PyYAML*.whl - if-no-files-found: error - cmake-macos-aarch64: - runs-on: macos-latest - needs: PyYAML-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'cmake' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) cmake - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: cmake-macos-aarch64 - path: cmake*.whl - if-no-files-found: error - ujson-macos-aarch64: - runs-on: macos-latest - needs: cmake-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from cmake - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cmake-macos-aarch64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ujson - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ujson-macos-aarch64 - path: ujson*.whl - if-no-files-found: error - torch-macos-aarch64: - runs-on: macos-latest - needs: - - numpy-macos-aarch64 - - ninja-macos-aarch64 - - cmake-macos-aarch64 - - pybind11-macos-aarch64 - - cffi-macos-aarch64 - - PyYAML-macos-aarch64 - - ujson-macos-aarch64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'torch') }} + build_wheels: + runs-on: macos-12 env: - MAX_JOBS: 4 - BUILD_TEST: 0 + PACKAGES_TO_BUILD: ${{ inputs.packages }} steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install openblas cmake libffi - name: Checkout uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-aarch64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy + - name: Setup Python uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-aarch64 - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-macos-aarch64 - - name: Download artifacts from cmake - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cmake-macos-aarch64 - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-macos-aarch64 - - name: Download artifacts from cffi - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cffi-macos-aarch64 - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-macos-aarch64 - - name: Download artifacts from ujson - uses: actions/download-artifact@main - continue-on-error: true with: - name: ujson-macos-aarch64 - - name: Build wheel - run: |- - export USE_CUDA=0 - export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) torch + python-version: 3.12 + - name: Build wheels + run: python3 scripts/wheelbuilder/build_wheels.py ${{ inputs.graalpy_url }} - name: Store wheels uses: actions/upload-artifact@main with: - name: torch-macos-aarch64 - path: torch*.whl + name: wheels + path: wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-macos-amd64-wheels.yml b/.github/workflows/build-macos-amd64-wheels.yml index 1ba8c2ee49..7275d62b62 100644 --- a/.github/workflows/build-macos-amd64-wheels.yml +++ b/.github/workflows/build-macos-amd64-wheels.yml @@ -2,781 +2,31 @@ name: build-macos-amd64-wheels 'on': workflow_dispatch: inputs: - name: + packages: type: string - description: Pkg to build (empty for all) + description: Pkgs to build (comma-separated, empty for all) required: false - graalpy: + graalpy_url: type: string - description: GraalPy download url prefix (empty for default) - required: false + description: GraalPy download url + required: true jobs: - psutil-macos-amd64: - runs-on: macos-12 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'psutil') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) psutil - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: psutil-macos-amd64 - path: psutil*.whl - if-no-files-found: error - numpy-macos-amd64: - runs-on: macos-12 - needs: psutil-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy' || inputs.name - == 'pandas' || inputs.name == 'contourpy' || inputs.name == 'matplotlib' || - inputs.name == 'scipy' || inputs.name == 'scikit-learn' || inputs.name == 'torch') - }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install gcc openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from psutil - uses: actions/download-artifact@main - continue-on-error: true - with: - name: psutil-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-macos-amd64 - path: numpy*.whl - if-no-files-found: error - pandas-macos-amd64: - runs-on: macos-12 - needs: numpy-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pandas') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pandas - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pandas-macos-amd64 - path: pandas*.whl - if-no-files-found: error - pybind11-macos-amd64: + build_wheels: runs-on: macos-12 - needs: pandas-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pybind11' || inputs.name - == 'contourpy' || inputs.name == 'kiwisolver' || inputs.name == 'torch' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pandas - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pandas-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pybind11 - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pybind11-macos-amd64 - path: pybind11*.whl - if-no-files-found: error - ninja-macos-amd64: - runs-on: macos-12 - needs: pybind11-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ninja' || inputs.name - == 'contourpy' || inputs.name == 'torch' || inputs.name == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ninja - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ninja-macos-amd64 - path: ninja*.whl - if-no-files-found: error - pillow-macos-amd64: - runs-on: macos-12 - needs: ninja-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'pillow' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install libjpeg libtiff little-cms2 openjpeg webp - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) pillow - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: pillow-macos-amd64 - path: pillow*.whl - if-no-files-found: error - contourpy-macos-amd64: - runs-on: macos-12 - needs: - - ninja-macos-amd64 - - pybind11-macos-amd64 - - numpy-macos-amd64 - - pillow-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'contourpy' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-macos-amd64 - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-macos-amd64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-amd64 - - name: Download artifacts from pillow - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pillow-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) contourpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: contourpy-macos-amd64 - path: contourpy*.whl - if-no-files-found: error - kiwisolver-macos-amd64: - runs-on: macos-12 - needs: - - pybind11-macos-amd64 - - contourpy-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'kiwisolver' || inputs.name - == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-macos-amd64 - - name: Download artifacts from contourpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: contourpy-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) kiwisolver - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: kiwisolver-macos-amd64 - path: kiwisolver*.whl - if-no-files-found: error - matplotlib-macos-amd64: - runs-on: macos-12 - needs: - - pillow-macos-amd64 - - kiwisolver-macos-amd64 - - numpy-macos-amd64 - - contourpy-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'matplotlib') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from pillow - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pillow-macos-amd64 - - name: Download artifacts from kiwisolver - uses: actions/download-artifact@main - continue-on-error: true - with: - name: kiwisolver-macos-amd64 - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-amd64 - - name: Download artifacts from contourpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: contourpy-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) matplotlib - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: matplotlib-macos-amd64 - path: matplotlib*.whl - if-no-files-found: error - scipy-macos-amd64: - runs-on: macos-12 - needs: - - numpy-macos-amd64 - - matplotlib-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'scipy' || inputs.name - == 'scikit-learn') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install gcc openblas pkg-config - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-amd64 - - name: Download artifacts from matplotlib - uses: actions/download-artifact@main - continue-on-error: true - with: - name: matplotlib-macos-amd64 - - name: Build wheel - run: |- - export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig - export FFLAGS=-fallow-argument-mismatch - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) scipy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: scipy-macos-amd64 - path: scipy*.whl - if-no-files-found: error - scikit-learn-macos-amd64: - runs-on: macos-12 - needs: - - numpy-macos-amd64 - - scipy-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'scikit-learn') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install openblas - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-amd64 - - name: Download artifacts from scipy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: scipy-macos-amd64 - - name: Build wheel - run: |- - export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig - export FFLAGS=-fallow-argument-mismatch - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) scikit-learn - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: scikit-learn-macos-amd64 - path: scikit*learn*.whl - if-no-files-found: error - cffi-macos-amd64: - runs-on: macos-12 - needs: scikit-learn-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'cffi' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install libffi - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from scikit-learn - uses: actions/download-artifact@main - continue-on-error: true - with: - name: scikit-learn-macos-amd64 - - name: Build wheel - run: |- - graalpy/bin/graalpy -m pip install wheel - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) cffi - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: cffi-macos-amd64 - path: cffi*.whl - if-no-files-found: error - PyYAML-macos-amd64: - runs-on: macos-12 - needs: cffi-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from cffi - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cffi-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-macos-amd64 - path: PyYAML*.whl - if-no-files-found: error - cmake-macos-amd64: - runs-on: macos-12 - needs: PyYAML-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'cmake' || inputs.name - == 'torch') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) cmake - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: cmake-macos-amd64 - path: cmake*.whl - if-no-files-found: error - ujson-macos-amd64: - runs-on: macos-12 - needs: cmake-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from cmake - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cmake-macos-amd64 - - name: Build wheel - run: |- - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) ujson - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: ujson-macos-amd64 - path: ujson*.whl - if-no-files-found: error - torch-macos-amd64: - runs-on: macos-12 - needs: - - numpy-macos-amd64 - - ninja-macos-amd64 - - cmake-macos-amd64 - - pybind11-macos-amd64 - - cffi-macos-amd64 - - PyYAML-macos-amd64 - - ujson-macos-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'torch') }} env: - MAX_JOBS: 4 - BUILD_TEST: 0 + PACKAGES_TO_BUILD: ${{ inputs.packages }} steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: brew install openblas cmake libffi - name: Checkout uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - curl -L -o graalpy.tar.gz ${{ inputs.graalpy }}-macos-amd64.tar.gz - mkdir -p graalpy - tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz - graalpy/bin/graalpy -s -m ensurepip - graalpy/bin/graalpy -m pip install wheel - - name: Setup GraalPy + - name: Setup Python uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-macos-amd64 - - name: Download artifacts from ninja - uses: actions/download-artifact@main - continue-on-error: true - with: - name: ninja-macos-amd64 - - name: Download artifacts from cmake - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cmake-macos-amd64 - - name: Download artifacts from pybind11 - uses: actions/download-artifact@main - continue-on-error: true - with: - name: pybind11-macos-amd64 - - name: Download artifacts from cffi - uses: actions/download-artifact@main - continue-on-error: true - with: - name: cffi-macos-amd64 - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-macos-amd64 - - name: Download artifacts from ujson - uses: actions/download-artifact@main - continue-on-error: true with: - name: ujson-macos-amd64 - - name: Build wheel - run: |- - export USE_CUDA=0 - export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig - export PIP_FIND_LINKS=$(pwd) - export PATH=$(pwd)/graalpy/bin/:$PATH - graalpy/bin/graalpy -m pip wheel --find-links $(pwd) torch + python-version: 3.12 + - name: Build wheels + run: python3 scripts/wheelbuilder/build_wheels.py ${{ inputs.graalpy_url }} - name: Store wheels uses: actions/upload-artifact@main with: - name: torch-macos-amd64 - path: torch*.whl + name: wheels + path: wheelhouse/*.whl if-no-files-found: error diff --git a/.github/workflows/build-repository.yml b/.github/workflows/build-repository.yml deleted file mode 100644 index 942b814d88..0000000000 --- a/.github/workflows/build-repository.yml +++ /dev/null @@ -1,60 +0,0 @@ -name: build-repository -'on': workflow_dispatch -jobs: - build-repo: - runs-on: ubuntu-latest - steps: - - name: Checkout - uses: actions/checkout@v4 - - name: Download artifacts for linux-amd64 - uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e - continue-on-error: true - with: - workflow: build-linux-amd64-wheels.yml - workflow_conclusion: '' - if_no_artifact_found: warn - allow_forks: 'false' - - name: Download artifacts for linux-aarch64 - uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e - continue-on-error: true - with: - workflow: build-linux-aarch64-wheels.yml - workflow_conclusion: '' - if_no_artifact_found: warn - allow_forks: 'false' - - name: Download artifacts for macos-amd64 - uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e - continue-on-error: true - with: - workflow: build-macos-amd64-wheels.yml - workflow_conclusion: '' - if_no_artifact_found: warn - allow_forks: 'false' - - name: Download artifacts for macos-aarch64 - uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e - continue-on-error: true - with: - workflow: build-macos-aarch64-wheels.yml - workflow_conclusion: '' - if_no_artifact_found: warn - allow_forks: 'false' - - name: Download artifacts for windows-amd64 - uses: dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e - continue-on-error: true - with: - workflow: build-windows-amd64-wheels.yml - workflow_conclusion: '' - if_no_artifact_found: warn - allow_forks: 'false' - - name: Set up Python - uses: actions/setup-python@v5 - with: - python-version: '3.10' - - name: Create repository - run: python ${GITHUB_WORKSPACE}/scripts/wheelbuilder/generate_repository.py - - name: Store repository - uses: umutozd/upload-artifact@5c459179e7745e2c730c50b10a6459da0b6f25db - with: - name: repository - path: repository.zip - if-no-files-found: error diff --git a/.github/workflows/build-windows-amd64-wheels.yml b/.github/workflows/build-windows-amd64-wheels.yml index 00a18a2c40..0544499e65 100644 --- a/.github/workflows/build-windows-amd64-wheels.yml +++ b/.github/workflows/build-windows-amd64-wheels.yml @@ -2,141 +2,34 @@ name: build-windows-amd64-wheels 'on': workflow_dispatch: inputs: - name: + packages: type: string - description: Pkg to build (empty for all) + description: Pkgs to build (comma-separated, empty for all) required: false - graalpy: + graalpy_url: type: string - description: GraalPy download url prefix (empty for default) - required: false + description: GraalPy download url + required: true jobs: - numpy-windows-amd64: + build_wheels: runs-on: windows-latest - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'numpy') }} + env: + PACKAGES_TO_BUILD: ${{ inputs.packages }} steps: - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip -OutFile patch.zip - Expand-Archive patch.zip -DestinationPath ../patch -Force - name: Checkout uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest ${{ inputs.graalpy }}-windows-amd64.zip -OutFile graalpy-windows-amd64.zip - Expand-Archive graalpy-windows-amd64.zip - mv graalpy-windows-amd64/* graalpy - graalpy/bin/graalpy.exe -s -m ensurepip - graalpy/bin/graalpy.exe -m pip install wheel - - name: Setup GraalPy + - name: Setup Python uses: actions/setup-python@v5 - if: inputs.graalpy == '' with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Build wheel - run: |- - $env:PIP_FIND_LINKS=$PWD - $env:PATH+=";$PWD\graalpy\bin;$PWD\graalpy\Scripts;$PWD\..\patch\bin" - graalpy/bin/graalpy -m pip wheel --find-links $PWD numpy - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: numpy-windows-amd64 - path: numpy*.whl - if-no-files-found: error - PyYAML-windows-amd64: - runs-on: windows-latest - needs: numpy-windows-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'PyYAML') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies + python-version: 3.12 + - name: Build wheels run: | - Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip -OutFile patch.zip - Expand-Archive patch.zip -DestinationPath ../patch -Force - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest ${{ inputs.graalpy }}-windows-amd64.zip -OutFile graalpy-windows-amd64.zip - Expand-Archive graalpy-windows-amd64.zip - mv graalpy-windows-amd64/* graalpy - graalpy/bin/graalpy.exe -s -m ensurepip - graalpy/bin/graalpy.exe -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from numpy - uses: actions/download-artifact@main - continue-on-error: true - with: - name: numpy-windows-amd64 - - name: Build wheel - run: |- - $env:PIP_FIND_LINKS=$PWD - $env:PATH+=";$PWD\graalpy\bin;$PWD\graalpy\Scripts;$PWD\..\patch\bin" - graalpy/bin/graalpy -m pip wheel --find-links $PWD PyYAML - - name: Store wheels - uses: actions/upload-artifact@main - with: - name: PyYAML-windows-amd64 - path: PyYAML*.whl - if-no-files-found: error - ujson-windows-amd64: - runs-on: windows-latest - needs: PyYAML-windows-amd64 - if: ${{ !cancelled() && (inputs.name == '' || inputs.name == 'ujson') }} - steps: - - uses: ilammy/msvc-dev-cmd@v1 - - name: Install dependencies - run: | - Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip -OutFile patch.zip - Expand-Archive patch.zip -DestinationPath ../patch -Force - - name: Checkout - uses: actions/checkout@main - - name: Setup custom GraalPy - if: inputs.graalpy != '' - run: |- - $ProgressPreference = 'SilentlyContinue' - Invoke-WebRequest ${{ inputs.graalpy }}-windows-amd64.zip -OutFile graalpy-windows-amd64.zip - Expand-Archive graalpy-windows-amd64.zip - mv graalpy-windows-amd64/* graalpy - graalpy/bin/graalpy.exe -s -m ensurepip - graalpy/bin/graalpy.exe -m pip install wheel - - name: Setup GraalPy - uses: actions/setup-python@v5 - if: inputs.graalpy == '' - with: - python-version: graalpy24.1 - - name: Setup local GraalPy venv - if: inputs.graalpy == '' - run: python -m venv graalpy - - name: Download artifacts from PyYAML - uses: actions/download-artifact@main - continue-on-error: true - with: - name: PyYAML-windows-amd64 - - name: Build wheel - run: |- - $env:PIP_FIND_LINKS=$PWD - $env:PATH+=";$PWD\graalpy\bin;$PWD\graalpy\Scripts;$PWD\..\patch\bin" - graalpy/bin/graalpy -m pip wheel --find-links $PWD ujson + $env:PATH+=";C:\Program Files\Git\usr\bin" + python3 scripts/wheelbuilder/build_wheels.py ${{ inputs.graalpy_url }} - name: Store wheels uses: actions/upload-artifact@main with: - name: ujson-windows-amd64 - path: ujson*.whl + name: wheels + path: wheelhouse/*.whl if-no-files-found: error diff --git a/CHANGELOG.md b/CHANGELOG.md index 9f44abb658..2effd27a31 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ language runtime. The main focus is on user-observable behavior of the engine. * This means all Python methods of these types are available on the corresponding foreign objects, which behave as close as possible as if they were Python objects. * See [the documentation](https://github.com/oracle/graalpython/blob/master/docs/user/Interoperability.md#interacting-with-foreign-objects-from-python-scripts) for more information. * Remove support for running with Sulong managed both in embeddings as well as through the `graalpy-managed` launcher. +* Rewrite wheelbuilder to be easier to use and contribute to. This version is now the same we run internally to build publishable wheels for some platforms we support, so the community can build the same wheels on their own hardware easily if desired. ## Version 24.1.0 * GraalPy is now considered stable for pure Python workloads. While many workloads involving native extension modules work, we continue to consider them experimental. You can use the command-line option `--python.WarnExperimentalFeatures` to enable warnings for such modules at runtime. In Java embeddings the warnings are enabled by default and you can suppress them by setting the context option 'python.WarnExperimentalFeatures' to 'false'. diff --git a/ci.jsonnet b/ci.jsonnet index 44ce2c002c..7064f59cfc 100644 --- a/ci.jsonnet +++ b/ci.jsonnet @@ -1 +1 @@ -{ "overlay": "947e97f768b6e4a5868c3afa76617c2b2f72ff33" } +{ "overlay": "a53f75105e24ff44381970de172a8462fa45b9a7" } diff --git a/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common/CExtContext.java b/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common/CExtContext.java index e96588a033..23de3bf4ed 100644 --- a/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common/CExtContext.java +++ b/graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/common/CExtContext.java @@ -59,6 +59,7 @@ import org.graalvm.shadowed.com.ibm.icu.impl.Punycode; import org.graalvm.shadowed.com.ibm.icu.text.StringPrepParseException; +import com.oracle.graal.python.builtins.PythonOS; import com.oracle.graal.python.builtins.objects.cext.capi.CApiContext; import com.oracle.graal.python.builtins.objects.cext.common.CExtCommonNodes.CheckFunctionResultNode; import com.oracle.graal.python.builtins.objects.cext.common.LoadCExtException.ApiInitException; @@ -309,7 +310,10 @@ public static Object loadCExtModule(Node location, PythonContext context, Module String message = "Loading C extension module %s from '%s'. Support for the Python C API is considered experimental."; if (!runViaLauncher) { message += " See https://www.graalvm.org/latest/reference-manual/python/Native-Extensions/#embedding-limitations for the limitations. " + - "You can suppress this warning by setting the context option 'python.WarnExperimentalFeatures' to 'false'"; + "You can suppress this warning by setting the context option 'python.WarnExperimentalFeatures' to 'false'."; + } + if (PythonOS.getPythonOS() == PythonOS.PLATFORM_WIN32) { + message += " If loading binary wheels fails, please make sure you installed the latest Microsoft Visual C++ Redistributable from https://aka.ms/vs/17/release/vc_redist.x64.exe."; } getLogger().warning(message.formatted(spec.name, spec.path)); } diff --git a/pyproject.toml b/pyproject.toml index c22420b328..11d5b57856 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -8,4 +8,4 @@ required-version = '23' # Disables the black formatter in this repository # If individual suites want to enable the formatter, they can create a # pyproject.toml with their own configuration in their suite folder -force-exclude = '.*' +force-exclude = '.*graalpy.*|.*scripts/[^w].*py' diff --git a/scripts/wheelbuilder/README.md b/scripts/wheelbuilder/README.md index 2aa3bfa131..c12d7c5643 100644 --- a/scripts/wheelbuilder/README.md +++ b/scripts/wheelbuilder/README.md @@ -1,10 +1,10 @@ # Scripts to build wheels for GraalPy. [GraalPy](https://github.com/oracle/graalpython) is compatible with many Python libraries, including those that extend the Python runtime with native code. -However, implemented in Java and thus binary incompatible with existing extensions, users of native Python extension libraries such as NumPy, SciPy, or PyTorch have to build their own binaries when installing these libraries. +However, implemented in Java and thus binary incompatible with existing extensions, users of native Python extension libraries such as NumPy, SciPy, or PyTorch have to build their own binaries when installing these libraries if neither the project nor the GraalPy team provides prebuilt wheels. For many libraries, this means installing additional build dependencies and sitting through long and resource-intensive compilation processes. -This project is meant to be a place for the community to collect build recipes for as many popular packages as possible that can then be built once with GitHub Actions for each major release of GraalPy. +This project is meant to be a place for the community to collect build recipes for as many popular packages as possible that can then be built individually or in CI/CD systems like GitHub Actions. ## Quickstart @@ -16,42 +16,20 @@ This project is meant to be a place for the community to collect build recipes f 4. Click on "Run workflow". You can enter a package name or build all packages. - See [the spec list](../../../../blob/master/scripts/wheelbuilder/generate_workflow.py) for which packages are available. + See [the platform subfolders](../../../../blob/master/scripts/wheelbuilder/) for which packages have buildscripts. ![](guide02.png) ## How to contribute -There should be only one relevant file, `generate_workflow.py`. -In it we collect `BuildSpec` objects that define how to build a particular package. -Many packages do not need special definitions, just a name and maybe which platforms to build it for. -System package dependencies can be specified by platform where needed. -Dependencies between specs are not strictly necessary, but can reduce the overall build times and thus resource usage of GitHub Action runners. - -Changes to `generate_workflow.py` are reflected in the build specs by running the file. -It creates GitHub Action workflow files, one for each platform, and a giant one with all jobs. +We collect simple build scripts per platform and package in the `linux`, `darwin`, and `win32` subdirectories. +The format is simply the package name followed by `.sh` for macOS and Linux or `.bat` for Windows. +An additional component can be added in between the name and the extension. +This file is then only run if the process environment contains a variable matching the middle component. +That can be useful to put things like package installations specific to GitHub Actions while keeping the main build script generic for other platforms. ## How to run this -Many packages use a lot of resources to build, and even those that do not quickly add up. -We have chosen GitHub Action workflows as the cross-platform specification for how to build packages. - -### Running actions locally with nektos/act - -[Act](https://github.com/nektos/act) allows running GitHub actions locally. -We can use that to just build packages on a local machine: - -``` -./act --artifact-server-path /tmp/artifacts \ - -W .github/workflows/build-linux-amd64-wheels.yml \ - -P self-hosted=-self-hosted \ - -P macOS=-self-hosted -P Linux=-self-hosted \ - -P X64=-self-hosted -P ARM64=-self-hosted \ - --input name=psutil -``` - -You can vary the `--input name=` argument to select which package to build or to build all. - -On Linux you will need Docker or Podman. -If you're using Podman, make sure you are running the system service (e.g. -`podman system service -t 0` to run it in a shell), have symlinked or aliased `docker` to `podman`, and prepared you env with `export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/podman/podman.sock` to allow `act` to pick up where podman is listening. +Just run the `build_wheels.py` script. +It expects a URL to download the GraalPy release from. +You can set the environment variable `PACKAGES_TO_BUILD` to a comma-separated list of package build scripts you want to consider. diff --git a/scripts/wheelbuilder/build_wheels.py b/scripts/wheelbuilder/build_wheels.py new file mode 100644 index 0000000000..bde3e0a15b --- /dev/null +++ b/scripts/wheelbuilder/build_wheels.py @@ -0,0 +1,312 @@ +# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +__doc__ = """ +A very simple script to build wheels for which we have build scripts. +The steps are: + +1. Download GraalPy +2. Make a venv +3. Install some default packages like wheel or auditwheel +4. Go over the build scripts and run them in the venv +""" + +import hashlib +import importlib +import os +import re +import shutil +import subprocess +import sys +import tarfile +import zipfile + +from argparse import ArgumentParser +from glob import glob +from os.path import abspath, basename, dirname, exists, isabs, join, splitext +from tempfile import TemporaryDirectory +from urllib.request import urlretrieve + + +def ensure_installed(name): + try: + return importlib.import_module(name) + except ImportError: + subprocess.check_call([sys.executable, "-m", "pip", "install", name]) + return importlib.import_module(name) + + +def download(url, out): + print("Downloading", url, flush=True) + urlretrieve(url, out) + + +def extract(archive): + print("Extracting", archive, flush=True) + if splitext(archive)[1] == ".zip": + with zipfile.ZipFile(archive) as f: + f.extractall() + else: + with tarfile.open(archive) as f: + f.extractall() + + +def create_venv(): + if sys.platform == "win32": + exe = ".exe" + pip = "graalpy/Scripts/pip.exe" + else: + exe = "" + pip = "graalpy/bin/pip" + binary = next(iter(glob(f"graalpy-*/bin/graalpy{exe}"))) + print("Creating venv with", binary, flush=True) + subprocess.check_call([binary, "-m", "venv", "graalpy"]) + print("Installing wheel with", pip, flush=True) + subprocess.check_call([pip, "install", "wheel"]) + return pip + + +def build_wheels(pip): + packages_selected = [s for s in os.environ.get("PACKAGES_TO_BUILD", "").split(",") if s] + packages_to_build = set() + with open(join(dirname(__file__), "packages.txt")) as f: + for line in f.readlines(): + name, version = line.split("==") + if not packages_selected or name in packages_selected or line in packages_selected: + packages_to_build.add(line) + scriptdir = abspath(join(dirname(__file__), sys.platform)) + if sys.platform == "win32": + script_ext = "bat" + else: + script_ext = "sh" + if exists(scriptdir): + available_scripts = {s.lower(): s for s in os.listdir(scriptdir)} + else: + available_scripts = {} + for spec in packages_to_build: + name, version = spec.split("==") + whl_count = len(glob("*.whl")) + script = f"{name}.{version}.{script_ext}".lower() + if script not in available_scripts: + script = f"{name}.{script_ext}".lower() + if script in available_scripts: + script = join(scriptdir, available_scripts[script]) + env = os.environ.copy() + env["PATH"] = abspath(dirname(pip)) + os.pathsep + env["PATH"] + env["VIRTUAL_ENV"] = abspath(dirname(dirname(pip))) + print("Building", name, version, "with", script, flush=True) + subprocess.check_call([script, version], shell=True, env=env) + if not len(glob("*.whl")) > whl_count: + print("Building wheel for", name, version, "after", script, "did not", flush=True) + subprocess.check_call([pip, "wheel", spec]) + else: + print("Building", name, version, flush=True) + subprocess.check_call([pip, "wheel", spec]) + + +_warned_dlls = [] + + +def repair_wheels_windows(output_dir, wheels): + import pefile + from machomachomangler.pe import redll + + def resolve_dll_src(dll): + # search for dependencies in system directories + dll_search_paths = [ + os.environ["WINDIR"], + join(os.environ["WINDIR"], "System32"), + *os.environ["PATH"].split(";"), + ] + ignored_dlls = [ + # These DLLs are just provided by Windows. + # This list is probably incomplete. + r"advapi32\.dll", + r"advapires32\.dll", + r"atl.*\.dll", + r"comctl32\.dll", + r"comdlg32\.dll", + r"crtdll\.dll", + r"gdi32\.dll", + r"hal.*\.dll", + r"imm32\.dll", + r"iphlpapi\.dll", + r"kernel32\.dll", + r"kernelbase\.dll", + r"msvbvm60\.dll", + r"msvcirt\.dll", + r"msvcrt?.*\.dll", + r"netapi32\.dll", + r"ntdll\.dll", + r"ole32\.dll", + r"pdh\.dll", + r"powrprof\.dll", + r"psapi\.dll", + r"rpcrt4\.dll", + r"sechost\.dll", + r"shell32\.dll", + r"shlwapi\.dll", + r"shscrap\.dll", + r"ucrtbase\.dll", + r"user32\.dll", + r"version\.dll", + r"winmm\.dll", + r"ws2_32\.dll", + # These match DLLs that provide API sets. + # See https://learn.microsoft.com/en-us/windows/win32/apiindex/windows-apisets + r"api-ms-win-.*\.dll", + r"ext-ms-win-.*\.dll", + # These match DLLs that we provide in GraalPy + r"python.*\.dll", + # These are the DLLs typically linked when building with MSVC. See + # https://learn.microsoft.com/en-us/cpp/windows/determining-which-dlls-to-redistribute + # When these are included, the user should install the latest + # redist package from + # https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist + # However, https://aka.ms/vs/17/redist.txt lists the libraries + # which can be included in application distributions. + r"concrt.*\.dll", + r"mfc.*\.dll", + r"msvcp.*\.dll", + r"vcamp.*\.dll", + r"vccorlib.*\.dll", + r"vcomp.*\.dll", + r"vcruntime.*\.dll", + ] + if not dll: + return + if any(re.match(pat, basename(dll), re.IGNORECASE) for pat in ignored_dlls): + if dll not in _warned_dlls: + print("Not including", dll, flush=True) + _warned_dlls.append(dll) + return + if isabs(dll): + return dll + for search_path in dll_search_paths: + if exists(src := join(search_path, dll)): + return src + + def resolve_dll_target(dll, dependent, checksum): + return join(dirname(dependent), f"{checksum}.{basename(dll)}") + + def filehash(files): + sha1 = hashlib.sha1() + for file in files: + with open(file, mode="rb") as f: + sha1.update(f.read()) + return sha1.hexdigest()[:8] + + for whl in wheels: + with TemporaryDirectory() as name: + with zipfile.ZipFile(whl) as f: + f.extractall(name) + + # find all pyd files and recursively copy dependencies + dlls = glob(f"{name}/**/*.pyd", recursive=True) + checksum = filehash(dlls) + dependents_to_dependencies = {} + while dlls: + dll = dlls.pop() + with pefile.PE(dll) as pe: + pe_info = pe.dump_dict() + for syms in pe_info.get("Imported symbols", []): + for sym in syms: + if dep_src := resolve_dll_src(sym.get("DLL", b"").decode("utf-8")): + if not exists(dep_tgt := resolve_dll_target(dep_src, dll, checksum)): + print("Including", dep_src, "as", dep_tgt, flush=True) + shutil.copy(dep_src, dep_tgt) + dlls.append(dep_tgt) + dependents_to_dependencies.setdefault(dll, []).append(dep_src) + + for dll, dependencies in dependents_to_dependencies.items(): + mapping = {} + for dep_src in dependencies: + mapping[basename(dep_src).encode("utf-8")] = basename( + resolve_dll_target(dep_src, dll, checksum) + ).encode("utf-8") + with open(dll, mode="rb") as f: + data = f.read() + print( + "Rewriting\n\t", + "\n\t".join([k.decode("utf-8") for k in mapping.keys()]), + "\n\t->\n\t", + "\n\t".join([v.decode("utf-8") for v in mapping.values()]), + "\nin", + dll, + ) + data = redll(data, mapping) + with open(dll, mode="wb") as f: + f.write(data) + + os.makedirs(output_dir, exist_ok=True) + if exists(whl_tgt := join(output_dir, whl)): + os.unlink(whl_tgt) + shutil.make_archive(whl_tgt, "zip", name) + os.rename(f"{whl_tgt}.zip", whl_tgt) + + +def repair_wheels(): + if sys.platform == "win32": + ensure_installed("machomachomangler") + ensure_installed("pefile") + repair_wheels_windows("wheelhouse", glob("*.whl")) + elif sys.platform == "linux": + ensure_installed("auditwheel") + subprocess.check_call( + [join(dirname(sys.executable), "auditwheel"), "repair", "-w", "wheelhouse", *glob("*.whl")] + ) + elif sys.platform == "darwin": + ensure_installed("delocate") + subprocess.check_call( + [join(dirname(sys.executable), "delocate-wheel"), "-v", "-w", "wheelhouse", *glob("*.whl")] + ) + + +if __name__ == "__main__": + parser = ArgumentParser() + parser.add_argument("graalpy_url") + args = parser.parse_args() + ext = splitext(args.graalpy_url)[1] + outpath = f"graalpy{ext}" + + download(args.graalpy_url, outpath) + extract(outpath) + pip = create_venv() + build_wheels(pip) + repair_wheels() diff --git a/scripts/wheelbuilder/darwin/cffi.sh b/scripts/wheelbuilder/darwin/cffi.sh new file mode 100755 index 0000000000..58aa287525 --- /dev/null +++ b/scripts/wheelbuilder/darwin/cffi.sh @@ -0,0 +1,42 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if [ -n "$GITHUB_RUN_ID" ]; then + brew install libffi +fi diff --git a/scripts/wheelbuilder/darwin/numpy.sh b/scripts/wheelbuilder/darwin/numpy.sh new file mode 100755 index 0000000000..b4fa5b7363 --- /dev/null +++ b/scripts/wheelbuilder/darwin/numpy.sh @@ -0,0 +1,42 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if [ -n "$GITHUB_RUN_ID" ]; then + brew install gcc openblas +fi diff --git a/scripts/wheelbuilder/darwin/pillow.sh b/scripts/wheelbuilder/darwin/pillow.sh new file mode 100755 index 0000000000..7058e6880f --- /dev/null +++ b/scripts/wheelbuilder/darwin/pillow.sh @@ -0,0 +1,42 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if [ -n "$GITHUB_RUN_ID" ]; then + brew install libjpeg libtiff little-cms2 openjpeg2 webp +fi diff --git a/scripts/wheelbuilder/darwin/scipy.sh b/scripts/wheelbuilder/darwin/scipy.sh new file mode 100755 index 0000000000..d4ece84988 --- /dev/null +++ b/scripts/wheelbuilder/darwin/scipy.sh @@ -0,0 +1,45 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if [ -n "$GITHUB_RUN_ID" ]; then + brew install gcc openblas pkg-config + export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig +fi +export FFLAGS=-fallow-argument-mismatch +pip wheel "scipy==$1" diff --git a/scripts/wheelbuilder/darwin/torch.sh b/scripts/wheelbuilder/darwin/torch.sh new file mode 100755 index 0000000000..7bb43eaca1 --- /dev/null +++ b/scripts/wheelbuilder/darwin/torch.sh @@ -0,0 +1,47 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if [ -n "$GITHUB_RUN_ID" ]; then + brew install openblas cmake libffi pkg-config + export USE_CUDA=0 + export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig +fi +export MAX_JOBS=4 +export BUILD_TEST=0 +pip wheel "torch==$1" diff --git a/scripts/wheelbuilder/generate_repository.py b/scripts/wheelbuilder/generate_repository.py deleted file mode 100644 index 03783a4e48..0000000000 --- a/scripts/wheelbuilder/generate_repository.py +++ /dev/null @@ -1,116 +0,0 @@ -# Copyright (c) 2023, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# The Universal Permissive License (UPL), Version 1.0 -# -# Subject to the condition set forth below, permission is hereby granted to any -# person obtaining a copy of this software, associated documentation and/or -# data (collectively the "Software"), free of charge and under any and all -# copyright rights in the Software, and any and all patent rights owned or -# freely licensable by each licensor hereunder covering either (i) the -# unmodified Software as contributed to or provided by such licensor, or (ii) -# the Larger Works (as defined below), to deal in both -# -# (a) the Software, and -# -# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if -# one is included with the Software each a "Larger Work" to which the Software -# is contributed by such licensors), -# -# without restriction, including without limitation the rights to copy, create -# derivative works of, display, perform, and distribute the Software and make, -# use, sell, offer for sale, import, export, have made, and have sold the -# Software and the Larger Work(s), and to sublicense the foregoing rights on -# either these or other terms. -# -# This license is subject to the following condition: -# -# The above copyright notice and either this complete permission notice or at a -# minimum a reference to the UPL must be included in all copies or substantial -# portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -""" -Set up a repository folder following -https://packaging.python.org/en/latest/guides/hosting-your-own-index/ -""" - -import glob -import gzip -import os -import re -import shutil -import sys -import html - - -def normalize(name): - """ - Taken from - https://packaging.python.org/en/latest/specifications/name-normalization/#name-normalization - """ - return re.sub(r"[-_.]+", "-", name).lower() - - -if __name__ == "__main__": - if len(sys.argv) > 1: - workspace = sys.argv[1] - else: - workspace = os.environ["GITHUB_WORKSPACE"] - # find wheels either locally in the workspace or in an act artifact root structure - wheels = glob.glob(os.path.join(workspace, "**/*.whl")) or glob.glob( - os.path.join(workspace, "**/**/*.whl.gz__") - ) - repo = os.path.join(workspace, "repository", "simple") - os.makedirs(repo, exist_ok=True) - pkg_index = [ - "Simple Index", - "", - ] - processed_wheels = set() - for wheel in wheels: - print("Processing", wheel) - basename = os.path.basename(wheel) - parts = basename.split("-") - for idx, part in enumerate(parts): - if part.startswith("graalpy3") or part.startswith("py2") or part.startswith("py3"): - version_idx = idx - 1 - break - else: - continue - wheel_name = normalize("-".join(parts[:version_idx])) - target_dir = os.path.join(repo, wheel_name) - os.makedirs(target_dir, exist_ok=True) - if wheel.endswith(".gz__"): - with gzip.open(wheel, "rb") as f_in: - with open( - os.path.join( - target_dir, basename.replace(".gz__", "") - ), - "wb", - ) as f_out: - shutil.copyfileobj(f_in, f_out) - else: - shutil.copy(wheel, target_dir) - - if wheel_name not in processed_wheels: - processed_wheels.add(wheel_name) - wheel_name = html.escape(wheel_name) - pkg_index.append(f"{wheel_name}
") - - with open(os.path.join(target_dir, "index.html"), "a") as f: - basename = html.escape(basename) - f.write(f"{basename}
\n") - - pkg_index.append("") - with open(os.path.join(repo, "index.html"), "w") as f: - f.write("\n".join(pkg_index)) - - shutil.make_archive(f"{workspace}/repository", "zip", repo) diff --git a/scripts/wheelbuilder/generate_workflow.py b/scripts/wheelbuilder/generate_workflow.py deleted file mode 100644 index a2edc151f2..0000000000 --- a/scripts/wheelbuilder/generate_workflow.py +++ /dev/null @@ -1,222 +0,0 @@ -# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# The Universal Permissive License (UPL), Version 1.0 -# -# Subject to the condition set forth below, permission is hereby granted to any -# person obtaining a copy of this software, associated documentation and/or -# data (collectively the "Software"), free of charge and under any and all -# copyright rights in the Software, and any and all patent rights owned or -# freely licensable by each licensor hereunder covering either (i) the -# unmodified Software as contributed to or provided by such licensor, or (ii) -# the Larger Works (as defined below), to deal in both -# -# (a) the Software, and -# -# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if -# one is included with the Software each a "Larger Work" to which the Software -# is contributed by such licensors), -# -# without restriction, including without limitation the rights to copy, create -# derivative works of, display, perform, and distribute the Software and make, -# use, sell, offer for sale, import, export, have made, and have sold the -# Software and the Larger Work(s), and to sublicense the foregoing rights on -# either these or other terms. -# -# This license is subject to the following condition: -# -# The above copyright notice and either this complete permission notice or at a -# minimum a reference to the UPL must be included in all copies or substantial -# portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -from wheelbuilder import ( - BuildSpec, - Linux, - LinuxX86, - LinuxARM, - Mac, - MacX86, - MacARM, - Windows, - WindowsX86, -) - -psutil = BuildSpec(name="psutil") -numpy = BuildSpec( - name="numpy", - platforms=[Linux, Mac, Windows], - system_dependencies={ - Linux: ["gcc-toolset-12-gcc-gfortran", "openblas-devel"], - Mac: ["gcc", "openblas"], - }, -) -BuildSpec( - name="pandas", - system_dependencies=["openblas"], - spec_dependencies=[numpy], -) -pybind11 = BuildSpec(name="pybind11") -ninja = BuildSpec(name="ninja") -pillow = BuildSpec( - name="pillow", - system_dependencies={ - Linux: [ - "libtiff-devel", - "libjpeg-devel", - "openjpeg2-devel", - "zlib-devel", - "freetype-devel", - "lcms2-devel", - "libwebp-devel", - ], - Mac: ["libjpeg", "libtiff", "little-cms2", "openjpeg", "webp"], - }, -) -contourpy = BuildSpec( - name="contourpy", - spec_dependencies=[ninja, pybind11, numpy], -) -kiwisolver = BuildSpec( - name="kiwisolver", - spec_dependencies=[pybind11], -) -BuildSpec( - name="matplotlib", - spec_dependencies=[pillow, kiwisolver, numpy, contourpy], - system_dependencies=["openblas"], -) -scipy = BuildSpec( - name="scipy", - spec_dependencies=[numpy], - system_dependencies={ - Linux: ["gcc-toolset-12-gcc-gfortran", "openblas-devel"], - Mac: ["gcc", "openblas", "pkg-config"], - }, - before_build={ - Linux: [ - "export FFLAGS=-fallow-argument-mismatch", - ], - Mac: [ - "export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig", - "export FFLAGS=-fallow-argument-mismatch", - ], - }, -) -BuildSpec( - name="scikit-learn", - spec_dependencies=[numpy, scipy], - system_dependencies=["openblas"], - before_build={ - Linux: [ - "export FFLAGS=-fallow-argument-mismatch", - ], - Mac: [ - "export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig", - "export FFLAGS=-fallow-argument-mismatch", - ], - }, -) -cffi = BuildSpec( - name="cffi", - before_build=[ - "graalpy/bin/graalpy -m pip install wheel", - ], - system_dependencies={ - Linux: ["libffi-devel"], - Mac: ["libffi"], - }, -) -pyyaml = BuildSpec( - name="PyYAML", - platforms=[Linux, Mac, Windows], -) -cmake = BuildSpec(name="cmake") -BuildSpec( - name="ujson", - platforms=[Linux, Mac, Windows], -) -BuildSpec( - name="torch", - spec_dependencies=[numpy, ninja, cmake, pybind11, cffi, pyyaml], - system_dependencies={ - Linux: ["openblas-devel", "/usr/bin/cmake", "/usr/bin/sudo", "libffi-devel"], - Mac: ["openblas", "cmake", "libffi"], - }, - before_build={ - Linux: [ - "export USE_CUDA=0", - ], - Mac: [ - "export USE_CUDA=0", - "export PKG_CONFIG_PATH=/opt/homebrew/opt/openblas/lib/pkgconfig", - ], - }, - environment={ - "MAX_JOBS": 4, - "BUILD_TEST": 0, - }, -) -opt_einsum = BuildSpec( - name="opt_einsum", - spec_dependencies=[numpy], - platforms=[LinuxX86], -) -keras_preprocessing = BuildSpec( - name="Keras_Preprocessing", - spec_dependencies=[numpy], - platforms=[LinuxX86], -) -grpcio = BuildSpec( - name="grpcio", - platforms=[LinuxX86], -) -ml_dtypes = BuildSpec( - name="ml_dtypes", - platforms=[LinuxX86], -) -wrapt = BuildSpec( - name="wrapt", - platforms=[LinuxX86], -) -h5py = BuildSpec( - name="h5py", - platforms=[LinuxX86], - system_dependencies={ - Linux: ["hdf5-devel"], - }, -) -BuildSpec( - name="tensorflow", - platforms=[LinuxX86], - spec_dependencies=[grpcio, psutil, wrapt, ml_dtypes, h5py, numpy, opt_einsum, keras_preprocessing], - before_build=[ - "export PIP_FIND_LINKS=$(pwd)", - "pip install pip numpy wheel packaging requests opt_einsum", - "pip install keras_preprocessing --no-deps", - "curl -L https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-x86_64 -o $(pwd)/graalpy/bin/bazel", - "chmod +x graalpy/bin/bazel", - "export PATH=$(pwd)/graalpy/bin/:$PATH", - "bazel --version", - ], - system_dependencies=[ - "openblas-devel", "/usr/bin/cmake", "/usr/bin/sudo", "/usr/bin/curl", "java-11-openjdk-devel" - ], -) - - -if __name__ == "__main__": - import os - from wheelbuilder.generator import generate - - workflow_directory = os.path.join( - os.path.dirname(__file__), "..", "..", ".github", "workflows" - ) - generate(workflow_directory) diff --git a/scripts/wheelbuilder/linux/cffi.sh b/scripts/wheelbuilder/linux/cffi.sh new file mode 100755 index 0000000000..6770b98e27 --- /dev/null +++ b/scripts/wheelbuilder/linux/cffi.sh @@ -0,0 +1,42 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if command -v manylinux-interpreters 2>&1 >/dev/null; then + dnf install -y libffi-devel +fi diff --git a/scripts/wheelbuilder/linux/h5py.sh b/scripts/wheelbuilder/linux/h5py.sh new file mode 100755 index 0000000000..82172d55f0 --- /dev/null +++ b/scripts/wheelbuilder/linux/h5py.sh @@ -0,0 +1,42 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if command -v manylinux-interpreters 2>&1 >/dev/null; then + dnf install -y hdf5-devel +fi diff --git a/scripts/wheelbuilder/linux/numpy.sh b/scripts/wheelbuilder/linux/numpy.sh new file mode 100755 index 0000000000..a24e6a2aa3 --- /dev/null +++ b/scripts/wheelbuilder/linux/numpy.sh @@ -0,0 +1,42 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if command -v manylinux-interpreters 2>&1 >/dev/null; then + dnf install -y gcc-toolset-12-gcc-gfortran openblas-devel +fi diff --git a/scripts/wheelbuilder/linux/pillow.sh b/scripts/wheelbuilder/linux/pillow.sh new file mode 100755 index 0000000000..e6d64d0863 --- /dev/null +++ b/scripts/wheelbuilder/linux/pillow.sh @@ -0,0 +1,42 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if command -v manylinux-interpreters 2>&1 >/dev/null; then + dnf install -y libtiff-devel libjpeg-devel openjpeg2-devel zlib-devel freetype-devel lcms2-devel +fi diff --git a/scripts/wheelbuilder/linux/scipy.sh b/scripts/wheelbuilder/linux/scipy.sh new file mode 100755 index 0000000000..e935ec35f3 --- /dev/null +++ b/scripts/wheelbuilder/linux/scipy.sh @@ -0,0 +1,44 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if command -v manylinux-interpreters 2>&1 >/dev/null; then + dnf install -y gcc-toolset-12-gcc-gfortran openblas-devel +fi +export FFLAGS=-fallow-argument-mismatch +pip wheel "scipy==$1" diff --git a/scripts/wheelbuilder/linux/tensorflow.sh b/scripts/wheelbuilder/linux/tensorflow.sh new file mode 100755 index 0000000000..5f43a186d8 --- /dev/null +++ b/scripts/wheelbuilder/linux/tensorflow.sh @@ -0,0 +1,51 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if command -v manylinux-interpreters 2>&1 >/dev/null; then + dnf install -y openblas-devel /usr/bin/cmake /usr/bin/sudo /usr/bin/curl java-11-openjdk-devel +fi +pip install pip numpy wheel packaging requests opt_einsum +pip install keras_preprocessing --no-deps +mkdir -p tmp_bazel +curl -L https://github.com/bazelbuild/bazel/releases/download/6.4.0/bazel-6.4.0-linux-x86_64 -o $(pwd)/tmp_bazel/bazel +chmod +x tmp_bazel/bazel +export PATH=$(pwd)/tmp_bazel/:$PATH +bazel --version +pip wheel "tensorflow==$1" +rm -rf tmp_bazel diff --git a/scripts/wheelbuilder/linux/torch.sh b/scripts/wheelbuilder/linux/torch.sh new file mode 100755 index 0000000000..40cdd545cd --- /dev/null +++ b/scripts/wheelbuilder/linux/torch.sh @@ -0,0 +1,46 @@ +# Copyright (c) 2024, Oracle and/or its affiliates. All rights reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# The Universal Permissive License (UPL), Version 1.0 +# +# Subject to the condition set forth below, permission is hereby granted to any +# person obtaining a copy of this software, associated documentation and/or +# data (collectively the "Software"), free of charge and under any and all +# copyright rights in the Software, and any and all patent rights owned or +# freely licensable by each licensor hereunder covering either (i) the +# unmodified Software as contributed to or provided by such licensor, or (ii) +# the Larger Works (as defined below), to deal in both +# +# (a) the Software, and +# +# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if +# one is included with the Software each a "Larger Work" to which the Software +# is contributed by such licensors), +# +# without restriction, including without limitation the rights to copy, create +# derivative works of, display, perform, and distribute the Software and make, +# use, sell, offer for sale, import, export, have made, and have sold the +# Software and the Larger Work(s), and to sublicense the foregoing rights on +# either these or other terms. +# +# This license is subject to the following condition: +# +# The above copyright notice and either this complete permission notice or at a +# minimum a reference to the UPL must be included in all copies or substantial +# portions of the Software. +# +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +# SOFTWARE. + +if command -v manylinux-interpreters 2>&1 >/dev/null; then + dnf install -y openblas-devel /usr/bin/cmake /usr/bin/sudo libffi-devel + export USE_CUDA=0 +fi +export MAX_JOBS=4 +export BUILD_TEST=0 +pip wheel "torch==$1" diff --git a/scripts/wheelbuilder/packages.txt b/scripts/wheelbuilder/packages.txt new file mode 100644 index 0000000000..aa4de2a2f1 --- /dev/null +++ b/scripts/wheelbuilder/packages.txt @@ -0,0 +1,6 @@ +numpy==1.26.4 +httptools==0.6.1 +kiwisolver==1.4.5 +psutil==5.9.8 +ujson==5.10.0 +xxhash==3.4.1 diff --git a/scripts/wheelbuilder/requirements.txt b/scripts/wheelbuilder/requirements.txt deleted file mode 100644 index c3726e8bfe..0000000000 --- a/scripts/wheelbuilder/requirements.txt +++ /dev/null @@ -1 +0,0 @@ -pyyaml diff --git a/scripts/wheelbuilder/wheelbuilder/__init__.py b/scripts/wheelbuilder/wheelbuilder/__init__.py deleted file mode 100644 index 1006cf0d4f..0000000000 --- a/scripts/wheelbuilder/wheelbuilder/__init__.py +++ /dev/null @@ -1,427 +0,0 @@ -# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# The Universal Permissive License (UPL), Version 1.0 -# -# Subject to the condition set forth below, permission is hereby granted to any -# person obtaining a copy of this software, associated documentation and/or -# data (collectively the "Software"), free of charge and under any and all -# copyright rights in the Software, and any and all patent rights owned or -# freely licensable by each licensor hereunder covering either (i) the -# unmodified Software as contributed to or provided by such licensor, or (ii) -# the Larger Works (as defined below), to deal in both -# -# (a) the Software, and -# -# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if -# one is included with the Software each a "Larger Work" to which the Software -# is contributed by such licensors), -# -# without restriction, including without limitation the rights to copy, create -# derivative works of, display, perform, and distribute the Software and make, -# use, sell, offer for sale, import, export, have made, and have sold the -# Software and the Larger Work(s), and to sublicense the foregoing rights on -# either these or other terms. -# -# This license is subject to the following condition: -# -# The above copyright notice and either this complete permission notice or at a -# minimum a reference to the UPL must be included in all copies or substantial -# portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -import re -import copy -from typing import Literal, Any -from dataclasses import dataclass, field - - -__all__ = [ - "BuildSpec", - "create_jobs", - "Linux", - "LinuxX86", - "LinuxARM", - "Mac", - "MacX86", - "MacARM", - "Windows", - "WindowsX86", - "PLATFORMS", -] - - -def _glob_all_from_pattern(string, pattern=re.compile(r"[^a-zA-Z0-9]")): - return re.sub(pattern, "*", string) - - -@dataclass(frozen=True) -class Platform: - name: Literal["linux", "macos", "windows"] = "linux" - arch: Literal["amd64", "aarch64"] = "amd64" - - @property - def runs_on(self) -> str: - match (self.name, self.arch): - case ("linux", "amd64"): - # return ["self-hosted", "Linux", "X64"] - return "ubuntu-latest" - case ("linux", "aarch64"): - return ["self-hosted", "Linux", "ARM64"] - # return "ubuntu-latest" - case ("macos", "amd64"): - return "macos-12" - # return ["self-hosted", "macOS", "X64"] - case ("macos", "aarch64"): - return "macos-latest" - # return ["self-hosted", "macOS", "ARM64"] - case ("windows", "amd64"): - # return ["self-hosted", "windows", "X64"] - return "windows-latest" - raise RuntimeError(f"Invalid platform spec {self.name}:{self.arch}") - - @property - def container(self) -> str | None: - match (self.name, self.arch): - case ("linux", "amd64"): - return "quay.io/pypa/manylinux_2_28_x86_64" - case ("linux", "aarch64"): - return "quay.io/pypa/manylinux_2_28_aarch64" - return None - - def install_cmd(self, packages: list[str]) -> list[str]: - match self.name: - case "linux": - return [ - "dnf install -y epel-release", - "crb enable", - "dnf makecache --refresh", - "dnf module install -y nodejs:18", - "dnf install -y /usr/bin/patch", - f"dnf install -y {' '.join(packages)}" if packages else "", - ] - case "macos": - return [f"brew install {' '.join(packages)}"] - case "windows": - return [ - "Invoke-WebRequest https://kumisystems.dl.sourceforge.net/project/gnuwin32/patch/2.5.9-7/patch-2.5.9-7-bin.zip -OutFile patch.zip", - "Expand-Archive patch.zip -DestinationPath ../patch -Force", - f"winget install --force --silent --disable-interactivity --accept-package-agreements {' '.join(packages)}" if packages else "", - ] - raise RuntimeError(f"Invalid platform spec {self.name}") - - def get_graalpy_cmd(self) -> list[str]: - match self.name: - case "linux" | "macos": - return [ - f"curl -L -o graalpy.tar.gz ${{{{ inputs.graalpy }}}}-{self.name}-{self.arch}.tar.gz", - "mkdir -p graalpy", - "tar -C $(pwd)/graalpy --strip-components=1 -xzf graalpy.tar.gz", - "graalpy/bin/graalpy -s -m ensurepip", - "graalpy/bin/graalpy -m pip install wheel", - ] - case "windows": - return [ - "$ProgressPreference = 'SilentlyContinue'", - f"Invoke-WebRequest ${{{{ inputs.graalpy }}}}-{self.name}-{self.arch}.zip -OutFile graalpy-{self.name}-{self.arch}.zip", - f"Expand-Archive graalpy-{self.name}-{self.arch}.zip", - f"mv graalpy-{self.name}-{self.arch}/* graalpy", - "graalpy/bin/graalpy.exe -s -m ensurepip", - "graalpy/bin/graalpy.exe -m pip install wheel", - ] - raise RuntimeError(f"Invalid platform spec {self.name}") - - def build_cmd(self, cmds: list[str]) -> list[str]: - match self.name: - case "linux" | "macos": - return [ - "export PIP_FIND_LINKS=$(pwd)", - "export PATH=$(pwd)/graalpy/bin/:$PATH", - ] + cmds - case "windows": - return [ - "$env:PIP_FIND_LINKS=$PWD", - '$env:PATH+=";$PWD\\graalpy\\bin;$PWD\\graalpy\\Scripts;$PWD\\..\\patch\\bin"', - ] + cmds - raise RuntimeError(f"Invalid platform spec {self.name}") - - def build_wheels(self, specs: list[str]) -> list[str]: - match self.name: - case "linux" | "macos": - return self.build_cmd( - [ - f"graalpy/bin/graalpy -m pip wheel --find-links $(pwd) {spec}" - for spec in specs - ] - ) - case "windows": - return self.build_cmd( - [ - f"graalpy/bin/graalpy -m pip wheel --find-links $PWD {spec}" - for spec in specs - ] - ) - raise RuntimeError(f"Invalid platform spec {self.name}") - - -# OS arguments to match all platforms this os is available for -Linux = Platform("linux", "any") -Mac = Platform("macos", "any") -Windows = Platform("windows", "any") - - -LinuxX86 = Platform("linux", "amd64") -LinuxARM = Platform("linux", "aarch64") -MacX86 = Platform("macos", "amd64") -MacARM = Platform("macos", "aarch64") -WindowsX86 = Platform("windows", "amd64") -PLATFORMS = [LinuxX86, LinuxARM, MacX86, MacARM, WindowsX86] - - -@dataclass -class BuildSpec: - name: str - extra_versions: list[str] = field(default_factory=list) - platforms: list[Platform] = field( - default_factory=lambda: [LinuxX86, LinuxARM, MacX86, MacARM] - ) - system_dependencies: dict[Platform, list[str]] | list[str] = field( - default_factory=dict - ) - spec_dependencies: list["BuildSpec"] = field(default_factory=list) - before_build: dict[Platform, list[str]] | list[str] = field(default_factory=list) - build: dict[Platform, list[str]] | list[str] | None = None - environment: dict[str, Any] | None = None - custom_steps: dict[str, Any] = field(default_factory=dict) - - def get_before_build(self, platform: Platform) -> list[str]: - if isinstance(self.before_build, list): - return self.before_build - else: - return self.before_build.get(platform, []) - - def get_system_dependencies(self, platform: Platform) -> list[str]: - if isinstance(self.system_dependencies, list): - return self.system_dependencies - else: - return self.system_dependencies.setdefault(platform, []) - - def platform_name(self, platform: Platform) -> str: - return f"{self.name}-{platform.name}-{platform.arch}" - - @classmethod - def _append_instance(cls, instance): - cls.instances = getattr(cls, "instances", []) - cls.instances.append(instance) - - @classmethod - def get_instances(cls) -> list["BuildSpec"]: - return getattr(cls, "instances", []) - - def _append_downstream(self, spec: "BuildSpec"): - self.dependents: list["BuildSpec"] = getattr(self, "dependents", []) - self.dependents.append(spec) - - def get_downstream_specs(self): - dependents = getattr(self, "dependents", []) - dependent_names = set([s.name for s in dependents]) - for s1 in dependents: - for s2 in s1.get_downstream_specs(): - if s2.name not in dependent_names: - dependent_names.add(s2.name) - dependents.append(s2) - return dependents - - @classmethod - def __new__(cls, *args, **kwargs): - os_platform_map = { - Linux: [LinuxX86, LinuxARM], - Mac: [MacX86, MacARM], - Windows: [WindowsX86], - } - assert kwargs and len(args) == 1, "Pass all arguments as keywords" - for k in ["system_dependencies", "before_build", "build"]: - if k in kwargs and isinstance(kwargs[k], dict): - for os, platforms in os_platform_map.items(): - if os_key := kwargs[k].get(os): - for platform in platforms: - kwargs[k].setdefault(platform, os_key) - del kwargs[k][os] - if platforms := kwargs.get("platforms"): - for platform in platforms[:]: - if platform in os_platform_map: - platforms.remove(platform) - platforms.extend(os_platform_map[platform]) - new_instance = super().__new__(cls) - cls._append_instance(new_instance) - for dependency in kwargs.get("spec_dependencies", []): - dependency._append_downstream(new_instance) - return new_instance - - -def create_jobs( - specs: list[BuildSpec], name: str, on: str | list[str] -) -> dict[str, Any]: - result = {} - for spec in specs: - for platform in spec.platforms: - job: dict[str, Any] = { - "runs-on": platform.runs_on, - } - if platform.container: - job["container"] = platform.container - if spec_deps := spec.spec_dependencies: - needs = [spec_dep.platform_name(platform) for spec_dep in spec_deps] - job["needs"] = needs[0] if len(needs) == 1 else needs - job["if"] = ( - "${{ !cancelled() && (" - + ( - " || ".join( - [ - "inputs.name == ''", - f"inputs.name == '{spec.name}'", - *[ - f"inputs.name == '{spec_dep.name}'" - for spec_dep in spec.get_downstream_specs() - if platform in spec_dep.platforms - ], - ] - ) - ) - + ") }}" - ) - if spec.environment: - job["env"] = spec.environment - steps: list[dict[str, Any]] = [ - { - # only for windows, but is a noop on posix - "uses": "ilammy/msvc-dev-cmd@v1", - }, - ] - job["steps"] = steps - if ( - deps := spec.get_system_dependencies(platform) - ) or platform.name in ("linux", "windows"): - steps.append( - { - "name": "Install dependencies", - "run": "\n".join(platform.install_cmd(deps)), - } - ) - steps.append( - { - "name": "Checkout", - "uses": "actions/checkout@main", - } - ) - if spec.custom_steps: - steps += copy.deepcopy(spec.custom_steps) - steps.append( - { - "name": "Setup custom GraalPy", - "if": "inputs.graalpy != ''", - "run": "\n".join(platform.get_graalpy_cmd()), - } - ) - steps.append( - { - "name": "Setup GraalPy", - "uses": "actions/setup-python@v5", - "if": "inputs.graalpy == ''", - "with": { - "python-version": "graalpy24.1", - }, - } - ) - steps.append( - { - "name": "Setup local GraalPy venv", - "if": "inputs.graalpy == ''", - "run": "python -m venv graalpy", - } - ) - if spec_deps := spec.spec_dependencies: - for spec_dep in spec_deps: - steps.append( - { - "name": f"Download artifacts from {spec_dep.name}", - "uses": "actions/download-artifact@main", - "continue-on-error": True, - "with": {"name": spec_dep.platform_name(platform)}, - } - ) - wheel_builds = [spec.name] - for version in spec.extra_versions: - wheel_builds.append(f"{spec.name}=={version}") - if isinstance(spec.build, dict) and (buildp := spec.build.get(platform)): - steps.append( - { - "name": f"Build wheel custom on {platform.name}", - "run": "\n".join( - spec.get_before_build(platform) + platform.build_cmd(buildp) - ), - } - ) - elif isinstance(spec.build, list): - steps.append( - { - "name": "Build wheel custom", - "run": "\n".join( - spec.get_before_build(platform) - + platform.build_cmd(spec.build) - ), - } - ) - else: - steps.append( - { - "name": "Build wheel", - "run": "\n".join( - spec.get_before_build(platform) - + platform.build_wheels(wheel_builds) - ), - } - ) - steps.append( - { - "name": "Store wheels", - "uses": "actions/upload-artifact@main", - "with": { - "name": spec.platform_name(platform), - "path": f"{_glob_all_from_pattern(spec.name)}*.whl", - "if-no-files-found": "error", - }, - } - ) - result[spec.platform_name(platform)] = job - if on == "workflow_dispatch": - on_spec = { - "workflow_dispatch": { - "inputs": { - "name": { - "type": "string", - "description": "Pkg to build (empty for all)", - "required": False, - }, - "graalpy": { - "type": "string", - "description": "GraalPy download url prefix (empty for default)", - "required": False, - }, - } - } - } - else: - on_spec = on - return { - "name": name, - "on": on_spec, - "jobs": result, - } diff --git a/scripts/wheelbuilder/wheelbuilder/generator.py b/scripts/wheelbuilder/wheelbuilder/generator.py deleted file mode 100644 index cf824bb5b0..0000000000 --- a/scripts/wheelbuilder/wheelbuilder/generator.py +++ /dev/null @@ -1,181 +0,0 @@ -# Copyright (c) 2023, 2024, Oracle and/or its affiliates. All rights reserved. -# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. -# -# The Universal Permissive License (UPL), Version 1.0 -# -# Subject to the condition set forth below, permission is hereby granted to any -# person obtaining a copy of this software, associated documentation and/or -# data (collectively the "Software"), free of charge and under any and all -# copyright rights in the Software, and any and all patent rights owned or -# freely licensable by each licensor hereunder covering either (i) the -# unmodified Software as contributed to or provided by such licensor, or (ii) -# the Larger Works (as defined below), to deal in both -# -# (a) the Software, and -# -# (b) any piece of software and/or hardware listed in the lrgrwrks.txt file if -# one is included with the Software each a "Larger Work" to which the Software -# is contributed by such licensors), -# -# without restriction, including without limitation the rights to copy, create -# derivative works of, display, perform, and distribute the Software and make, -# use, sell, offer for sale, import, export, have made, and have sold the -# Software and the Larger Work(s), and to sublicense the foregoing rights on -# either these or other terms. -# -# This license is subject to the following condition: -# -# The above copyright notice and either this complete permission notice or at a -# minimum a reference to the UPL must be included in all copies or substantial -# portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -# SOFTWARE. - -import os -import sys -import yaml - -from . import * - - -__all__ = ["generate"] - - -# We tweak pyyaml to produce yaml files formatted like in the Github examples -# for consistency -def literal_str_representer(dumper: yaml.Dumper, data): - if "\n" in data: - return dumper.represent_scalar("tag:yaml.org,2002:str", data, style="|") - else: - return dumper.represent_scalar("tag:yaml.org,2002:str", data) - - -yaml.add_representer(str, literal_str_representer) - - -class IndentedListDumper(yaml.Dumper): - def increase_indent(self, flow=False, indentless=False): - return super().increase_indent(flow, False) - - -def generate(workflow_directory): - # We generate separate workflow files for each platform, because github - # chokes on workflow files with too many jobs - original_platforms = [spec.platforms for spec in BuildSpec.get_instances()] - original_dependencies = [spec.spec_dependencies[:] for spec in BuildSpec.get_instances()] - generated_specs = {} - - for p in PLATFORMS: - unlinked_specs = [] - for spec, (original_platform, original_dep) in zip(BuildSpec.get_instances(), zip(original_platforms, original_dependencies)): - spec.spec_dependencies = original_dep[:] - if p in original_platform: - spec.platforms = [p] - unlinked_specs.append(spec) - else: - spec.platforms = [] - - # We also add needs relationships between all jobs, to make a totally - # ordered queue. This is because there's no good way to limit concurrency - # on github or act, and we do not want to overload our worker - linked_specs = [] - last_spec = None - while unlinked_specs: - made_progress = False - for spec in sorted( - unlinked_specs[:], - key=lambda s: 0 if last_spec in s.spec_dependencies else 1, - ): - if all(dep in linked_specs for dep in spec.spec_dependencies): - made_progress = True - linked_specs.append(spec) - unlinked_specs.remove(spec) - if last_spec and last_spec not in spec.spec_dependencies: - spec.spec_dependencies.append(last_spec) - last_spec = spec - - generated_specs[f"{p.name}-{p.arch}"] = linked_specs - jobs = create_jobs( - linked_specs, f"build-{p.name}-{p.arch}-wheels", "workflow_dispatch" - ) - with open( - os.path.join(workflow_directory, f"build-{p.name}-{p.arch}-wheels.yml"), "w" - ) as f: - f.write(yaml.dump(jobs, Dumper=IndentedListDumper, sort_keys=False)) - - # act workflow for local execution - for spec, original_platform in zip(linked_specs, original_platforms): - spec.platforms = original_platform - spec.get_downstream_specs().clear() - jobs = create_jobs(linked_specs, "build-act-wheels", "workflow_dispatch") - with open(os.path.join(workflow_directory, "build-act-wheels.yml"), "w") as f: - f.write(yaml.dump(jobs, Dumper=IndentedListDumper, sort_keys=False)) - - # generate a workflow to create the repository - repo_job = { - "name": "build-repository", - "on": "workflow_dispatch", - "jobs": { - "build-repo": { - "runs-on": "ubuntu-latest", - "steps": [ - { - "name": "Checkout", - "uses": "actions/checkout@v4", - }, - ] - + [ - { - "name": f"Download artifacts for {p.name}-{p.arch}", - "uses": "dawidd6/action-download-artifact@268677152d06ba59fcec7a7f0b5d961b6ccd7e1e", - "continue-on-error": True, - "with": { - "workflow": f"build-{p.name}-{p.arch}-wheels.yml", - "workflow_conclusion": "", - "if_no_artifact_found": "warn", - "allow_forks": "false", - }, - } - for p in PLATFORMS - ] - + [ - { - "name": "Set up Python", - "uses": "actions/setup-python@v5", - "with": { - "python-version": "3.10", - }, - }, - { - "name": "Create repository", - "run": "python ${GITHUB_WORKSPACE}/scripts/wheelbuilder/generate_repository.py", - }, - { - "name": "Store repository", - "uses": "umutozd/upload-artifact@5c459179e7745e2c730c50b10a6459da0b6f25db", - "with": { - "name": "repository", - "path": "repository.zip", - "if-no-files-found": "error", - }, - }, - ], - }, - }, - } - with open(os.path.join(workflow_directory, "build-repository.yml"), "w") as f: - f.write(yaml.dump(repo_job, Dumper=IndentedListDumper, sort_keys=False)) - - print("Generated specs to build the following packages") - for p, specs in generated_specs.items(): - print( - f"\t{p}\n\t\t", - "\n\t\t".join([s.name for s in specs]), - sep="", - )