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