macos-binary-conda #2801
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# @generated DO NOT EDIT MANUALLY | |
# Template is at: .github/templates/macos_binary_build_workflow.yml.j2 | |
# Generation script: .github/scripts/generate_ci_workflows.py | |
name: macos-binary-conda | |
on: | |
# TODO: Migrate to new ciflow trigger, reference https://github.com/pytorch/pytorch/pull/70321 | |
push: | |
# NOTE: Meta Employees can trigger new nightlies using: https://fburl.com/trigger_pytorch_nightly_build | |
branches: | |
- nightly | |
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]+ | |
- 'ciflow/binaries/*' | |
- 'ciflow/binaries_conda/*' | |
workflow_dispatch: | |
env: | |
# Needed for conda builds | |
ALPINE_IMAGE: "308535385114.dkr.ecr.us-east-1.amazonaws.com/tool/alpine" | |
ANACONDA_USER: pytorch | |
AWS_DEFAULT_REGION: us-east-1 | |
BUILD_ENVIRONMENT: macos-binary-conda | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
SKIP_ALL_TESTS: 1 | |
concurrency: | |
group: macos-binary-conda-${{ github.event.pull_request.number || github.ref_name }}-${{ github.ref_type == 'branch' && github.sha }}-${{ github.event_name == 'workflow_dispatch' }} | |
cancel-in-progress: true | |
jobs: | |
conda-py3_8-cpu-build: | |
if: ${{ github.repository_owner == 'pytorch' }} | |
runs-on: macos-12-xl | |
timeout-minutes: 240 | |
env: | |
PYTORCH_ROOT: ${{ github.workspace }}/pytorch | |
BUILDER_ROOT: ${{ github.workspace }}/builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
SKIP_ALL_TESTS: 1 | |
DESIRED_PYTHON: "3.8" | |
# For sccache access (only on non-forked PRs) | |
AWS_ACCESS_KEY_ID: ${{ secrets.MACOS_SCCACHE_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.MACOS_SCCACHE_S3_SECRET_ACCESS_KEY }} | |
steps: | |
# NOTE: These environment variables are put here so that they can be applied on every job equally | |
# They are also here because setting them at a workflow level doesn't give us access to the | |
# runner.temp variable, which we need. | |
- name: Populate binary env | |
shell: bash | |
run: | | |
# shellcheck disable=SC2129 | |
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "MAC_PACKAGE_WORK_DIR=${RUNNER_TEMP}" >> "${GITHUB_ENV}" | |
- name: Install conda and dependencies | |
run: | | |
# Install conda, setup-miniconda messes with the path that messes with the ruby stuff we do later on | |
curl --retry 3 --retry-all-errors -o "${RUNNER_TEMP}/conda.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-MacOSX-$(uname -m).sh" | |
chmod +x "${RUNNER_TEMP}/conda.sh" | |
/bin/bash "${RUNNER_TEMP}/conda.sh" -b -p "${RUNNER_TEMP}/anaconda" | |
echo "${RUNNER_TEMP}/anaconda/bin" >> "${GITHUB_PATH}" | |
if [ -d "/Applications/Xcode_14.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
elif [ -d "/Applications/Xcode_13.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
fi | |
- name: Checkout PyTorch | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
submodules: recursive | |
path: pytorch | |
quiet-checkout: true | |
- name: Clean PyTorch checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: pytorch | |
- name: Checkout pytorch/builder | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: main | |
submodules: recursive | |
repository: pytorch/builder | |
path: builder | |
quiet-checkout: true | |
- name: Clean pytorch/builder checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: builder | |
- name: Install sccache (only for non-forked PRs, and pushes to trunk) | |
uses: nick-fields/retry@v2.8.2 | |
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} | |
with: | |
timeout_minutes: 5 | |
max_attempts: 3 | |
retry_wait_seconds: 90 | |
command: | | |
sudo curl --retry 3 --retry-all-errors https://s3.amazonaws.com/ossci-macos/sccache_v2.15 --output /usr/local/bin/sccache | |
sudo chmod +x /usr/local/bin/sccache | |
echo "SCCACHE_BUCKET=ossci-compiler-cache-circleci-v2" >> "${GITHUB_ENV}" | |
- name: Populate binary env | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh" | |
- name: Build PyTorch binary | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh" | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: conda-py3_8-cpu | |
retention-days: 14 | |
if-no-files-found: error | |
path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}" | |
conda-py3_8-cpu-upload: # Uploading | |
if: ${{ github.repository_owner == 'pytorch' }} | |
permissions: | |
id-token: write | |
contents: read | |
needs: conda-py3_8-cpu-build | |
with: | |
PYTORCH_ROOT: /pytorch | |
BUILDER_ROOT: /builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
DOCKER_IMAGE: pytorch/conda-builder:cpu-main | |
DESIRED_PYTHON: "3.8" | |
build_name: conda-py3_8-cpu | |
use_s3: False | |
secrets: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} | |
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }} | |
uses: ./.github/workflows/_binary-upload.yml | |
conda-py3_9-cpu-build: | |
if: ${{ github.repository_owner == 'pytorch' }} | |
runs-on: macos-12-xl | |
timeout-minutes: 240 | |
env: | |
PYTORCH_ROOT: ${{ github.workspace }}/pytorch | |
BUILDER_ROOT: ${{ github.workspace }}/builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
SKIP_ALL_TESTS: 1 | |
DESIRED_PYTHON: "3.9" | |
# For sccache access (only on non-forked PRs) | |
AWS_ACCESS_KEY_ID: ${{ secrets.MACOS_SCCACHE_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.MACOS_SCCACHE_S3_SECRET_ACCESS_KEY }} | |
steps: | |
# NOTE: These environment variables are put here so that they can be applied on every job equally | |
# They are also here because setting them at a workflow level doesn't give us access to the | |
# runner.temp variable, which we need. | |
- name: Populate binary env | |
shell: bash | |
run: | | |
# shellcheck disable=SC2129 | |
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "MAC_PACKAGE_WORK_DIR=${RUNNER_TEMP}" >> "${GITHUB_ENV}" | |
- name: Install conda and dependencies | |
run: | | |
# Install conda, setup-miniconda messes with the path that messes with the ruby stuff we do later on | |
curl --retry 3 --retry-all-errors -o "${RUNNER_TEMP}/conda.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-MacOSX-$(uname -m).sh" | |
chmod +x "${RUNNER_TEMP}/conda.sh" | |
/bin/bash "${RUNNER_TEMP}/conda.sh" -b -p "${RUNNER_TEMP}/anaconda" | |
echo "${RUNNER_TEMP}/anaconda/bin" >> "${GITHUB_PATH}" | |
if [ -d "/Applications/Xcode_14.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
elif [ -d "/Applications/Xcode_13.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
fi | |
- name: Checkout PyTorch | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
submodules: recursive | |
path: pytorch | |
quiet-checkout: true | |
- name: Clean PyTorch checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: pytorch | |
- name: Checkout pytorch/builder | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: main | |
submodules: recursive | |
repository: pytorch/builder | |
path: builder | |
quiet-checkout: true | |
- name: Clean pytorch/builder checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: builder | |
- name: Install sccache (only for non-forked PRs, and pushes to trunk) | |
uses: nick-fields/retry@v2.8.2 | |
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} | |
with: | |
timeout_minutes: 5 | |
max_attempts: 3 | |
retry_wait_seconds: 90 | |
command: | | |
sudo curl --retry 3 --retry-all-errors https://s3.amazonaws.com/ossci-macos/sccache_v2.15 --output /usr/local/bin/sccache | |
sudo chmod +x /usr/local/bin/sccache | |
echo "SCCACHE_BUCKET=ossci-compiler-cache-circleci-v2" >> "${GITHUB_ENV}" | |
- name: Populate binary env | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh" | |
- name: Build PyTorch binary | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh" | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: conda-py3_9-cpu | |
retention-days: 14 | |
if-no-files-found: error | |
path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}" | |
conda-py3_9-cpu-upload: # Uploading | |
if: ${{ github.repository_owner == 'pytorch' }} | |
permissions: | |
id-token: write | |
contents: read | |
needs: conda-py3_9-cpu-build | |
with: | |
PYTORCH_ROOT: /pytorch | |
BUILDER_ROOT: /builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
DOCKER_IMAGE: pytorch/conda-builder:cpu-main | |
DESIRED_PYTHON: "3.9" | |
build_name: conda-py3_9-cpu | |
use_s3: False | |
secrets: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} | |
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }} | |
uses: ./.github/workflows/_binary-upload.yml | |
conda-py3_10-cpu-build: | |
if: ${{ github.repository_owner == 'pytorch' }} | |
runs-on: macos-12-xl | |
timeout-minutes: 240 | |
env: | |
PYTORCH_ROOT: ${{ github.workspace }}/pytorch | |
BUILDER_ROOT: ${{ github.workspace }}/builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
SKIP_ALL_TESTS: 1 | |
DESIRED_PYTHON: "3.10" | |
# For sccache access (only on non-forked PRs) | |
AWS_ACCESS_KEY_ID: ${{ secrets.MACOS_SCCACHE_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.MACOS_SCCACHE_S3_SECRET_ACCESS_KEY }} | |
steps: | |
# NOTE: These environment variables are put here so that they can be applied on every job equally | |
# They are also here because setting them at a workflow level doesn't give us access to the | |
# runner.temp variable, which we need. | |
- name: Populate binary env | |
shell: bash | |
run: | | |
# shellcheck disable=SC2129 | |
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "MAC_PACKAGE_WORK_DIR=${RUNNER_TEMP}" >> "${GITHUB_ENV}" | |
- name: Install conda and dependencies | |
run: | | |
# Install conda, setup-miniconda messes with the path that messes with the ruby stuff we do later on | |
curl --retry 3 --retry-all-errors -o "${RUNNER_TEMP}/conda.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-MacOSX-$(uname -m).sh" | |
chmod +x "${RUNNER_TEMP}/conda.sh" | |
/bin/bash "${RUNNER_TEMP}/conda.sh" -b -p "${RUNNER_TEMP}/anaconda" | |
echo "${RUNNER_TEMP}/anaconda/bin" >> "${GITHUB_PATH}" | |
if [ -d "/Applications/Xcode_14.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
elif [ -d "/Applications/Xcode_13.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
fi | |
- name: Checkout PyTorch | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
submodules: recursive | |
path: pytorch | |
quiet-checkout: true | |
- name: Clean PyTorch checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: pytorch | |
- name: Checkout pytorch/builder | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: main | |
submodules: recursive | |
repository: pytorch/builder | |
path: builder | |
quiet-checkout: true | |
- name: Clean pytorch/builder checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: builder | |
- name: Install sccache (only for non-forked PRs, and pushes to trunk) | |
uses: nick-fields/retry@v2.8.2 | |
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} | |
with: | |
timeout_minutes: 5 | |
max_attempts: 3 | |
retry_wait_seconds: 90 | |
command: | | |
sudo curl --retry 3 --retry-all-errors https://s3.amazonaws.com/ossci-macos/sccache_v2.15 --output /usr/local/bin/sccache | |
sudo chmod +x /usr/local/bin/sccache | |
echo "SCCACHE_BUCKET=ossci-compiler-cache-circleci-v2" >> "${GITHUB_ENV}" | |
- name: Populate binary env | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh" | |
- name: Build PyTorch binary | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh" | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: conda-py3_10-cpu | |
retention-days: 14 | |
if-no-files-found: error | |
path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}" | |
conda-py3_10-cpu-upload: # Uploading | |
if: ${{ github.repository_owner == 'pytorch' }} | |
permissions: | |
id-token: write | |
contents: read | |
needs: conda-py3_10-cpu-build | |
with: | |
PYTORCH_ROOT: /pytorch | |
BUILDER_ROOT: /builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
DOCKER_IMAGE: pytorch/conda-builder:cpu-main | |
DESIRED_PYTHON: "3.10" | |
build_name: conda-py3_10-cpu | |
use_s3: False | |
secrets: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} | |
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }} | |
uses: ./.github/workflows/_binary-upload.yml | |
conda-py3_11-cpu-build: | |
if: ${{ github.repository_owner == 'pytorch' }} | |
runs-on: macos-12-xl | |
timeout-minutes: 240 | |
env: | |
PYTORCH_ROOT: ${{ github.workspace }}/pytorch | |
BUILDER_ROOT: ${{ github.workspace }}/builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
SKIP_ALL_TESTS: 1 | |
DESIRED_PYTHON: "3.11" | |
# For sccache access (only on non-forked PRs) | |
AWS_ACCESS_KEY_ID: ${{ secrets.MACOS_SCCACHE_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.MACOS_SCCACHE_S3_SECRET_ACCESS_KEY }} | |
steps: | |
# NOTE: These environment variables are put here so that they can be applied on every job equally | |
# They are also here because setting them at a workflow level doesn't give us access to the | |
# runner.temp variable, which we need. | |
- name: Populate binary env | |
shell: bash | |
run: | | |
# shellcheck disable=SC2129 | |
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "MAC_PACKAGE_WORK_DIR=${RUNNER_TEMP}" >> "${GITHUB_ENV}" | |
- name: Install conda and dependencies | |
run: | | |
# Install conda, setup-miniconda messes with the path that messes with the ruby stuff we do later on | |
curl --retry 3 --retry-all-errors -o "${RUNNER_TEMP}/conda.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-MacOSX-$(uname -m).sh" | |
chmod +x "${RUNNER_TEMP}/conda.sh" | |
/bin/bash "${RUNNER_TEMP}/conda.sh" -b -p "${RUNNER_TEMP}/anaconda" | |
echo "${RUNNER_TEMP}/anaconda/bin" >> "${GITHUB_PATH}" | |
if [ -d "/Applications/Xcode_14.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
elif [ -d "/Applications/Xcode_13.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
fi | |
- name: Checkout PyTorch | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
submodules: recursive | |
path: pytorch | |
quiet-checkout: true | |
- name: Clean PyTorch checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: pytorch | |
- name: Checkout pytorch/builder | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: main | |
submodules: recursive | |
repository: pytorch/builder | |
path: builder | |
quiet-checkout: true | |
- name: Clean pytorch/builder checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: builder | |
- name: Install sccache (only for non-forked PRs, and pushes to trunk) | |
uses: nick-fields/retry@v2.8.2 | |
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} | |
with: | |
timeout_minutes: 5 | |
max_attempts: 3 | |
retry_wait_seconds: 90 | |
command: | | |
sudo curl --retry 3 --retry-all-errors https://s3.amazonaws.com/ossci-macos/sccache_v2.15 --output /usr/local/bin/sccache | |
sudo chmod +x /usr/local/bin/sccache | |
echo "SCCACHE_BUCKET=ossci-compiler-cache-circleci-v2" >> "${GITHUB_ENV}" | |
- name: Populate binary env | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh" | |
- name: Build PyTorch binary | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh" | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: conda-py3_11-cpu | |
retention-days: 14 | |
if-no-files-found: error | |
path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}" | |
conda-py3_11-cpu-upload: # Uploading | |
if: ${{ github.repository_owner == 'pytorch' }} | |
permissions: | |
id-token: write | |
contents: read | |
needs: conda-py3_11-cpu-build | |
with: | |
PYTORCH_ROOT: /pytorch | |
BUILDER_ROOT: /builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
DOCKER_IMAGE: pytorch/conda-builder:cpu-main | |
DESIRED_PYTHON: "3.11" | |
build_name: conda-py3_11-cpu | |
use_s3: False | |
secrets: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} | |
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }} | |
uses: ./.github/workflows/_binary-upload.yml | |
conda-py3_12-cpu-build: | |
if: ${{ github.repository_owner == 'pytorch' }} | |
runs-on: macos-12-xl | |
timeout-minutes: 240 | |
env: | |
PYTORCH_ROOT: ${{ github.workspace }}/pytorch | |
BUILDER_ROOT: ${{ github.workspace }}/builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
SKIP_ALL_TESTS: 1 | |
DESIRED_PYTHON: "3.12" | |
# For sccache access (only on non-forked PRs) | |
AWS_ACCESS_KEY_ID: ${{ secrets.MACOS_SCCACHE_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.MACOS_SCCACHE_S3_SECRET_ACCESS_KEY }} | |
steps: | |
# NOTE: These environment variables are put here so that they can be applied on every job equally | |
# They are also here because setting them at a workflow level doesn't give us access to the | |
# runner.temp variable, which we need. | |
- name: Populate binary env | |
shell: bash | |
run: | | |
# shellcheck disable=SC2129 | |
echo "BINARY_ENV_FILE=${RUNNER_TEMP}/env" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "PYTORCH_FINAL_PACKAGE_DIR=${RUNNER_TEMP}/artifacts" >> "${GITHUB_ENV}" | |
# shellcheck disable=SC2129 | |
echo "MAC_PACKAGE_WORK_DIR=${RUNNER_TEMP}" >> "${GITHUB_ENV}" | |
- name: Install conda and dependencies | |
run: | | |
# Install conda, setup-miniconda messes with the path that messes with the ruby stuff we do later on | |
curl --retry 3 --retry-all-errors -o "${RUNNER_TEMP}/conda.sh" "https://repo.anaconda.com/miniconda/Miniconda3-py310_23.5.2-0-MacOSX-$(uname -m).sh" | |
chmod +x "${RUNNER_TEMP}/conda.sh" | |
/bin/bash "${RUNNER_TEMP}/conda.sh" -b -p "${RUNNER_TEMP}/anaconda" | |
echo "${RUNNER_TEMP}/anaconda/bin" >> "${GITHUB_PATH}" | |
if [ -d "/Applications/Xcode_14.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_14.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
elif [ -d "/Applications/Xcode_13.3.1.app" ]; then | |
echo "DEVELOPER_DIR=/Applications/Xcode_13.3.1.app/Contents/Developer" >> "${GITHUB_ENV}" | |
fi | |
- name: Checkout PyTorch | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }} | |
submodules: recursive | |
path: pytorch | |
quiet-checkout: true | |
- name: Clean PyTorch checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: pytorch | |
- name: Checkout pytorch/builder | |
uses: malfet/checkout@silent-checkout | |
with: | |
ref: main | |
submodules: recursive | |
repository: pytorch/builder | |
path: builder | |
quiet-checkout: true | |
- name: Clean pytorch/builder checkout | |
run: | | |
# Remove any artifacts from the previous checkouts | |
git clean -fxd | |
working-directory: builder | |
- name: Install sccache (only for non-forked PRs, and pushes to trunk) | |
uses: nick-fields/retry@v2.8.2 | |
if: ${{ github.event_name == 'push' || github.event.pull_request.head.repo.full_name == github.repository }} | |
with: | |
timeout_minutes: 5 | |
max_attempts: 3 | |
retry_wait_seconds: 90 | |
command: | | |
sudo curl --retry 3 --retry-all-errors https://s3.amazonaws.com/ossci-macos/sccache_v2.15 --output /usr/local/bin/sccache | |
sudo chmod +x /usr/local/bin/sccache | |
echo "SCCACHE_BUCKET=ossci-compiler-cache-circleci-v2" >> "${GITHUB_ENV}" | |
- name: Populate binary env | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_populate_env.sh" | |
- name: Build PyTorch binary | |
run: | | |
# shellcheck disable=SC1091 | |
source "${RUNNER_TEMP}/anaconda/bin/activate" | |
"${PYTORCH_ROOT}/.circleci/scripts/binary_macos_build.sh" | |
- uses: actions/upload-artifact@v3 | |
if: always() | |
with: | |
name: conda-py3_12-cpu | |
retention-days: 14 | |
if-no-files-found: error | |
path: "${{ env.PYTORCH_FINAL_PACKAGE_DIR }}" | |
conda-py3_12-cpu-upload: # Uploading | |
if: ${{ github.repository_owner == 'pytorch' }} | |
permissions: | |
id-token: write | |
contents: read | |
needs: conda-py3_12-cpu-build | |
with: | |
PYTORCH_ROOT: /pytorch | |
BUILDER_ROOT: /builder | |
PACKAGE_TYPE: conda | |
# TODO: This is a legacy variable that we eventually want to get rid of in | |
# favor of GPU_ARCH_VERSION | |
DESIRED_CUDA: cpu | |
GPU_ARCH_TYPE: cpu | |
DOCKER_IMAGE: pytorch/conda-builder:cpu-main | |
DESIRED_PYTHON: "3.12" | |
build_name: conda-py3_12-cpu | |
use_s3: False | |
secrets: | |
github-token: ${{ secrets.GITHUB_TOKEN }} | |
conda-pytorchbot-token: ${{ secrets.CONDA_PYTORCHBOT_TOKEN }} | |
conda-pytorchbot-token-test: ${{ secrets.CONDA_PYTORCHBOT_TOKEN_TEST }} | |
uses: ./.github/workflows/_binary-upload.yml |