Skip to content

Commit

Permalink
[CI] Add AArch64 builder
Browse files Browse the repository at this point in the history
  • Loading branch information
powderluv authored and github-actions[bot] committed Jun 8, 2023
1 parent 5852224 commit c07e52d
Show file tree
Hide file tree
Showing 2 changed files with 58 additions and 104 deletions.
93 changes: 58 additions & 35 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,11 @@ jobs:
matrix:
include:
# Ubuntu packages.
- runs-on: ubuntu-latest
build-family: linux
build-package: main-dist-linux
experimental: false
- runs-on: ubuntu-latest
- runs-on: icelake
build-family: linux
build-package: py-compiler-pkg
experimental: false
- runs-on: ubuntu-latest
- runs-on: icelake
build-family: linux
build-package: py-runtime-pkg
experimental: false
Expand All @@ -64,17 +60,34 @@ jobs:
build-package: py-compiler-pkg
experimental: true

# Linux AArch64 packages.
- runs-on: linux-aarch64
build-family: linux-aarch64
build-package: py-compiler-pkg
experimental: false
- runs-on: linux-aarch64
build-family: linux-aarch64
build-package: py-runtime-pkg
experimental: false


env:
MANYLINUX_X86_64_IMAGE: gcr.io/iree-oss/manylinux2014_x86_64-release@sha256:794513562cca263480c0c169c708eec9ff70abfe279d6dc44e115b04488b9ab5
MANYLINUX_AARCH64_IMAGE: quay.io/pypa/manylinux_2_28_aarch64

steps:
# Docker may leave root owned files
- name: Chown user
if: "matrix.build-family == 'linux-aarch64' || matrix.build-family == 'linux'"
run: |
sudo chown -R $USER:$USER $GITHUB_WORKSPACE
- uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
path: "c"
submodules: true
ref: ${{ github.event.inputs.commit }}
- uses: actions/setup-python@v4
if: "matrix.build-family != 'macos'"
if: "matrix.build-family == 'windows'"
with:
python-version: '3.11'

Expand Down Expand Up @@ -118,39 +131,28 @@ jobs:
more version_info.json
cd ..
##########################################################################
# Build the main distribution tarball.
# The main distribution consists of the project being built, installed
# and archived. We have to split it per operating system, and Linux
# is special because we build under a manylinux container which gives
# broad compatibility. We use the Python based manylinux containers
# since they come packaged with all dev tools we need. Note that the
# manylinux containers have a default python 2.x with all supported
# python versions under /opt/python (need to add one to the path). It
# is not enough to just invoke it directly because then pip managed
# console scripts (like cmake, ninja) will not be on the path.
##########################################################################
- name: Main distribution (Linux)
if: "matrix.build-package == 'main-dist-linux'"
shell: bash
run: |
docker run --rm -w=/work \
-v $PWD:/work \
"${MANYLINUX_X86_64_IMAGE}" \
bash -c 'export PATH=/opt/python/cp39-cp39/bin:$PATH; python ./c/build_tools/github_actions/build_dist.py main-dist'
##########################################################################
# py-runtime-pkg
# Builds the iree-runtime and iree-runtime-instrumented wheels.
# One step per OS.
##########################################################################

- name: Build runtime wheels (Linux)
- name: Build runtime wheels (Linux-x86_64)
if: "matrix.build-package == 'py-runtime-pkg' && matrix.build-family == 'linux'"
shell: bash
env:
package_suffix: ${{ github.event.inputs.package_suffix }}
packages: "iree-runtime iree-runtime-instrumented"
packages: "iree-runtime"
output_dir: "${{ github.workspace }}/bindist"
run: |
./c/build_tools/python_deploy/build_linux_packages.sh
- name: Build runtime wheels (Linux-AArch64)
if: "matrix.build-package == 'py-runtime-pkg' && matrix.build-family == 'linux-aarch64'"
shell: bash
env:
package_suffix: ${{ github.event.inputs.package_suffix }}
packages: "iree-runtime"
output_dir: "${{ github.workspace }}/bindist"
run: |
./c/build_tools/python_deploy/build_linux_packages.sh
Expand All @@ -160,7 +162,7 @@ jobs:
shell: bash
env:
package_suffix: ${{ github.event.inputs.package_suffix }}
packages: "iree-runtime iree-runtime-instrumented"
packages: "iree-runtime"
output_dir: "${{ github.workspace }}/bindist"
override_python_versions: "3.11"
run: |
Expand All @@ -182,6 +184,16 @@ jobs:
run: |
./c/build_tools/python_deploy/build_linux_packages.sh
- name: Build compiler wheels (Linux-AArch64)
if: "matrix.build-package == 'py-compiler-pkg' && matrix.build-family == 'linux-aarch64'"
shell: bash
env:
package_suffix: ${{ github.event.inputs.package_suffix }}
packages: "iree-compiler"
output_dir: "${{ github.workspace }}/bindist"
run: |
./c/build_tools/python_deploy/build_linux_packages.sh
- name: Build compiler wheels (MacOS)
if: "matrix.build-package == 'py-compiler-pkg' && matrix.build-family == 'macos'"
shell: bash
Expand Down Expand Up @@ -228,16 +240,27 @@ jobs:
retention-days: 5

