Skip to content

Commit

Permalink
setup periodic test to run binary verification  pytorch/pytorch#84764: (
Browse files Browse the repository at this point in the history
#1144)

* add a reusable workflow to run all smoke tests/or smoke tests for a specific os/channel
* add workflows to schedule the periodic smoke tests for nightly and release channels
  • Loading branch information
izaitsevfb committed Sep 22, 2022
1 parent 24d91ba commit b639eb0
Show file tree
Hide file tree
Showing 6 changed files with 220 additions and 66 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/validate-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Validate binaries

# A reusable workflow that triggers a set of jobs that perform a smoke test / validation of pytorch binaries.
# Optionally restricts validation to the specified OS and channel.
# For the details about parameter values, see:
# pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
# For an example of the `workflow_call` usage see:
# https://github.com/pytorch/builder/pull/1144
on:
workflow_call:
inputs:
os:
description: "Operating system to generate for (linux, windows, macos, macos-arm64)"
required: true
type: string
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: string
workflow_dispatch:
inputs:
os:
description: "Operating system to generate for (linux, windows, macos, macos-arm64)"
required: true
type: choice
default: all
options:
- windows
- linux
- macos
- all
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: choice
default: all
options:
- release
- nightly
- test
- all

jobs:
validate-windows-binaries:
if: inputs.os == 'windows' || inputs.os == 'all'
uses: ./.github/workflows/validate-windows-binaries.yml
with:
channel: ${{ inputs.channel }}

validate-linux-binaries:
if: inputs.os == 'linux' || inputs.os == 'all'
uses: ./.github/workflows/validate-linux-binaries.yml
with:
channel: ${{ inputs.channel }}

validate-mac-binaries:
if: inputs.os == 'macos' || inputs.os == 'all'
uses: ./.github/workflows/validate-macos-binaries.yml
with:
channel: ${{ inputs.channel }}
53 changes: 30 additions & 23 deletions .github/workflows/validate-linux-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,42 +1,49 @@
name: Validate linux binaries

