-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
97 lines (68 loc) · 2.13 KB
/
Dockerfile
File metadata and controls
97 lines (68 loc) · 2.13 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
ARG PISM_TAG=2.3.0
FROM ghcr.io/pism/pism:${PISM_TAG} AS runtime
FROM runtime AS build
ARG DEBIAN_FRONTEND=noninteractive
ARG ONEAPI_VERSION=2025.3
ARG IMPI_VERSION=2021.17
USER root
RUN <<EOF
echo "Install build tools"
set -e
set -u
set -x
apt-get update
apt-get install -y --no-install-recommends \
autoconf \
automake \
git \
libtool \
make \
intel-oneapi-compiler-dpcpp-cpp-${ONEAPI_VERSION} \
intel-oneapi-compiler-fortran-${ONEAPI_VERSION} \
intel-oneapi-mpi-devel-${IMPI_VERSION} \
""
rm -rf /var/lib/apt/lists/*
EOF
RUN <<EOF
echo "Install NCAR/peak_memusage"
set -e
set -u
set -x
build_dir=/var/tmp/build/peak_memusage
prefix=/opt/peak_memusage
mkdir -p ${build_dir}
cd ${build_dir}
git clone --depth=1 https://github.com/NCAR/peak_memusage.git .
./autogen.sh
./configure CC=mpiicx CXX=mpiicpx FC=mpiifx \
--disable-nvml \
--disable-fortran \
--disable-openmp \
--enable-mpi \
--prefix=${prefix} || (cat config.log && exit 1)
make all && make install
rm -rf ${build_dir}
EOF
FROM runtime
USER root
RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates curl git unzip vim \
&& apt-get clean && rm -rf /var/lib/apt/lists/*
COPY --from=build /opt/peak_memusage/ /opt/peak_memusage
RUN chown -R worker /opt/
USER worker
WORKDIR /home/worker
ENV PATH=/opt/peak_memusage/bin:$PATH
RUN curl -L -O "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-$(uname)-$(uname -m).sh" && \
bash Miniforge3-$(uname)-$(uname -m).sh -b -p /opt/conda && \
rm Miniforge3-$(uname)-$(uname -m).sh
ENV PATH=/opt/conda/bin:$PATH
SHELL ["/bin/bash", "-l", "-c"]
COPY --chown=worker . /pism-terra/
RUN mamba env create -f /pism-terra/environment.yml && \
conda clean -afy && \
echo ". /opt/conda/etc/profile.d/conda.sh" >> /home/worker/.profile && \
echo "conda activate pism-terra" >> /home/worker/.profile
RUN conda activate pism-terra && \
python -m pip install --no-cache-dir /pism-terra
ENTRYPOINT ["/pism-terra/pism_terra/etc/entrypoint.sh"]
CMD ["-h"]