Skip to content

Commit 42fafe8

Browse files
committed
Add nightly Open MPI binary supplier
1 parent 80cc777 commit 42fafe8

15 files changed

Lines changed: 1388 additions & 40 deletions
Lines changed: 184 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,184 @@
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

.gitignore

Lines changed: 33 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,49 @@
1-
# Prerequisites
1+
# Build directories and generated release assets
2+
/_build/
3+
/_ccache/
4+
/_dist/
5+
/_install/
6+
/_release_assets/
7+
/build/
8+
/ccache/
9+
/install/
10+
/Build/
11+
/build-*/
12+
13+
# Python
14+
__pycache__/
15+
*.py[cod]
16+
.pytest_cache/
17+
.mypy_cache/
18+
.ruff_cache/
19+
.venv/
20+
21+
# Compiled object and library files
222
*.d
3-
4-
# Compiled Object files
523
*.slo
624
*.lo
725
*.o
826
*.obj
9-
10-
# Precompiled Headers
1127
*.gch
1228
*.pch
13-
14-
# Linker files
15-
*.ilk
16-
17-
# Debugger Files
18-
*.pdb
19-
20-
# Compiled Dynamic libraries
2129
*.so
30+
*.so.*
2231
*.dylib
2332
*.dll
24-
*.so.*
25-
26-
27-
# Fortran module files
28-
*.mod
29-
*.smod
30-
31-
# Compiled Static libraries
32-
*.lai
33-
*.la
3433
*.a
34+
*.la
35+
*.lai
3536
*.lib
36-
37-
# Executables
3837
*.exe
3938
*.out
4039
*.app
40+
*.dwo
41+
*.pdb
42+
*.ilk
4143

42-
# Build directories
43-
build/
44-
Build/
45-
build-*/
44+
# Fortran module files
45+
*.mod
46+
*.smod
4647

4748
# CMake generated files
4849
CMakeFiles/
@@ -53,17 +54,10 @@ install_manifest.txt
5354
compile_commands.json
5455

5556
# Temporary files
56-
*.tmp
5757
*.log
58+
*.tmp
5859
*.bak
5960
*.swp
60-
61-
# vcpkg
62-
vcpkg_installed/
63-
64-
# debug information files
65-
*.dwo
66-
67-
# test output & cache
68-
Testing/
6961
.cache/
62+
Testing/
63+
vcpkg_installed/

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[submodule "external/ompi"]
2+
path = external/ompi
3+
url = https://github.com/open-mpi/ompi

0 commit comments

Comments
 (0)