on:
push:
branches:
main
paths:
- .github/workflows/validate-linux-binaries.yml
- .test/smoke_test/*
pull_request:
paths:
- .github/workflows/validate-linux-binaries.yml
- .test/smoke_test/*
workflow_call:
inputs:
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: string
workflow_dispatch:
inputs:
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: choice
options:
- release
- nightly
- test
- all

jobs:
generate-conda-matrix:
generate-linux-conda-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: conda
os: linux
channel: nightly
generate-wheel-matrix:
channel: ${{ inputs.channel }}
generate-linux-wheel-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
os: linux
channel: nightly
generate-libtorch-matrix:
channel: ${{ inputs.channel }}
generate-linux-libtorch-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: libtorch
os: linux
channel: nightly

channel: ${{ inputs.channel }}

validate-linux-binaries-conda:
needs: generate-conda-matrix
needs: generate-linux-conda-matrix
strategy:
matrix:
${{ fromJson(needs.generate-conda-matrix.outputs.matrix) }}
${{ fromJson(needs.generate-linux-conda-matrix.outputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.validation_runner }}
steps:
Expand All @@ -48,10 +55,10 @@ jobs:
installation: ${{ matrix.installation }}
python_version: ${{ matrix.python_version }}
validate-linux-binaries-wheels:
needs: generate-wheel-matrix
needs: generate-linux-wheel-matrix
strategy:
matrix:
${{ fromJson(needs.generate-wheel-matrix.outputs.matrix) }}
${{ fromJson(needs.generate-linux-wheel-matrix.outputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.validation_runner }}
steps:
Expand All @@ -63,10 +70,10 @@ jobs:
installation: ${{ matrix.installation }}
python_version: ${{ matrix.python_version }}
validate-linux-libtorch-binaries:
needs: generate-libtorch-matrix
needs: generate-linux-libtorch-matrix
strategy:
matrix:
${{ fromJson(needs.generate-libtorch-matrix.outputs.matrix) }}
${{ fromJson(needs.generate-linux-libtorch-matrix.outputs.matrix) }}
fail-fast: false
runs-on: "ubuntu-20.04"
env:
Expand Down
54 changes: 34 additions & 20 deletions .github/workflows/validate-macos-binaries.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,55 @@
name: Validate MacOS Binaries

on:
pull_request:
paths:
- .github/workflows/validate-macos-binaries.yml
- .test/smoke_test/*
workflow_call:
inputs:
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: string
workflow_dispatch:
inputs:
channel:
description: "Channel to use (nightly, test, release, all)"
required: true
type: choice
options:
- release
- nightly
- test
- all

jobs:
generate-arm64-conda-matrix:
generate-macos-arm64-conda-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: conda
os: macos-arm64
channel: nightly
generate-arm64-wheel-matrix:
channel: ${{ inputs.channel }}
generate-macos-arm64-wheel-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
os: macos-arm64
channel: nightly
generate-x86_64-conda-matrix:
channel: ${{ inputs.channel }}
generate-macos-x86_64-conda-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: conda
os: macos
channel: nightly
generate-x86_64-wheel-matrix:
channel: ${{ inputs.channel }}
generate-macos-x86_64-wheel-matrix:
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
with:
package-type: wheel
os: macos
channel: nightly
channel: ${{ inputs.channel }}

validate-macos-arm64-binaries-conda:
needs: generate-arm64-conda-matrix
needs: generate-macos-arm64-conda-matrix
strategy:
matrix:
${{ fromJson(needs.generate-arm64-conda-matrix.outputs.matrix) }}
${{ fromJson(needs.generate-macos-arm64-conda-matrix.outputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.validation_runner }}
steps:
Expand All @@ -48,10 +62,10 @@ jobs:
python_version: ${{ matrix.python_version }}
target_os: macos
validate-macos-arm64-binaries-wheel:
needs: generate-arm64-wheel-matrix
needs: generate-macos-arm64-wheel-matrix
strategy:
matrix:
${{ fromJson(needs.generate-arm64-wheel-matrix.outputs.matrix) }}
${{ fromJson(needs.generate-macos-arm64-wheel-matrix.outputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.validation_runner }}
steps:
Expand All @@ -64,10 +78,10 @@ jobs:
python_version: ${{ matrix.python_version }}
target_os: macos
validate-macos-x86_64-binaries-conda:
needs: generate-x86_64-conda-matrix
needs: generate-macos-x86_64-conda-matrix
strategy:
matrix:
${{ fromJson(needs.generate-x86_64-conda-matrix.outputs.matrix) }}
${{ fromJson(needs.generate-macos-x86_64-conda-matrix.outputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.validation_runner }}
steps:
Expand All @@ -80,10 +94,10 @@ jobs:
python_version: ${{ matrix.python_version }}
target_os: macos
validate-macos-x86_64-binaries-wheel:
needs: generate-x86_64-wheel-matrix
needs: generate-macos-x86_64-wheel-matrix
strategy:
matrix:
${{ fromJson(needs.generate-x86_64-wheel-matrix.outputs.matrix) }}
${{ fromJson(needs.generate-macos-x86_64-wheel-matrix.outputs.matrix) }}
fail-fast: false
runs-on: ${{ matrix.validation_runner }}
steps:
Expand Down
31 changes: 31 additions & 0 deletions .github/workflows/validate-nightly-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Validate nightly binaries (all OS)

on:
schedule:
# At 2:30 pm UTC (7:30 am PDT)
- cron: "30 14 * * *"
# Have the ability to trigger this job manually through the API
workflow_dispatch:
push:
branches:
main
paths:
- .github/workflows/validate-nightly-binaries.yml
- .github/workflows/validate-linux-binaries.yml
- .github/workflows/validate-windows-binaries.yml
- .github/workflows/validate-macos-binaries.yml
- .test/smoke_test/*
pull_request:
paths:
- .github/workflows/validate-nightly-binaries.yml
- .github/workflows/validate-linux-binaries.yml
- .github/workflows/validate-windows-binaries.yml
- .github/workflows/validate-macos-binaries.yml
- .test/smoke_test/*

jobs:
validate-nightly-binaries:
uses: ./.github/workflows/validate-binaries.yml
with:
channel: nightly
os: all
31 changes: 31 additions & 0 deletions .github/workflows/validate-release-binaries.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Validate release binaries (all OS)

on:
schedule:
# At 3 am and 2 pm UTC (7 am and 8 pm PDT)
- cron: "0 3,14 * * *"
# Have the ability to trigger this job manually through the API
workflow_dispatch:
push:
branches:
main
paths:
- .github/workflows/validate-release-binaries.yml
- .github/workflows/validate-linux-binaries.yml
- .github/workflows/validate-windows-binaries.yml
- .github/workflows/validate-macos-binaries.yml
- .test/smoke_test/*
pull_request:
paths:
- .github/workflows/validate-release-binaries.yml
- .github/workflows/validate-linux-binaries.yml
- .github/workflows/validate-windows-binaries.yml
- .github/workflows/validate-macos-binaries.yml
- .test/smoke_test/*

jobs:
validate-nightly-binaries:
uses: ./.github/workflows/validate-binaries.yml
with:
channel: release
os: all
Loading

0 comments on commit b639eb0

Please sign in to comment.