Skip to content

Commit

Permalink
Add thesis and myna direct installs
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Sep 11, 2024
1 parent 839753b commit cc01270
Show file tree
Hide file tree
Showing 2 changed files with 56 additions and 6 deletions.
50 changes: 46 additions & 4 deletions docker/ubuntu
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Build stage with Spack pre-installed and ready to be used
FROM spack/ubuntu-jammy:develop AS builder


# 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 All @@ -12,7 +11,14 @@ set -o noclobber \
&& echo ' - vim' \
&& echo ' - emacs' \
&& echo ' - wget' \
&& echo ' - py-numpy' \
&& echo ' - py-pip' \
&& echo ' - py-numpy@1.9' \
&& echo ' - py-pyaml' \
&& echo ' - py-polars' \
&& echo ' - py-pandas~performance' \
&& echo ' - py-matplotlib' \
&& echo ' - vtk~mpi+python' \
&& echo ' - py-h5py' \
&& echo ' - exaca@master' \
&& echo ' - additivefoam@main' \
&& echo ' concretizer:' \
Expand All @@ -21,8 +27,8 @@ set -o noclobber \
&& echo ' install_tree: /opt/software' \
&& echo ' view: /opt/views/view') > /opt/spack-environment/spack.yaml

# Install the software, remove unnecessary deps
RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast && spack gc -y
# Install the software
RUN cd /opt/spack-environment && spack env activate . && spack install --fail-fast

# Strip all the binaries
RUN find -L /opt/views/view/* -type f -exec readlink -f '{}' \; | \
Expand All @@ -36,11 +42,47 @@ RUN cd /opt/spack-environment && \
spack env activate --sh -d . > activate.sh


# This section should eventually be moved into spack installs
# Install 3DThesis
ENV THESIS_DIR=/opt/3DThesis
RUN . /opt/spack-environment/activate.sh && \
THESIS_VERSION=master.tar.gz && \
THESIS_ARCHIVE=3DThesis-${THESIS_VERSION} && \
THESIS_URL=https://github.com/ORNL-MDF/3DThesis/archive/refs/heads/${THESIS_VERSION} && \
wget --quiet ${THESIS_URL} --output-document=${THESIS_ARCHIVE} && \
mkdir -p 3dthesis && \
tar -xf ${THESIS_ARCHIVE} -C 3dthesis --strip-components=1 && \
cd 3dthesis && \
cmake -B build \
-D CMAKE_INSTALL_PREFIX=${THESIS_DIR} \
-D CMAKE_BUILD_TYPE=Debug && \
cmake --build build && \
cmake --install build
RUN echo 'PATH="/opt/3DThesis/bin:$PATH"' >> activate.sh

# Get Myna
ENV MYNA_DIR=/opt/myna
RUN . /opt/spack-environment/activate.sh && \
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 && \
python3 -m pip --upgrade && \
python3 -m pip install ${MYNA_DIR} --root-user-action=ignore

# Clean up packages
RUN spack gc -y


# Bare OS image to run the installed executables
FROM ubuntu:22.04

COPY --from=builder /opt/spack-environment /opt/spack-environment
COPY --from=builder /opt/software /opt/software
COPY --from=builder /opt/3DThesis /opt/3DThesis
COPY --from=builder /opt/myna /opt/myna

# paths.view is a symlink, so copy the parent to avoid dereferencing and duplicating it
COPY --from=builder /opt/views /opt/views
Expand Down
12 changes: 10 additions & 2 deletions spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,16 @@ spack:
- vim
- emacs
- wget
# Placeholder for Myna and other dev python packages
- py-numpy
# (can eventually be removed with myna install)
- py-pip
- py-numpy@1.9
- py-pyaml
- py-polars
# Enabling "performance" substantially increases build times
- py-pandas~performance
- py-matplotlib
- vtk~mpi+python
- py-h5py
# Myna apps (can eventually be replaced with "myna +exaca +additivefoam")
- exaca@master
- additivefoam@main

0 comments on commit cc01270

Please sign in to comment.