diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index bbc13bc..a298229 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -61,6 +61,9 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: "Get openmpi source" + run: make get_openmpi + - name: "Build the final Docker image" id: docker_build uses: docker/build-push-action@v3 @@ -126,6 +129,9 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: "Get openmpi source" + run: make get_openmpi + - name: "Build the debug Docker image" id: docker_build uses: docker/build-push-action@v3 diff --git a/.gitignore b/.gitignore index 8ab49b8..08701ce 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,3 @@ .version +openmpi-*.tar.gz diff --git a/Dockerfile b/Dockerfile index 57a77c3..3a68701 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -# Copyright 2021-2024 Hewlett Packard Enterprise Development LP +# Copyright 2021-2025 Hewlett Packard Enterprise Development LP # Other additional copyright holders may be indicated within. # # The entirety of this work is licensed under the Apache License, @@ -18,7 +18,7 @@ # These ARGs must be before the first FROM. This allows them to be valid for # use in FROM instructions. ARG MPI_OPERATOR_VERSION=0.6.0 -ARG OPENMPI_VERSION=4.1.7 +ARG OPENMPI_VERSION FROM mpioperator/openmpi-builder:v$MPI_OPERATOR_VERSION AS builder @@ -32,10 +32,12 @@ RUN apt-get update && apt-get install -y \ openssh-server openssh-client \ && rm -rf /var/lib/apt/lists/* +COPY openmpi-$OPENMPI_VERSION.tar.gz openmpi-$OPENMPI_VERSION.tar.gz + # Remove the OS binary of openmpi and build from source RUN apt-get remove -y openmpi-bin -RUN wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-$OPENMPI_VERSION.tar.gz \ - && gunzip -c openmpi-$OPENMPI_VERSION.tar.gz | tar xf - \ +#RUN wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-$OPENMPI_VERSION.tar.gz +RUN gunzip -c openmpi-$OPENMPI_VERSION.tar.gz | tar xf - \ && cd openmpi-$OPENMPI_VERSION \ && ./configure --prefix=/opt/openmpi-$OPENMPI_VERSION \ && make all install @@ -88,6 +90,8 @@ FROM builder AS builder-debug ARG OPENMPI_VERSION ENV OPENMPI_VERSION=$OPENMPI_VERSION +COPY openmpi-$OPENMPI_VERSION.tar.gz openmpi-$OPENMPI_VERSION.tar.gz + WORKDIR /deps RUN cd build \ && cmake ../mpifileutils \ @@ -99,8 +103,8 @@ RUN cd build \ && make install -RUN wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-$OPENMPI_VERSION.tar.gz \ - && gunzip -c openmpi-$OPENMPI_VERSION.tar.gz | tar xf - \ +#RUN wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-$OPENMPI_VERSION.tar.gz +RUN gunzip -c openmpi-$OPENMPI_VERSION.tar.gz | tar xf - \ && cd openmpi-$OPENMPI_VERSION \ && ./configure --prefix=/opt/openmpi-$OPENMPI_VERSION-debug --enable-debug \ && make all install diff --git a/Makefile b/Makefile index e786eef..d4c3048 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -# Copyright 2021-2024 Hewlett Packard Enterprise Development LP +# Copyright 2021-2025 Hewlett Packard Enterprise Development LP # Other additional copyright holders may be indicated within. # # The entirety of this work is licensed under the Apache License, @@ -18,15 +18,27 @@ # NOTE: git-version-gen will generate a value for VERSION, unless you override it. IMAGE_TAG_BASE ?= ghcr.io/nearnodeflash/nnf-mfu +OPENMPI_VERSION ?= 4.1.7 + +all: docker-build + +openmpi-$(OPENMPI_VERSION).tar.gz: Makefile Dockerfile + if [[ ! -f openmpi-$(OPENMPI_VERSION).tar.gz ]]; then \ + wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-$(OPENMPI_VERSION).tar.gz; \ + fi + +.PHONY: get-openmpi +get-openmpi: openmpi-$(OPENMPI_VERSION).tar.gz + docker-build: VERSION ?= $(shell cat .version) docker-build: TARGET ?= production -docker-build: .version - docker build --target $(TARGET) -t $(IMAGE_TAG_BASE):$(VERSION) . +docker-build: .version openmpi-$(OPENMPI_VERSION).tar.gz + docker build --build-arg="OPENMPI_VERSION=$(OPENMPI_VERSION)" --target $(TARGET) -t $(IMAGE_TAG_BASE):$(VERSION) . docker-build-debug: VERSION ?= $(shell cat .version) docker-build-debug: IMAGE_TAG_BASE := $(IMAGE_TAG_BASE)-debug -docker-build-debug: .version - docker build --target debug -t $(IMAGE_TAG_BASE):$(VERSION) . +docker-build-debug: .version openmpi-$(OPENMPI_VERSION).tar.gz + docker build --build-arg="OPENMPI_VERSION=$(OPENMPI_VERSION)" --target debug -t $(IMAGE_TAG_BASE):$(VERSION) . docker-push: VERSION ?= $(shell cat .version) docker-push: .version diff --git a/Readme.md b/Readme.md index b668c74..1adf539 100644 --- a/Readme.md +++ b/Readme.md @@ -6,7 +6,7 @@ Utils](https://github.com/hpc/mpifileutils) commands. The foundation of this image relies on [mpi-operator](https://github.com/kubeflow/mpi-operator) with the addition of -MPI File Utils that have been constructed from source. At the time of this writing, the mpi-operator image installs v4.1.0 of Open MPI. +MPI File Utils that have been constructed from source. This image is primarily used for NNF Data Movement and as a base image for running NNF User Containers.