From 9e9ca1f6bf00050ab45eac8b63d22a0a3f388f50 Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Fri, 14 Apr 2023 12:25:58 -0700 Subject: [PATCH 1/3] [NovaX] MacOs x86 Builds on GHA Nova --- .github/workflows/build-conda-macos.yml | 42 ++++++++++++++++++++++++ .github/workflows/build-wheels-macos.yml | 42 ++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 .github/workflows/build-conda-macos.yml create mode 100644 .github/workflows/build-wheels-macos.yml diff --git a/.github/workflows/build-conda-macos.yml b/.github/workflows/build-conda-macos.yml new file mode 100644 index 000000000..2b706e964 --- /dev/null +++ b/.github/workflows/build-conda-macos.yml @@ -0,0 +1,42 @@ +name: Build Macos Conda + +on: + pull_request: + push: + branches: + - nightly + - main + - release/* + tags: + # NOTE: Binary build pipelines should only get triggered on release candidate builds + # Release candidate tags look like: v1.11.0-rc1 + - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ + workflow_dispatch: + +jobs: + generate-matrix: + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + with: + package-type: conda + os: macos + test-infra-repository: pytorch/test-infra + test-infra-ref: main + build: + needs: generate-matrix + name: pytorch/data + uses: pytorch/test-infra/.github/workflows/build_conda_macos.yml@main + with: + conda-package-directory: packaging/torchdata + repository: pytorch/data + ref: "" + test-infra-repository: pytorch/test-infra + test-infra-ref: main + build-matrix: ${{ needs.generate-matrix.outputs.matrix }} + pre-script: "" + post-script: "" + package-name: torchdata + smoke-test-script: test/smoke_test.py + runner-type: macos-12 + trigger-event: dev + secrets: + CONDA_PYTORCHBOT_TOKEN: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} diff --git a/.github/workflows/build-wheels-macos.yml b/.github/workflows/build-wheels-macos.yml new file mode 100644 index 000000000..0eff0a06c --- /dev/null +++ b/.github/workflows/build-wheels-macos.yml @@ -0,0 +1,42 @@ +name: Build Macos Wheels + +on: + pull_request: + push: + branches: + - nightly + - main + - release/* + tags: + # NOTE: Binary build pipelines should only get triggered on release candidate builds + # Release candidate tags look like: v1.11.0-rc1 + - v[0-9]+.[0-9]+.[0-9]+-rc[0-9]+ + workflow_dispatch: + +jobs: + generate-matrix: + uses: pytorch/test-infra/.github/workflows/generate_binary_build_matrix.yml@main + with: + package-type: wheel + os: macos + test-infra-repository: pytorch/test-infra + test-infra-ref: main + build: + needs: generate-matrix + name: pytorch/data + uses: pytorch/test-infra/.github/workflows/build_wheels_macos.yml@main + with: + repository: pytorch/data + ref: "" + test-infra-repository: pytorch/test-infra + test-infra-ref: main + build-matrix: ${{ needs.generate-matrix.outputs.matrix }} + pre-script: "" + post-script: "" + package-name: torchdata + runner-type: macos-12 + smoke-test-script: test/smoke_test.py + trigger-event: dev + secrets: + AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID: ${{ secrets.AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID }} + AWS_PYTORCH_UPLOADER_SECRET_ACCESS_KEY: ${{ secrets.AWS_PYTORCH_UPLOADER_SECRET_ACCESS_KEY }} From d7ab504d648fa6e9ae27ad6561d97ccdedc2af37 Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Fri, 14 Apr 2023 12:34:29 -0700 Subject: [PATCH 2/3] fix env vars and smoke testing --- .github/workflows/build-conda-macos.yml | 3 ++- .github/workflows/build-wheels-macos.yml | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build-conda-macos.yml b/.github/workflows/build-conda-macos.yml index 2b706e964..19e9500fe 100644 --- a/.github/workflows/build-conda-macos.yml +++ b/.github/workflows/build-conda-macos.yml @@ -35,7 +35,8 @@ jobs: pre-script: "" post-script: "" package-name: torchdata - smoke-test-script: test/smoke_test.py + env-var-script: packaging/env-var-script.txt + smoke-test-script: test/smoke_test/smoke_test.py runner-type: macos-12 trigger-event: dev secrets: diff --git a/.github/workflows/build-wheels-macos.yml b/.github/workflows/build-wheels-macos.yml index 0eff0a06c..9e9d2a360 100644 --- a/.github/workflows/build-wheels-macos.yml +++ b/.github/workflows/build-wheels-macos.yml @@ -34,8 +34,9 @@ jobs: pre-script: "" post-script: "" package-name: torchdata + env-var-script: packaging/env-var-script.txt runner-type: macos-12 - smoke-test-script: test/smoke_test.py + smoke-test-script: test/smoke_test/smoke_test.py trigger-event: dev secrets: AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID: ${{ secrets.AWS_PYTORCH_UPLOADER_ACCESS_KEY_ID }} From f9a34bb5194142fc900d795a16537f73bddd1590 Mon Sep 17 00:00:00 2001 From: Omkar Salpekar Date: Mon, 24 Apr 2023 16:52:06 -0700 Subject: [PATCH 3/3] macos-specific pre build script --- .github/workflows/build-wheels-macos.yml | 2 +- packaging/pre_build_script_macos.sh | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) create mode 100644 packaging/pre_build_script_macos.sh diff --git a/.github/workflows/build-wheels-macos.yml b/.github/workflows/build-wheels-macos.yml index 9e9d2a360..a4c488481 100644 --- a/.github/workflows/build-wheels-macos.yml +++ b/.github/workflows/build-wheels-macos.yml @@ -31,7 +31,7 @@ jobs: test-infra-repository: pytorch/test-infra test-infra-ref: main build-matrix: ${{ needs.generate-matrix.outputs.matrix }} - pre-script: "" + pre-script: pre_build_script_macos.sh post-script: "" package-name: torchdata env-var-script: packaging/env-var-script.txt diff --git a/packaging/pre_build_script_macos.sh b/packaging/pre_build_script_macos.sh new file mode 100644 index 000000000..962337258 --- /dev/null +++ b/packaging/pre_build_script_macos.sh @@ -0,0 +1,5 @@ +set -euxo pipefail + +pip install cmake ninja +echo "/home/runner/.local/bin" >> "$GITHUB_PATH" +echo $PATH