Skip to content

Commit 7e5a841

Browse files
huydhnfacebook-github-bot
authored andcommitted
Add nightly build workflow (#2363)
Summary: Onboard ExecuTorch to Nova wheel build workflow https://github.com/pytorch/test-infra/wiki/Using-Nova-Reusable-Build-Workflows. The wheel is built using `python setup.py bdist_wheel`. All the pre-build, post-build, and smoke test scripts are placeholders. Having this will enable the team to easily add more logic into the build scripts later. ### Testing * Linux wheel build https://github.com/pytorch/executorch/actions/runs/8243162791 * macOS wheel build https://github.com/pytorch/executorch/actions/runs/8243162792 Pull Request resolved: #2363 Reviewed By: guangy10 Differential Revision: D54788737 Pulled By: huydhn fbshipit-source-id: 3b1daf8cc6949f5229cd73eedd8db26066669dfc
1 parent 7156f1b commit 7e5a841

File tree

6 files changed

+155
-0
lines changed

6 files changed

+155
-0
lines changed

.github/pytorch-probot.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,5 @@
22
ciflow_push_tags:
33
- ciflow/nightly
44
- ciflow/trunk
5+
- ciflow/binaries
6+
- ciflow/binaries/all
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# From https://github.com/pytorch/test-infra/wiki/Using-Nova-Reusable-Build-Workflows
2+
name: Build Linux Wheels
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- build/packaging/**
8+
- .github/workflows/build-wheels-linux.yml
9+
push:
10+
branches:
11+
- nightly
12+
- release/*
13+
tags:
14+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
15+
# Release candidate tags look like: v1.11.0-rc1
16+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
17+
- ciflow/binaries/*
18+
workflow_dispatch:
19+
20+
jobs:
21+
generate-matrix:
22+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
23+
with:
24+
package-type: wheel
25+
os: linux
26+
test-infra-repository: pytorch/test-infra
27+
test-infra-ref: main
28+
with-cuda: disabled
29+
with-rocm: disabled
30+
31+
build:
32+
needs: generate-matrix
33+
permissions:
34+
id-token: write
35+
contents: read
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
include:
40+
- repository: pytorch/executorch
41+
pre-script: build/packaging/pre_build_script.sh
42+
post-script: build/packaging/post_build_script.sh
43+
smoke-test-script: build/packaging/smoke_test.py
44+
package-name: executorch
45+
name: ${{ matrix.repository }}
46+
uses: pytorch/test-infra/.github/workflows/build_wheels_linux.yml@main
47+
with:
48+
repository: ${{ matrix.repository }}
49+
ref: ""
50+
test-infra-repository: pytorch/test-infra
51+
test-infra-ref: main
52+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
53+
pre-script: ${{ matrix.pre-script }}
54+
post-script: ${{ matrix.post-script }}
55+
package-name: ${{ matrix.package-name }}
56+
smoke-test-script: ${{ matrix.smoke-test-script }}
57+
trigger-event: ${{ github.event_name }}

.github/workflows/build-wheels-m1.yml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
# From https://github.com/pytorch/test-infra/wiki/Using-Nova-Reusable-Build-Workflows
2+
name: Build M1 Wheels
3+
4+
on:
5+
pull_request:
6+
paths:
7+
- build/packaging/**
8+
- .github/workflows/build-wheels-m1.yml
9+
push:
10+
branches:
11+
- nightly
12+
- release/*
13+
tags:
14+
# NOTE: Binary build pipelines should only get triggered on release candidate builds
15+
# Release candidate tags look like: v1.11.0-rc1
16+
- v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+
17+
- ciflow/binaries/*
18+
workflow_dispatch:
19+
20+
jobs:
21+
generate-matrix:
22+
uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main
23+
with:
24+
package-type: wheel
25+
os: macos-arm64
26+
test-infra-repository: pytorch/test-infra
27+
test-infra-ref: main
28+
with-cuda: disabled
29+
with-rocm: disabled
30+
31+
build:
32+
needs: generate-matrix
33+
permissions:
34+
id-token: write
35+
contents: read
36+
strategy:
37+
fail-fast: false
38+
matrix:
39+
include:
40+
- repository: pytorch/executorch
41+
pre-script: build/packaging/pre_build_script.sh
42+
post-script: build/packaging/post_build_script.sh
43+
smoke-test-script: build/packaging/smoke_test.py
44+
package-name: executorch
45+
name: ${{ matrix.repository }}
46+
uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main
47+
with:
48+
repository: ${{ matrix.repository }}
49+
ref: ""
50+
test-infra-repository: pytorch/test-infra
51+
test-infra-ref: main
52+
build-matrix: ${{ needs.generate-matrix.outputs.matrix }}
53+
pre-script: ${{ matrix.pre-script }}
54+
post-script: ${{ matrix.post-script }}
55+
package-name: ${{ matrix.package-name }}
56+
runner-type: macos-m1-stable
57+
smoke-test-script: ${{ matrix.smoke-test-script }}
58+
trigger-event: ${{ github.event_name }}

build/packaging/post_build_script.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -eux
9+
10+
echo "This script is run after building ExecuTorch binaries"

build/packaging/pre_build_script.sh

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
#!/bin/bash
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
set -eux
9+
10+
echo "This script is run before building ExecuTorch binaries"

build/packaging/smoke_test.py

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/usr/bin/env python3
2+
# Copyright (c) Meta Platforms, Inc. and affiliates.
3+
# All rights reserved.
4+
#
5+
# This source code is licensed under the BSD-style license found in the
6+
# LICENSE file in the root directory of this source tree.
7+
8+
9+
def main():
10+
"""
11+
Run ExecuTorch binary smoke tests. This is a placeholder for future tests. See
12+
https://github.com/pytorch/test-infra/wiki/Using-Nova-Reusable-Build-Workflows
13+
for more information about Nova binary workflow.
14+
"""
15+
16+
17+
if __name__ == "__main__":
18+
main()

0 commit comments

Comments
 (0)