Skip to content

Commit

Permalink
Hack through pkgci to run new tests using runtime packages from source.
Browse files Browse the repository at this point in the history
  • Loading branch information
ScottTodd committed Jul 24, 2024
1 parent 923b00a commit 23bb428
Show file tree
Hide file tree
Showing 4 changed files with 60 additions and 32 deletions.
38 changes: 22 additions & 16 deletions .github/workflows/pkgci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,20 +37,26 @@ jobs:
with:
package_version: 0.dev1

unit_test:
name: Unit Test
core_tests:
name: Core Tests
needs: [setup, build_packages]
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'unit_test')
uses: ./.github/workflows/pkgci_unit_test.yml

regression_test:
name: Regression Test
needs: [setup, build_packages]
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'regression_test')
uses: ./.github/workflows/pkgci_regression_test.yml

test_tensorflow_cpu:
name: Test TensorFlow CPU
needs: [setup, build_packages]
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'test_tensorflow_cpu')
uses: ./.github/workflows/pkgci_test_tensorflow_cpu.yml
if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'core_tests')
uses: ./.github/workflows/pkgci_core_tests.yml

# unit_test:
# name: Unit Test
# needs: [setup, build_packages]
# if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'unit_test')
# uses: ./.github/workflows/pkgci_unit_test.yml

# regression_test:
# name: Regression Test
# needs: [setup, build_packages]
# if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'regression_test')
# uses: ./.github/workflows/pkgci_regression_test.yml

# test_tensorflow_cpu:
# name: Test TensorFlow CPU
# needs: [setup, build_packages]
# if: contains(fromJson(needs.setup.outputs.enabled-jobs), 'test_tensorflow_cpu')
# uses: ./.github/workflows/pkgci_test_tensorflow_cpu.yml
11 changes: 2 additions & 9 deletions .github/workflows/pkgci_build_packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,7 @@ on:
jobs:
linux_x86_64_release_packages:
name: Linux Release (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
runs-on: ubuntu-20.04
env:
CACHE_DIR: ${{ github.workspace }}/.iree-container-cache
MANYLINUX_DOCKER_IMAGE: ghcr.io/nod-ai/manylinux_x86_64:main
Expand Down Expand Up @@ -65,7 +58,7 @@ jobs:
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-runtime"
export packages="iree-runtime"
./build_tools/pkgci/build_linux_packages.sh
# Some things put stuff in cache with weird, root read-only
# permissions. Take them back.
Expand Down
41 changes: 35 additions & 6 deletions .github/workflows/pkgci_core_tests.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,21 @@
# Copyright 2024 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 core tests
on:
pull_request:
paths:
- ".github/workflows/pkgci_core_tests.yml"
workflow_call:
inputs:
artifact_run_id:
type: string
default: ""
workflow_dispatch:
inputs:
artifact_run_id:
type: string
default: ""

concurrency:
# A PR number if a pull request and otherwise the commit hash. This cancels
Expand All @@ -17,6 +29,7 @@ jobs:
core_tests:
runs-on: ubuntu-20.04
env:
PACKAGE_DOWNLOAD_DIR: ${{ github.workspace }}/.packages
BUILD_DIR: build-tests
VENV_DIR: ${{ github.workspace }}/.venv
steps:
Expand All @@ -34,21 +47,37 @@ jobs:
uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: "Setup Python venv"
run: python3 -m venv ${VENV_DIR}
- uses: actions/download-artifact@v4.1.7
with:
name: linux_x86_64_release_packages
path: ${{ env.PACKAGE_DOWNLOAD_DIR }}
- name: Setup base venv
run: |
./build_tools/pkgci/setup_venv.py ${VENV_DIR} \
--artifact-path=${PACKAGE_DOWNLOAD_DIR} \
--fetch-gh-workflow=${{ inputs.artifact_run_id }}
- name: "Installing IREE nightly release Python packages"
run: |
source ${VENV_DIR}/bin/activate
python3 -m pip install \
--find-links https://iree.dev/pip-release-links.html \
iree-compiler iree-runtime
iree-compiler
# - name: "Setup Python venv"
# run: python3 -m venv ${VENV_DIR}
# - name: "Installing IREE nightly release Python packages"
# run: |
# source ${VENV_DIR}/bin/activate
# python3 -m pip install \
# --find-links https://iree.dev/pip-release-links.html \
# iree-compiler iree-runtime
- name: "Building tests"
run: |
source ${VENV_DIR}/bin/activate
./build_tools/pkgci/build_tests_using_package.sh ${VENV_DIR}/bin
- name: "Running tests"
env:
IREE_EXTRA_COMMA_SEPARATED_CTEST_LABELS_TO_EXCLUDE: test-type=lit-test
# this will run GPU tests in other jobs
run: |
source ${VENV_DIR}/bin/activate
./build_tools/cmake/ctest_all.sh ${BUILD_DIR}
2 changes: 1 addition & 1 deletion build_tools/pkgci/setup_venv.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ def main(args):
artifact_prefix = f"{platform.system().lower()}_{platform.machine()}"
wheels = []
for package_stem, variant in [
("iree-compiler", args.compiler_variant),
# ("iree-compiler", args.compiler_variant),
("iree-runtime", args.runtime_variant),
]:
wheels.append(
Expand Down

0 comments on commit 23bb428

Please sign in to comment.