Skip to content

Commit 07ab338

Browse files
authored
build: compile OpenPMIx from source for MPI plugin in Dockerfile (#602)
* build: compile OpenPMIx from source for MPI plugin in Dockerfile AlmaLinux 8 has no openpmix-devel package and distro pmix-devel is 2.x, below pmix_min_version. Build OpenPMIx 5.0.3 during the builder stage when BUILD_MPI_PLUGIN=1 so nightly and release tarballs include a functional spur_mpi_pmix.so. * build: add pkg-config/tar and download OpenPMIx tarball to file Address Copilot review on PR #602: install pkgconf-pkg-config and tar explicitly for the MPI plugin build, and fetch the OpenPMIx source archive to a temp file before extraction.
1 parent 2eac05d commit 07ab338

1 file changed

Lines changed: 19 additions & 1 deletion

File tree

Dockerfile

Lines changed: 19 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,11 @@ FROM chef AS builder
3636
ARG SPUR_GIT_SHA
3737
ARG SPUR_GIT_DIRTY
3838
ARG BUILD_MPI_PLUGIN=0
39+
ARG OPENPMIX_VERSION=5.0.3
3940
# BUILD_MPI_PLUGIN=1 links against libpmix and installs a functional spur_mpi_pmix.so
4041
# into dist artifacts. Default 0 builds the stub plugin (not copied to dist).
42+
# AlmaLinux 8 has no openpmix-devel RPM; distro pmix-devel (PowerTools) is PMIx 2.x.
43+
# Build OpenPMIx from source so the plugin meets pmix_min_version (4.1.0+).
4144
ENV SPUR_GIT_SHA=$SPUR_GIT_SHA
4245
ENV SPUR_GIT_DIRTY=$SPUR_GIT_DIRTY
4346

@@ -52,8 +55,23 @@ RUN cargo build --release --locked \
5255
--bin spur-k8s-operator
5356

5457
RUN if [ "$BUILD_MPI_PLUGIN" = "1" ]; then \
55-
dnf install -y openpmix-devel && dnf clean all; \
58+
dnf install -y dnf-plugins-core && \
59+
dnf config-manager --set-enabled powertools && \
60+
dnf install -y gcc-c++ flex bison python3 tar pkgconf-pkg-config libevent-devel hwloc-devel && \
61+
curl -fsSL "https://github.com/openpmix/openpmix/releases/download/v${OPENPMIX_VERSION}/pmix-${OPENPMIX_VERSION}.tar.gz" \
62+
-o "/tmp/pmix-${OPENPMIX_VERSION}.tar.gz" && \
63+
tar xzf "/tmp/pmix-${OPENPMIX_VERSION}.tar.gz" -C /tmp && \
64+
rm -f "/tmp/pmix-${OPENPMIX_VERSION}.tar.gz" && \
65+
cd "/tmp/pmix-${OPENPMIX_VERSION}" && \
66+
./configure --prefix=/usr/local && \
67+
make -j"$(nproc)" && make install && \
68+
printf '%s\n' /usr/local/lib /usr/local/lib64 > /etc/ld.so.conf.d/openpmix.conf && \
69+
ldconfig && \
70+
rm -rf "/tmp/pmix-${OPENPMIX_VERSION}" && \
71+
dnf clean all; \
5672
fi && \
73+
cd /build && \
74+
PKG_CONFIG_PATH="/usr/local/lib/pkgconfig:/usr/local/lib64/pkgconfig:${PKG_CONFIG_PATH:-}" \
5775
cargo build --release --locked -p spur-mpi-pmix
5876

5977
RUN mkdir -p /dist/lib/spur && \

0 commit comments

Comments
 (0)