-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathDockerfile.ubuntu22.04-intel-unified
131 lines (130 loc) · 7.36 KB
/
Dockerfile.ubuntu22.04-intel-unified
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
From intel/ubuntu22.04-hpckit:2023.1.0
ARG branch_name
ENV branch=$branch_name
RUN mkdir -p /opt/build
RUN apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends ca-certificates curl && rm -rf /var/lib/apt/lists/*
# install cmake
RUN cd /opt/build && curl -LO https://github.com/Kitware/CMake/releases/download/v3.23.1/cmake-3.23.1-linux-x86_64.sh && /bin/bash cmake-3.23.1-linux-x86_64.sh --prefix=/usr/local --skip-license
#
# update apt
RUN apt-get update -yq --allow-unauthenticated
#
RUN DEBIAN_FRONTEND=noninteractive TZ=Etc/UTC apt-get -y install tzdata
# Install some basics that will be needed by all apps
RUN ln -fs /usr/share/zoneinfo/America/New_York /etc/localtime && \
dpkg-reconfigure --frontend noninteractive tzdata && \
apt install -y --no-install-recommends vim && \
apt install -y --no-install-recommends wget && \
apt install -y --no-install-recommends libexpat1-dev&& \
apt install -y --no-install-recommends bc && \
apt install -y --no-install-recommends time && \
apt install -y --no-install-recommends libtiff-dev && \
apt install -y --no-install-recommends bison && \
apt install -y --no-install-recommends flex && \
apt install -y --no-install-recommends libbz2-dev && \
apt install -y --no-install-recommends apt-utils && \
apt install -y --no-install-recommends tcl-dev && \
apt install -y --no-install-recommends rsync && \
apt install -y --no-install-recommends texinfo && \
apt install -y --no-install-recommends libbz2-dev && \
apt install -y --no-install-recommends awscli && \
#
#RUN apt install -y --no-install-recommends environment-modules && \
apt install -y --no-install-recommends build-essential && \
apt install -y --no-install-recommends m4 && \
apt install -y --no-install-recommends git && \
apt install -y --no-install-recommends git-lfs && \
apt install -y --no-install-recommends bzip2 && \
apt install -y --no-install-recommends unzip && \
apt install -y --no-install-recommends automake && \
apt install -y --no-install-recommends autoconf && \
apt install -y --no-install-recommends xterm && \
apt install -y --no-install-recommends libcurl4-openssl-dev && \
apt install -y --no-install-recommends libssl-dev && \
apt install -y --no-install-recommends meson && \
apt install -y --no-install-recommends mysql-server && \
apt install -y --no-install-recommends libmysqlclient-dev && \
apt install -y --no-install-recommends file && \
apt install -y --no-install-recommends python3-dev python3-pip && \
rm -rf /var/lib/apt/lists/*
#
ENV PATH="${PATH}:/usr/local:/opt/intel/oneapi/compiler/2023.2.3/linux/bin/intel64"
#
RUN echo "dash dash/sh boolean false" | debconf-set-selections && \
# the dash shell breaks everything. Replace it with bash as default /bin/sh
DEBIAN_FRONTEND=noninteractive dpkg-reconfigure dash && \
# some packages can't find libpython in x86_64, so link them in /usr/lib
ln -s /usr/lib/x86_64-linux-gnu/libpython3.10.a /usr/lib && ln -s /usr/lib/x86_64-linux-gnu/libpython3.10.so /usr/lib && \
cd opt && \
# Install lua and lmod from source
wget https://sourceforge.net/projects/lmod/files/lua-5.1.4.9.tar.bz2 && tar xvfj lua-5.1.4.9.tar.bz2 && \
cd lua-5.1.4.9 && ./configure --prefix=/usr && make -j 4 && make install && git clone --recursive https://github.com/TACC/Lmod.git && \
cd Lmod && ./configure --prefix=/usr && make -j 4 && make install && \
# spack scipy install is broken, so install on the system
pip install scipy && pip install cython && \
# install boost from source
cd /opt && wget https://boostorg.jfrog.io/artifactory/main/release/1.78.0/source/boost_1_78_0.tar.gz && \
tar xvfz boost_1_78_0.tar.gz && cd boost_1_78_0 && ./bootstrap.sh --prefix=/usr/ --with-python=/usr/bin/python3 && ./b2 install && \
# without an actual python executable, env python fails, so link python3 to python
ln -s /usr/bin/python3 /usr/bin/python && \
# remove build artifacts to reduce size
cd .. && rm -rf boost* && \
rm -rf /opt/build /opt/spack-stack/spack-stack-$branch/cache/* && \
rm -rf /opt/lua* Lmod
#
# Prepare spack-stack just like it is built on RDHPCS platforms under the spack-stack umbrella
RUN mkdir -p /opt/spack-stack
WORKDIR /opt/spack-stack
#
#Copy in the ubuntu-intel configuration files
ADD ubuntu-intel-21.3.tar.gz /opt/spack-stack
## Either copy in the spack-mirror or pull it from s3
ADD spack-mirror.tar.gz /opt
##RUN wget https://epic-sandbox-srw.s3.amazonaws.com/spack-mirror.tar.gz && tar xvfz spack-mirror.tar.gz && rm spack-mirror.tar.gz
#
# This clone version will change for each successive release
RUN git clone -b release/$branch --recursive https://github.com/jcsda/spack-stack.git spack-stack-$branch && \
cd /opt/spack-stack/spack-stack-$branch && \
# set the spack directories to be safe for use by git even though they are in /opt
git config --global --add safe.directory /opt/spack-stack/spack-stack-$branch && \
git config --global --add safe.directory /opt/spack-stack/spack-stack-$branch/spack && \
#
# Get any recent updates to the release
git remote update && git checkout release/$branch && git pull origin release/$branch && \
git submodule sync && git submodule update && \
mv /opt/spack-stack/ubuntu-intel configs/sites && \
#
# Create the environment
. ./setup.sh && spack compiler rm [email protected] && \
export SPACK_SYSTEM_CONFIG_PATH="$PWD/env/unified-env/site" && spack stack create env --site ubuntu-intel --template unified-dev --name unified-env && \
spack compiler add oneapi && spack compiler list && sed -i "s/'%aocc', '%apple-clang', '%gcc', //g" /opt/spack-stack/spack-stack-$branch/envs/unified-env/spack.yaml && \
sed -i 's/\=2021/2021/g' /root/.spack/linux/compilers.yaml && \
#
# Concretize
. ./setup.sh && spack env activate envs/unified-env && \
unset SPACK_SYSTEM_CONFIG_PATH && \
spack config add "packages:fontconfig:variants:+pic" && \
spack config add "packages:pixman:variants:+pic" && \
spack config add "packages:cairo:variants:+pic" && \
sed -i '/awscli/d' /opt/spack-stack/spack-stack-1.6.0/spack/var/spack/repos/jcsda-emc-bundles/packages/ewok-env/package.py && \
spack concretize && mkdir /usr/bin/info && \
spack mirror add unified file:/opt/spack-mirror && spack install --no-check-signature --no-checksum |& tee install.log ; exit 0 && \
rm -rf /opt/dist /opt/build /opt/spack-stack/spack-stack-$branch/cache/* /opt/spack-mirror && \
# refresh the modulefiles and create meta-modules
source /usr/lmod/lmod/init/bash && \
sed -i '/intel-oneapi-mpi/d' envs/unified-env/common/modules.yaml && \
spack module lmod refresh -y && rm -rf ~/.spack && \
spack stack setup-meta-modules && \
module use /opt/spack-stack/spack-stack-$branch/envs/unified-env/install/modulefiles/Core && \
module avail && \
echo "source /usr/lmod/lmod/init/bash" >> /root/.bashenv && \
echo "module use /opt/spack-stack/spack-stack-$branch/envs/unified-env/install/modulefiles/Core" >> /root/.bashenv && \
echo "module load stack-intel intel-oneapi-mpi" >> /root/.bashenv && \
echo "module load stack-intel-oneapi-mpi" >> /root/.bashenv && \
echo "module load jedi-ufs-env" >> /root/.bashenv && \
echo "[[ -s ~/.bashenv ]] && source ~/.bashenv" >> /root/.bash_profile && \
echo "[[ -s ~/.bashenv ]] && source ~/.bashenv" >> /root/.bashrc && \
cp ~/.bashenv /opt/spack-stack/spack-stack-$branch && \
echo "DONE2"
#
ENV SHELL=/bin/bash