|
| 1 | +name: Nightly Open MPI Extensions |
| 2 | + |
| 3 | +on: |
| 4 | + workflow_dispatch: |
| 5 | + schedule: |
| 6 | + - cron: "37 2 * * *" |
| 7 | + push: |
| 8 | + branches: |
| 9 | + - main |
| 10 | + |
| 11 | +permissions: |
| 12 | + contents: write |
| 13 | + |
| 14 | +jobs: |
| 15 | + build: |
| 16 | + name: Build ${{ matrix.platform }} |
| 17 | + runs-on: ${{ matrix.runner }} |
| 18 | + strategy: |
| 19 | + fail-fast: false |
| 20 | + matrix: |
| 21 | + include: |
| 22 | + - platform: linux-x86_64 |
| 23 | + runner: ubuntu-24.04 |
| 24 | + shmem: required |
| 25 | + shmem_validation: passed |
| 26 | + - platform: macos-arm64 |
| 27 | + runner: macos-15 |
| 28 | + shmem: disabled |
| 29 | + shmem_validation: unsupported |
| 30 | + env: |
| 31 | + CCACHE_DIR: ${{ github.workspace }}/_ccache |
| 32 | + MPI_EXTENSIONS_CCACHE: on |
| 33 | + |
| 34 | + steps: |
| 35 | + - name: Check out repository |
| 36 | + uses: actions/checkout@v4 |
| 37 | + with: |
| 38 | + submodules: recursive |
| 39 | + |
| 40 | + - name: Cache ccache |
| 41 | + uses: actions/cache@v4 |
| 42 | + with: |
| 43 | + path: _ccache |
| 44 | + key: ccache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.platform }}-${{ hashFiles('manifests/openmpi-version.json', '.gitmodules') }} |
| 45 | + restore-keys: | |
| 46 | + ccache-${{ runner.os }}-${{ runner.arch }}-${{ matrix.platform }}- |
| 47 | + ccache-${{ runner.os }}-${{ runner.arch }}- |
| 48 | +
|
| 49 | + - name: Install Linux build dependencies |
| 50 | + if: runner.os == 'Linux' |
| 51 | + run: | |
| 52 | + set -euo pipefail |
| 53 | + sudo apt-get update |
| 54 | + sudo apt-get install -y \ |
| 55 | + autoconf \ |
| 56 | + automake \ |
| 57 | + bison \ |
| 58 | + build-essential \ |
| 59 | + ca-certificates \ |
| 60 | + ccache \ |
| 61 | + flex \ |
| 62 | + libtool \ |
| 63 | + libucx-dev \ |
| 64 | + perl \ |
| 65 | + pkg-config \ |
| 66 | + python3 \ |
| 67 | + python3-pip \ |
| 68 | + rsync \ |
| 69 | + zlib1g-dev |
| 70 | +
|
| 71 | + - name: Install macOS build dependencies |
| 72 | + if: runner.os == 'macOS' |
| 73 | + run: | |
| 74 | + set -euo pipefail |
| 75 | + brew update |
| 76 | + brew install autoconf automake bison ccache flex libtool pkg-config rsync |
| 77 | + { |
| 78 | + echo "$(brew --prefix bison)/bin" |
| 79 | + echo "$(brew --prefix flex)/bin" |
| 80 | + } >> "$GITHUB_PATH" |
| 81 | +
|
| 82 | + - name: Install Python dependencies |
| 83 | + run: | |
| 84 | + set -euo pipefail |
| 85 | + python3 -m venv .venv |
| 86 | + . .venv/bin/activate |
| 87 | + python -m pip install --upgrade pip |
| 88 | + python -m pip install -r requirements.txt |
| 89 | + echo "$PWD/.venv/bin" >> "$GITHUB_PATH" |
| 90 | +
|
| 91 | + - name: Build Open MPI |
| 92 | + run: | |
| 93 | + set -euo pipefail |
| 94 | + ccache -z |
| 95 | + ./scripts/build_openmpi.sh \ |
| 96 | + --prefix "$PWD/_install/openmpi" \ |
| 97 | + --build-dir "$PWD/_build/openmpi-${{ matrix.platform }}" \ |
| 98 | + --enable-shmem "${{ matrix.shmem }}" \ |
| 99 | + --ccache on |
| 100 | +
|
| 101 | + - name: Validate MPI |
| 102 | + run: ./scripts/smoke_test_mpi.sh "$PWD/_install/openmpi" |
| 103 | + |
| 104 | + - name: Validate OpenSHMEM |
| 105 | + if: matrix.shmem == 'required' |
| 106 | + run: ./scripts/smoke_test_shmem.sh "$PWD/_install/openmpi" |
| 107 | + |
| 108 | + - name: Record unsupported OpenSHMEM on macOS |
| 109 | + if: matrix.shmem != 'required' |
| 110 | + run: | |
| 111 | + set -euo pipefail |
| 112 | + MPI_EXTENSIONS_ALLOW_UNSUPPORTED_SHMEM=1 \ |
| 113 | + ./scripts/smoke_test_shmem.sh "$PWD/_install/openmpi" |
| 114 | +
|
| 115 | + - name: Package Open MPI |
| 116 | + run: | |
| 117 | + set -euo pipefail |
| 118 | + ./scripts/package_openmpi.sh \ |
| 119 | + --prefix "$PWD/_install/openmpi" \ |
| 120 | + --out "$PWD/_dist" \ |
| 121 | + --platform "${{ matrix.platform }}" \ |
| 122 | + --mpi-smoke passed \ |
| 123 | + --shmem-smoke "${{ matrix.shmem_validation }}" |
| 124 | +
|
| 125 | + - name: Upload package artifact |
| 126 | + uses: actions/upload-artifact@v4 |
| 127 | + with: |
| 128 | + name: openmpi-${{ matrix.platform }} |
| 129 | + path: | |
| 130 | + _dist/*.tar.gz |
| 131 | + _dist/*.sha256 |
| 132 | + _dist/*.manifest.json |
| 133 | + if-no-files-found: error |
| 134 | + |
| 135 | + - name: Print ccache stats |
| 136 | + if: always() |
| 137 | + run: ccache -s |
| 138 | + |
| 139 | + publish-nightly: |
| 140 | + name: Publish nightly pre-release |
| 141 | + if: github.event_name != 'push' |
| 142 | + needs: build |
| 143 | + runs-on: ubuntu-24.04 |
| 144 | + |
| 145 | + steps: |
| 146 | + - name: Check out repository |
| 147 | + uses: actions/checkout@v4 |
| 148 | + |
| 149 | + - name: Download package artifacts |
| 150 | + uses: actions/download-artifact@v4 |
| 151 | + with: |
| 152 | + path: _release_assets |
| 153 | + merge-multiple: true |
| 154 | + |
| 155 | + - name: Replace nightly release assets |
| 156 | + env: |
| 157 | + GH_TOKEN: ${{ github.token }} |
| 158 | + run: | |
| 159 | + set -euo pipefail |
| 160 | + test -n "$(find _release_assets -maxdepth 1 -type f -print -quit)" |
| 161 | +
|
| 162 | + git tag -f nightly "$GITHUB_SHA" |
| 163 | + git push origin refs/tags/nightly --force |
| 164 | +
|
| 165 | + notes="Moving nightly Open MPI binary packages for parallel_programming_course. This release is replaced by every scheduled or manual run." |
| 166 | + if gh release view nightly >/dev/null 2>&1; then |
| 167 | + gh release edit nightly \ |
| 168 | + --title "Nightly Open MPI Extensions" \ |
| 169 | + --notes "$notes" \ |
| 170 | + --prerelease \ |
| 171 | + --latest=false |
| 172 | + mapfile -t old_assets < <(gh release view nightly --json assets --jq '.assets[].name') |
| 173 | + for asset in "${old_assets[@]}"; do |
| 174 | + gh release delete-asset nightly "$asset" -y |
| 175 | + done |
| 176 | + else |
| 177 | + gh release create nightly \ |
| 178 | + --title "Nightly Open MPI Extensions" \ |
| 179 | + --notes "$notes" \ |
| 180 | + --prerelease \ |
| 181 | + --latest=false |
| 182 | + fi |
| 183 | +
|
| 184 | + gh release upload nightly _release_assets/* --clobber |
0 commit comments