Skip to content
This repository was archived by the owner on Aug 28, 2024. It is now read-only.

Commit

Permalink
Merge branch 'debug' of https://github.com/carlislewishard/swiftest i…
Browse files Browse the repository at this point in the history
…nto debug
  • Loading branch information
daminton committed May 26, 2023
2 parents 7472c5c + 64d6a30 commit 615f286
Show file tree
Hide file tree
Showing 14 changed files with 77 additions and 17 deletions.
13 changes: 10 additions & 3 deletions docker/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
!Dockerfile
!bin/
!pull
*
!.gitignore
!install.sh
!gnu/
!gnu/Dockerfile
!/gnu/bin/
!/gnu/bin/swiftest_driver
!intel/
!intel/Dockerfile
!/intel/bin/swiftest_driver
1 change: 0 additions & 1 deletion docker/bin/.gitignore

This file was deleted.

44 changes: 44 additions & 0 deletions docker/gnu/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
FROM debian:stable-slim as build

# kick everything off
RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates curl git build-essential gfortran && \
apt-get update && apt-get upgrade -y && \
rm -rf /var/lib/apt/lists/*

# Get CMAKE and install it
RUN mkdir -p /opt/cmake/build && \
cd /opt/cmake/build && \
curl -LO https://github.com/Kitware/CMake/releases/download/v3.26.2/cmake-3.26.2-linux-x86_64.sh && \
/bin/bash cmake-3.26.2-linux-x86_64.sh --prefix=/usr/local --skip-license

# Get dependencies
RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libnetcdf-dev libnetcdff-dev libcoarrays-dev libcoarrays-mpich-dev&& \
rm -rf /var/lib/apt/lists/*

ENV NETCDF_HOME="/usr"
ENV NETCDF_FORTRAN_HOME="/usr"
ENV INDIR="/opt/dist//usr/local"

# Get Swiftest source code
RUN cd /opt/ && \
git clone -b debug https://github.com/carlislewishard/swiftest.git && \
cd swiftest && \
mkdir build && \
cd build && \
cmake .. -DCMAKE_PREFIX_PATH="${INDIR}" -DCMAKE_INSTALL_PREFIX="${INDIR}" -DCONTAINERIZE=ON -DCMAKE_BUILD_TYPE=release && \
make && \
make install

#Production container
FROM debian:stable-slim
COPY --from=build /opt/dist /
RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
ca-certificates gfortran libnetcdf-dev libnetcdff-dev && \
rm -rf /var/lib/apt/lists/*

ENTRYPOINT ["/usr/local/bin/swiftest_driver"]
Empty file added docker/gnu/bin/.gitignore
Empty file.
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh --
docker run -v $(pwd):$(pwd) -w $(pwd) -t -e OMP_NUM_THREADS -e FOR_COARRAY_NUM_IMAGES swiftest:latest "$@"
docker run -v $(pwd):$(pwd) -w $(pwd) -t -e OMP_NUM_THREADS -e FOR_COARRAY_NUM_IMAGES swiftest_driver:gnu "$@"
5 changes: 5 additions & 0 deletions docker/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
#!/bin/sh --
tag=${1:-intel}
echo "Installing swiftest_driver:${tag} Docker container and executable script"
docker pull daminton/swiftest_driver:${tag}
cp -rf ${tag}/bin/swiftest_driver ../bin/
File renamed without changes.
2 changes: 0 additions & 2 deletions docker/pull

This file was deleted.

5 changes: 3 additions & 2 deletions singularity/.gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
!swiftest.def
!bin/
!pull
!bin/swiftest_driver
!install.sh
!setenv.sh
1 change: 0 additions & 1 deletion singularity/bin/.gitignore

This file was deleted.

10 changes: 10 additions & 0 deletions singularity/install.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh --
# This will install the Singularity container version of the swiftest_driver in place of the native compiled version into ../bin.
# In order to use the executable script, the SWIFTEST_SIF environment variable must be set to point to the location of swiftest_driver.sif, which requires this script to be called via source:
# $ . ./install.sh
#
tag=${1:-intel}
echo "Installing swiftest_driver.sif Singularity container and executable script from swiftest_driver:${tag} Docker container"
singularity pull --force swiftest_driver.sif docker://daminton/swiftest_driver:${tag}
cp -rf bin/swiftest_driver ../bin/
source ./setenv.sh
2 changes: 0 additions & 2 deletions singularity/pull

This file was deleted.

7 changes: 4 additions & 3 deletions singularity/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/sh
# source this file to set the path to the swiftest.sif file
export SWIFTEST_SIF="${PWD}/swiftest.sif"
#!/bin/sh --
# This will set the SWIFTEST_SIF environment variable as long as it is executed by source.
# $ . ./setenv.sh
export SWIFTEST_SIF="${PWD}/swiftest_driver.sif"
2 changes: 0 additions & 2 deletions singularity/swiftest.def

This file was deleted.

0 comments on commit 615f286

Please sign in to comment.