Look at open github issues to decide which OSS CI tests to skip (#3157) #546
This file contains hidden or 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
| name: Build and publish nightly monarch wheels | |
| on: | |
| workflow_dispatch: | |
| # For testing changes to this workflow. | |
| pull_request: | |
| branches: | |
| - main | |
| - gh/** | |
| paths: | |
| - .github/workflows/wheels.yml | |
| - .github/workflows/build-dist.yml | |
| - Dockerfile.nightly | |
| push: | |
| branches: | |
| - main | |
| # Run as soon as any changes to .github actions land | |
| paths: | |
| - .github/** | |
| schedule: | |
| - cron: '0 0 * * *' # Daily at midnight UTC | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref == 'refs/heads/main' && github.run_number || github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-x86_64: | |
| uses: ./.github/workflows/build-dist.yml | |
| with: | |
| python-versions: '["3.10", "3.11", "3.12", "3.13"]' | |
| runner: linux.g5.4xlarge.nvidia.gpu | |
| torch-spec: '--pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu128' | |
| gpu-arch-type: cuda | |
| gpu-arch-version: '12.8' | |
| platform: x86_64 | |
| build-arm64: | |
| uses: ./.github/workflows/build-dist.yml | |
| with: | |
| python-versions: '["3.10", "3.11", "3.12", "3.13"]' | |
| runner: linux.arm64.2xlarge | |
| docker-image: 'pytorch/manylinuxaarch64-builder:cuda12.8' | |
| torch-spec: '--pre torch --extra-index-url https://download.pytorch.org/whl/nightly/cu128' | |
| gpu-arch-type: cuda | |
| gpu-arch-version: '12.8' | |
| platform: aarch64 | |
| publish-to-pypi: | |
| name: Publish to PyPI | |
| needs: [build-x86_64, build-arm64] | |
| runs-on: ubuntu-latest | |
| environment: nightly | |
| if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
| permissions: | |
| id-token: write # Required for PyPI trusted publishing | |
| contents: read | |
| steps: | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| path: dist | |
| merge-multiple: true | |
| - name: Display structure of downloaded files | |
| run: ls -R dist/ | |
| - name: Publish to PyPI | |
| uses: pypa/gh-action-pypi-publish@release/v1 | |
| with: | |
| verbose: true | |
| publish-to-container-registry: | |
| name: Publish to Github Container Registry | |
| needs: [build-x86_64, build-arm64] | |
| runs-on: ubuntu-latest | |
| environment: nightly | |
| if: ${{ github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' }} | |
| permissions: | |
| contents: read | |
| packages: write # Grant write permission for packages (GHCR) | |
| steps: | |
| # This step is required to avoid the "no space left on device" error from | |
| # the large pytorch docker image. | |
| - name: Free Disk Space (Ubuntu) | |
| uses: jlumbroso/free-disk-space@v1.3.1 | |
| - name: Checkout repository | |
| uses: actions/checkout@v6 | |
| # Use the already built and tested wheels. | |
| - name: Download all artifacts | |
| uses: actions/download-artifact@v4 | |
| with: | |
| # Docker container only has python 3.12, so we need to use the x86_64 3.12 wheel. | |
| name: monarch-py3.12-cuda12.8-x86_64 | |
| path: dist | |
| merge-multiple: true | |
| - name: Log in to the Container registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ghcr.io | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Get tag for publishing | |
| run: echo "DOCKER_TAG=0.4.0.dev$(date +'%Y%m%d')-cuda12.8" >> $GITHUB_ENV | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: . # Build context is the root directory | |
| file: ./Dockerfile.nightly | |
| push: true # Push the image to the registry | |
| # Push to monarch-nightly package instead of monarch. | |
| tags: | | |
| ghcr.io/${{ github.repository }}-nightly:${{ env.DOCKER_TAG }} | |
| ghcr.io/${{ github.repository }}-nightly:latest | |
| # TODO: find docker tag that gets updated automatically. | |
| build-args: | | |
| PYTORCH_TAG=2.11.0.dev20260109-cuda12.8-cudnn9-runtime | |
| MONARCH_WHEELS=dist |