blob: e312fcc086e38250c06668b822941c7a59bf1fc9 [file] [log] [blame]
# 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
submodules: true
- name: Setup Python
uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # 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@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
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
# - runner-group=${{ github.event_name == 'pull_request' && 'presubmit' || 'postsubmit' }}
# - 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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
# 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@88522ab9f39a2ea568f7027eddc7d8d8bc9d59c8 # v3.3.1
# 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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
# with:
# name: linux_x86_64_release_asserts_packages
# path: |
# ${{ github.workspace }}/wheelhouse/iree*.whl
# if-no-files-found: error