Skip to content

Commit

Permalink
added parallel build and trying to get lustre libs in the production …
Browse files Browse the repository at this point in the history
…image
  • Loading branch information
bdevcich committed Feb 5, 2025
1 parent a29daa3 commit a1b7f83
Showing 1 changed file with 17 additions and 11 deletions.
28 changes: 17 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,53 +41,58 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/* \
&& update-ca-certificates

RUN mkdir -p /deps /mfu
WORKDIR /deps

# Build lustre to include in mpifileutils
RUN git clone https://github.com/Cray/lustre.git \
&& cd lustre \
&& git checkout cray-2.15.B19 \
&& sh autogen.sh \
&& ./configure --disable-server --enable-client --disable-tests --enable-mpitests=no --disable-gss-keyring --enable-gss=no -with-linux=/usr/src/linux-headers-6.1.0-30-amd64 --prefix=/deps/lustre/lib \
&& make \
&& ./configure --disable-server --enable-client --disable-tests --enable-mpitests=no --disable-gss-keyring --enable-gss=no -with-linux=/usr/src/linux-headers-6.1.0-30-amd64 \
&& make -j $(nproc) \
&& make install
# && make debs -j $(nproc)

RUN mkdir -p /deps /mfu
WORKDIR /deps

# Stash the lustre libraries to make it easier to copy
RUN mkdir -p /deps/lustre/lib \
&& cp -r /usr/lib/*lustre* /deps/lustre/lib/

# Remove the OS binary of openmpi and build from source
RUN apt-get remove -y openmpi-bin
RUN wget --no-check-certificate https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-$OPENMPI_VERSION.tar.gz
RUN [ $(md5sum openmpi-$OPENMPI_VERSION.tar.gz | awk '{print $1}') = "$OPENMPI_MD5" ]
RUN gunzip -c openmpi-$OPENMPI_VERSION.tar.gz | tar xf - \
&& cd openmpi-$OPENMPI_VERSION \
&& ./configure --prefix=/opt/openmpi-$OPENMPI_VERSION \
&& make all install
&& make -j $(nproc) all \
&& make install
RUN cp -r /opt/openmpi-$OPENMPI_VERSION/* /usr

# Build and install MPI File Utils and all dependencies
RUN wget https://github.com/hpc/libcircle/releases/download/v0.3/libcircle-0.3.0.tar.gz \
&& tar xfz libcircle-0.3.0.tar.gz \
&& cd libcircle-0.3.0 \
&& ./configure --prefix=/deps/libcircle/lib \
&& make install
&& make -j $(nproc) install

RUN wget https://github.com/libarchive/libarchive/releases/download/v3.5.3/libarchive-3.5.3.tar.gz \
&& tar xfz libarchive-3.5.3.tar.gz \
&& cd libarchive-3.5.3 \
&& ./configure --prefix=/deps/libarchive/lib \
&& make install
&& make -j $(nproc) install

RUN wget https://github.com/llnl/lwgrp/releases/download/v1.0.3/lwgrp-1.0.3.tar.gz \
&& tar xfz lwgrp-1.0.3.tar.gz \
&& cd lwgrp-1.0.3 \
&& ./configure --prefix=/deps/lwgrp/lib \
&& make install
&& make -j $(nproc) install

RUN wget https://github.com/llnl/dtcmp/releases/download/v1.1.1/dtcmp-1.1.1.tar.gz \
&& tar xfz dtcmp-1.1.1.tar.gz \
&& cd dtcmp-1.1.1 \
&& ./configure --prefix=/deps/dtcmp/lib --with-lwgrp=/deps/lwgrp/lib \
&& make install
&& make -j $(nproc) install

# Until a new release of mpifileutils is cut, we need to use a tagged commit on
# our fork to include our dcp changes (i.e. --uid, --gid)
Expand Down Expand Up @@ -138,12 +143,13 @@ ENV OPENMPI_VERSION=$OPENMPI_VERSION
# Provides nslookup for NNF Containers. Used for MPI Launcher InitContainers.
RUN apt-get update && apt-get install -y dnsutils && rm -rf /var/lib/apt/lists/*

COPY --from=builder /deps/lustre/lib/ /usr
COPY --from=builder /deps/libcircle/lib/ /usr
COPY --from=builder /deps/libarchive/lib/ /usr
COPY --from=builder /deps/lwgrp/lib/ /usr
COPY --from=builder /deps/dtcmp/lib/ /usr

COPY --from=builder /deps/lustre/lib/ /usr

COPY --from=builder /mfu/ /usr

RUN apt-get remove -y openmpi-bin
Expand Down

0 comments on commit a1b7f83

Please sign in to comment.