# TODO: Upload the tar.bz2 files too when ready
- name: Upload Release Assets
if: github.event.inputs.release_id != ''
id: upload-release-assets
- name: Upload Release Assets (Compiler)
if: "github.event.inputs.release_id != '' && matrix.build-package == 'py-compiler-pkg'"
id: upload-release-assets-compiler
uses: dwenegar/upload-release-assets@5bc3024cf83521df8ebfadf00ad0c4614fd59148 # v1
env:
GITHUB_TOKEN: ${{ secrets.WRITE_ACCESS_TOKEN }}
with:
release_id: ${{ github.event.inputs.release_id }}
# Only upload iree artifacts.
assets_path: ./bindist/iree_compiler*.*

- name: Upload Release Assets (Runtime)
if: "github.event.inputs.release_id != '' && matrix.build-package == 'py-runtime-pkg'"
id: upload-release-assets-runtime
uses: dwenegar/upload-release-assets@5bc3024cf83521df8ebfadf00ad0c4614fd59148 # v1
env:
GITHUB_TOKEN: ${{ secrets.WRITE_ACCESS_TOKEN }}
with:
release_id: ${{ github.event.inputs.release_id }}
# Only upload iree artifacts.
assets_path: ./bindist/iree*.*
assets_path: ./bindist/iree_runtime*.*

validate_and_publish:
name: "Invoke workflow to validate and publish release"
Expand Down
69 changes: 0 additions & 69 deletions .github/workflows/validate_and_publish_release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,63 +16,8 @@ on:
required: true

jobs:
validate_packages:
name: "Validate packages"
# TODO(jennik): Look into testing windows and macos builds.
runs-on: ubuntu-20.04
steps:
- name: Download packages
id: download_packages
uses: dawidd6/action-download-artifact@5e780fc7bbd0cac69fc73271ed86edf5dcb72d67 # v2.26.0
with:
github_token: ${{secrets.WRITE_ACCESS_TOKEN}}
workflow: build_package.yml
run_id: ${{ github.event.inputs.build_run_id }}
- name: Extract and display downloaded files
run: |
tar -xf artifact/iree-dist-${{ github.event.inputs.package_version }}-linux-x86_64.tar.xz
pwd
ls -R
- name: Set up python
id: set_up_python
uses: actions/setup-python@d27e3f3d7c64b4bbf8e4abfb9b63b83e846e0435 # v4.5.0
with:
python-version: "3.8"
- name: Install python packages
id: install_python_packages
run: |
python -m pip install -f file://$PWD/artifact/ iree-compiler iree-runtime iree-tools-tflite iree-tools-tf
- name: Run iree-benchmark-module
id: run_iree_benchmark_module
run: ./bin/iree-benchmark-module --help
- name: Run iree-benchmark-trace
id: run_iree_benchmark_trace
run: ./bin/iree-benchmark-trace --help
- name: Run iree-flatcc-cli
id: run_iree_flatcc_cli
run: ./bin/iree-flatcc-cli --help
- name: Run iree-opt
id: run_iree_opt
run: ./bin/iree-opt --help
- name: Run iree-run-mlir
id: run_iree_run_mlir
run: ./bin/iree-run-mlir --help
- name: Run iree-run-module
id: run_iree_run_module
run: ./bin/iree-run-module --help
- name: Run iree-run-trace
id: run_iree_run_trace
run: ./bin/iree-run-trace --help
- name: Run iree-tblgen
id: run_iree_tblgen
run: ./bin/iree-tblgen --help
- name: Run iree-compile
id: run_iree-compile
run: ./bin/iree-compile --help

publish_release:
name: "Publish release"
needs: validate_packages
runs-on: ubuntu-20.04
steps:
- name: Publish Release
Expand All @@ -83,17 +28,3 @@ jobs:
with:
release_id: ${{ github.event.inputs.release_id }}

- name: Checking out repository
uses: actions/checkout@8f4b7f84864484a7bf31766abe9204da3cbe65b3 # v3.5.0
with:
token: ${{ secrets.WRITE_ACCESS_TOKEN }}
# Get all history. Otherwise the latest-snapshot branch can't be
# fast-forwarded.
fetch-depth: 0

- name: Updating latest-snapshot branch
uses: ad-m/github-push-action@40bf560936a8022e68a3c00e7d2abefaf01305a6 # v0.6.0
with:
github_token: ${{ secrets.WRITE_ACCESS_TOKEN }}
branch: latest-snapshot
force: true

0 comments on commit c07e52d

Please sign in to comment.