Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,14 +39,17 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build new image and load it into Docker to test
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
tags: ${{ env.docker-tag }}
file: docker/${{ matrix.config.dockerfile }}
build-args: ${{ matrix.config.build_args }}
pull: true
push: false
load: true
load: true
- name: Push Docker images for Github Container Registry
uses: docker/build-push-action@v3
if: ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
Expand Down
44 changes: 29 additions & 15 deletions docker/ubuntu
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# --------------------------------------------------------------------------------------
# Build stage with Spack pre-installed and ready to be used
FROM spack/ubuntu-jammy:develop
FROM spack/ubuntu-jammy:develop AS environment-setup
# --------------------------------------------------------------------------------------

# Get Ubuntu packages
# 1. apt-get install necessary build tools
Expand All @@ -23,20 +25,10 @@ RUN apt-get update \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*

# Get Myna
ENV MYNA_DIR=/opt/myna
RUN MYNA_VERSION=main.tar.gz && \
MYNA_ARCHIVE=myna-${MYNA_VERSION} && \
MYNA_URL=https://github.com/ORNL-MDF/Myna/archive/refs/heads/${MYNA_VERSION} && \
wget --quiet ${MYNA_URL} --output-document=${MYNA_ARCHIVE} && \
mkdir -p ${MYNA_DIR} && \
tar -xf ${MYNA_ARCHIVE} -C ${MYNA_DIR} --strip-components=1 && \
rm -f ${MYNA_ARCHIVE} && \
python3 -m pip install --upgrade pip && \
python3 -m pip install ${MYNA_DIR} --root-user-action=ignore && \
python3 -m pip cache purge
ENV PYTHONPATH=${PYTHONPATH}:${MYNA_DIR}

# --------------------------------------------------------------------------------------
# Build stage to build AdditiveFOAM and ExaCA
FROM environment-setup AS additivefoam-exaca
# --------------------------------------------------------------------------------------
# What we want to install and how we want to install it
# is specified in a manifest file (spack.yaml)
RUN mkdir -p /opt/spack-environment && \
Expand Down Expand Up @@ -69,6 +61,10 @@ RUN cd /opt/spack-environment \
RUN cd /opt/spack-environment && \
spack env activate --sh -d . > activate.sh

# --------------------------------------------------------------------------------------
# Build stage to install 3DThesis
FROM additivefoam-exaca AS thesis
# --------------------------------------------------------------------------------------
# Install 3DThesis
ENV THESIS_DIR=/opt/3DThesis
RUN . /opt/spack-environment/activate.sh && \
Expand All @@ -87,6 +83,24 @@ RUN . /opt/spack-environment/activate.sh && \
cmake --install build && \
echo 'export PATH="/opt/3DThesis/bin:$PATH"' >> /opt/spack-environment/activate.sh

# --------------------------------------------------------------------------------------
# Final build stage starting with all Myna external dependencies built to build Myna
FROM thesis AS myna
# --------------------------------------------------------------------------------------
# Get Myna
ENV MYNA_DIR=/opt/myna
RUN MYNA_VERSION=main.tar.gz && \
MYNA_ARCHIVE=myna-${MYNA_VERSION} && \
MYNA_URL=https://github.com/ORNL-MDF/Myna/archive/refs/heads/${MYNA_VERSION} && \
wget --quiet ${MYNA_URL} --output-document=${MYNA_ARCHIVE} && \
mkdir -p ${MYNA_DIR} && \
tar -xf ${MYNA_ARCHIVE} -C ${MYNA_DIR} --strip-components=1 && \
rm -f ${MYNA_ARCHIVE} && \
python3 -m pip install --upgrade pip && \
python3 -m pip install ${MYNA_DIR} --root-user-action=ignore && \
python3 -m pip cache purge
ENV PYTHONPATH=${PYTHONPATH}:${MYNA_DIR}

# Set entry point
RUN { \
echo '#!/bin/sh' \
Expand Down