| # Copyright 2023 The IREE Authors | |
| # | |
| # Licensed under the Apache License v2.0 with LLVM Exceptions. | |
| # See https://llvm.org/LICENSE.txt for license information. | |
| # SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | |
| name: PkgCI Build Packages | |
| on: | |
| workflow_call: | |
| jobs: | |
| linux_x86_64_release_packages: | |
| name: Linux Release (x86_64) | |
| runs-on: azure-linux-scale | |
| strategy: | |
| fail-fast: false | |
| env: | |
| CACHE_DIR: ${{ github.workspace }}/.iree-container-cache | |
| MANYLINUX_DOCKER_IMAGE: ghcr.io/iree-org/manylinux_x86_64@sha256:2e0246137819cf10ed84240a971f9dd75cc3eb62dc6907dfd2080ee966b3c9f4 | |
| PACKAGE_SUFFIX: "" | |
| steps: | |
| - name: Prefetch Docker | |
| run: | | |
| docker pull "$MANYLINUX_DOCKER_IMAGE" & | |
| - name: Checking out repository | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| submodules: true | |
| - name: Setup Python | |
| uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v5.3.3 | |
| with: | |
| python-version: 3.12 | |
| cache: "pip" | |
| - name: Install Python packages | |
| run: | | |
| pip install packaging | |
| pip freeze | |
| - name: Write version info | |
| shell: bash | |
| run: | | |
| package_version="$(python3 build_tools/python_deploy/compute_common_version.py -dev)" | |
| cat << EOF > version_info.json | |
| { | |
| "package-suffix": "${PACKAGE_SUFFIX}", | |
| "package-version": "${package_version}", | |
| "iree-revision": "$(cd ../iree && git rev-parse HEAD)" | |
| } | |
| EOF | |
| realpath version_info.json | |
| cat version_info.json | |
| echo | |
| compiler_package_version="$(python3 build_tools/python_deploy/compute_local_version.py compiler -dev)" | |
| cat << EOF > compiler/version_local.json | |
| { | |
| "package-suffix": "${PACKAGE_SUFFIX}", | |
| "package-version": "${compiler_package_version}", | |
| "iree-revision": "$(cd ../iree && git rev-parse HEAD)" | |
| } | |
| EOF | |
| realpath compiler/version_local.json | |
| cat compiler/version_local.json | |
| echo | |
| runtime_package_version="$(python3 build_tools/python_deploy/compute_local_version.py runtime -dev)" | |
| cat << EOF > runtime/version_local.json | |
| { | |
| "package-suffix": "${PACKAGE_SUFFIX}", | |
| "package-version": "${runtime_package_version}", | |
| "iree-revision": "$(cd ../iree && git rev-parse HEAD)" | |
| } | |
| EOF | |
| realpath runtime/version_local.json | |
| cat runtime/version_local.json | |
| - name: Enable cache | |
| uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| with: | |
| path: ${{ env.CACHE_DIR }} | |
| key: iree-pkgci-linux-release-x86_64-v1-${{ github.sha }} | |
| restore-keys: | | |
| iree-pkgci-linux-release-x86_64-v1- | |
| - name: Wait for docker pull | |
| run: | | |
| wait | |
| - name: Build | |
| run: | | |
| export cache_dir="${{ env.CACHE_DIR }}" | |
| export output_dir="${{ github.workspace }}/wheelhouse" | |
| export toolchain_suffix=release | |
| export manylinux_docker_image="$MANYLINUX_DOCKER_IMAGE" | |
| export package_suffix="$PACKAGE_SUFFIX" | |
| # If just iterating locally, uncomment this to build a cheap wheel. | |
| # export packages="iree-base-runtime" | |
| ./build_tools/pkgci/build_linux_packages.sh | |
| # Some things put stuff in cache with weird, root read-only | |
| # permissions. Take them back. | |
| sudo chown -R "$(whoami)" "${cache_dir}" | |
| - name: Upload wheel artifacts | |
| uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| with: | |
| name: linux_x86_64_release_packages | |
| path: | | |
| ${{ github.workspace }}/wheelhouse/iree*.whl | |
| if-no-files-found: error | |
| # TODO: Debug low ccache hit rate and re-enable. | |
| # linux_x86_64_release_asserts_packages: | |
| # name: Linux Release Asserts (x86_64) | |
| # runs-on: | |
| # - self-hosted # must come first | |
| # - environment=prod | |
| # - cpu | |
| # - os-family=Linux | |
| # strategy: | |
| # fail-fast: false | |
| # env: | |
| # CACHE_DIR: ${{ github.workspace }}/.iree-container-cache | |
| # MANYLINUX_DOCKER_IMAGE: ghcr.io/iree-org/manylinux_x86_64@sha256:2e0246137819cf10ed84240a971f9dd75cc3eb62dc6907dfd2080ee966b3c9f4 | |
| # PACKAGE_SUFFIX: "-asserts" | |
| # steps: | |
| # - name: Prefetch Docker | |
| # run: | | |
| # docker pull "$MANYLINUX_DOCKER_IMAGE" & | |
| # - name: "Checking out repository" | |
| # uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| # with: | |
| # submodules: true | |
| # - name: Write version info | |
| # shell: bash | |
| # run: | | |
| # cat << EOF > version_info.json | |
| # { | |
| # "package-suffix": "${PACKAGE_SUFFIX}", | |
| # "package-version": "${{ inputs.package_version }}", | |
| # "iree-revision": "$(cd ../iree && git rev-parse HEAD)" | |
| # } | |
| # EOF | |
| # realpath version_info.json | |
| # cat version_info.json | |
| # - name: Enable cache | |
| # uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0 | |
| # with: | |
| # path: ${{ env.CACHE_DIR }} | |
| # key: iree-pkgci-linux-release-asserts-x86_64-v1-${{ github.sha }} | |
| # restore-keys: | | |
| # iree-pkgci-linux-release-asserts-x86_64-v1- | |
| # - name: Wait for docker pull | |
| # run: | | |
| # wait | |
| # - name: Build | |
| # run: | | |
| # export cache_dir="${{ env.CACHE_DIR }}" | |
| # export output_dir="${{ github.workspace }}/wheelhouse" | |
| # export toolchain_suffix=release_asserts | |
| # export manylinux_docker_image="$MANYLINUX_DOCKER_IMAGE" | |
| # export package_suffix="$PACKAGE_SUFFIX" | |
| # # If just iterating locally, uncomment this to build a cheap wheel. | |
| # # export packages="iree-base-runtime" | |
| # ./build_tools/pkgci/build_linux_packages.sh | |
| # # Some things put stuff in cache with weird, root read-only | |
| # # permissions. Take them back. | |
| # sudo chown -R "$(whoami)" "${cache_dir}" | |
| # - name: Upload wheel artifacts | |
| # uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1 | |
| # with: | |
| # name: linux_x86_64_release_asserts_packages | |
| # path: | | |
| # ${{ github.workspace }}/wheelhouse/iree*.whl | |
| # if-no-files-found: error |