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

Commit

Permalink
More improvements to containers
Browse files Browse the repository at this point in the history
  • Loading branch information
daminton committed Jun 7, 2023
1 parent c0546f6 commit 7152017
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 17 deletions.
16 changes: 2 additions & 14 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,8 @@ RUN echo 'find_path(NETCDF_INCLUDE_DIR NAMES netcdf.mod HINTS ENV NETCDF_FORTRAN
cmake --build build && \
cmake --install build

# Driver container
FROM continuumio/miniconda3 as setup_conda
COPY --from=build /opt/intel/oneapi/compiler/2023.1.0/linux/compiler/lib/intel64_lin/libicaf.so /usr/local/lib/
COPY --from=build /usr/local/bin/swiftest_driver /usr/local/bin
COPY --from=build /usr/local/bin/swiftest_driver /bin/
# Production container
FROM continuumio/miniconda3
COPY ./python/. /opt/conda/pkgs/swiftest/python/

RUN apt-get update && apt-get upgrade -y && \
Expand All @@ -180,20 +177,11 @@ RUN apt-get update && apt-get upgrade -y && \
cd /opt/conda/pkgs/swiftest/python/swiftest && conda develop . && \
conda clean --all -y

# Production container
FROM ubuntu:20.04

RUN apt-get update && apt-get upgrade -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends \
libsz2 libcurl3-gnutls libxml2 && \
rm -rf /var/lib/apt/lists/*

ENV LD_LIBRARY_PATH="/usr/local/lib"
ENV SHELL="/bin/bash"
COPY --from=build /opt/intel/oneapi/compiler/2023.1.0/linux/compiler/lib/intel64_lin/libicaf.so /usr/local/lib/
COPY --from=build /opt/intel/oneapi/mpi/2021.9.0//lib/release/libmpi.so.12 /usr/local/lib/
COPY --from=build /opt/intel/oneapi/compiler/2023.1.0/linux/compiler/lib/intel64_lin/libintlc.so.5 /usr/local/lib/
COPY --from=setup_conda /opt/conda/. /opt/conda/
COPY --from=build /opt/intel/oneapi/mpi/latest/bin/mpiexec.hydra /usr/local/bin/
COPY --from=build /usr/local/bin/swiftest_driver /usr/local/bin
COPY --from=build /usr/local/bin/swiftest_driver_caf /usr/local/bin/
Expand Down
2 changes: 1 addition & 1 deletion singularity/bin/swiftest_driver
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
#!/bin/sh --
singularity run --bind $(pwd):$(pwd) --env OMP_NUM_THREADS=${OMP_NUM_THREADS},FOR_COARRAY_NUM_IMAGES=${FOR_COARRAY_NUM_IMAGES} ${SWIFTEST_SIF} "$@"
singularity run --bind $(pwd):$(pwd) exec --env OMP_NUM_THREADS=${OMP_NUM_THREADS},FOR_COARRAY_NUM_IMAGES=${FOR_COARRAY_NUM_IMAGES} ${SWIFTEST_SIF} swiftest_driver "$@"
2 changes: 1 addition & 1 deletion singularity/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,6 @@
#
tag=${1:-latest}
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}
singularity pull --force swiftest.sif docker://daminton/swiftest:${tag}
cp -rf bin/swiftest_driver ../bin/
source ./setenv.sh
2 changes: 1 addition & 1 deletion singularity/setenv.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/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"
export SWIFTEST="${PWD}/swiftest.sif"

0 comments on commit 7152017

Please sign in to comment.