forked from JCSDA/spack-stack
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocker-ubuntu-intel-impi.yaml
220 lines (207 loc) · 7.06 KB
/
docker-ubuntu-intel-impi.yaml
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
spack:
concretizer:
unify: true
view: false
config:
checksum: false
build_jobs: 2
connect_timeout: 60
compilers:
- compiler:
spec: intel@2022.1.0
paths:
cc: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/icc
cxx: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/icpc
f77: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/ifort
fc: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64/ifort
flags: {}
operating_system: ubuntu20.04
modules: []
environment:
prepend_path:
PATH: /usr/bin
LD_LIBRARY_PATH: /usr/lib64:/opt/intel/oneapi/compiler/2022.1.0/linux/compiler/lib/intel64_lin
CPATH: /usr/include
extra_rpaths: []
# Basic package config from configs/common/packages.yaml
# Additional package config for container
packages:
all:
require: '%intel'
target: [core2]
providers:
mpi: [intel-oneapi-mpi@2021.6.0]
compiler: [intel@2022.1.0]
intel:
buildable: false
externals:
- spec: intel@2022.1.0
prefix: /opt/intel/oneapi/compiler/2022.1.0/linux/bin/intel64
intel-oneapi-mpi:
buildable: false
externals:
- spec: intel-oneapi-mpi@2021.6.0
prefix: /opt/intel/oneapi
intel-oneapi-mkl:
buildable: false
externals:
- spec: intel-oneapi-mkl@2022.1.0
prefix: /opt/intel/oneapi
diffutils:
buildable: false
externals:
- spec: diffutils@3.7
prefix: /usr
git:
buildable: false
externals:
- spec: git@2.25.1~tcltk
prefix: /usr
git-lfs:
buildable: false
externals:
- spec: git-lfs@2.9.2
prefix: /usr
mysql:
buildable: false
externals:
- spec: mysql@8.0.32
prefix: /usr
# Turn off crypt, because libxcrypt doesn't
# build with Intel.
python:
variants: ~crypt
qt:
buildable: false
externals:
- spec: qt@5.12.8
prefix: /usr
version: [5.15.3]
wget:
buildable: false
externals:
- spec: wget@1.20.3
prefix: /usr
version: [1.21.2]
specs: []
container:
# Select the format of the recipe e.g. docker,
# singularity or anything else that is currently supported
format: docker
# How to use:
#$ spack containerize > Dockerfile
#$ sudo docker build -t myimage .
#$ sudo docker run -it myimage
#format: singularity
# How to use:
#$ spack containerize > singularity.def
#$ sudo singularity build singularity.sif singularity.def
# Sets the base images for the stages where Spack builds the
# software or where the software gets installed after being built..
images:
os: ubuntu:20.04
spack:
url: https://github.com/jcsda/spack
ref: spack-stack-1.4.1
resolve_sha: false
# Whether or not to strip binaries
strip: false
## Additional system packages that are needed at runtime
os_packages:
build:
- bc
- cpp
- g++
- gcc
- gfortran
- git
- git-lfs
- gpg
- make
- mysql-server
- qt5-default
- libqt5svg5-dev
- qt5dxcb-plugin
- wget
final:
- bc
- cpp
- g++
- gcc
- gfortran
- git
- git-lfs
- gpg
- make
- mysql-server
- qt5-default
- libqt5svg5-dev
- qt5dxcb-plugin
- wget
# Implicitly included in build step
- build-essential
- ca-certificates
- curl
- file
- gnupg2
- iproute2
- locales
- python3
- python3-pip
- python3-setuptools
- unzip
- vim
# Extra instructions
extra_instructions:
pre_build: |
RUN apt update && apt install apt-utils && \
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \
apt update && \
apt install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2022.1.0 intel-oneapi-compiler-fortran-2022.1.0 intel-oneapi-mkl-devel-2022.1.0 intel-oneapi-mpi-devel-2021.6.0 -y
pre_final: |
#Set environment variables for installing tzdata
ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Etc/UTC
ENV CC=icc
ENV CXX=icpc
ENV FC=ifort
build: |
# Put output of spack find into a file
RUN cd /opt/spack-environment && \
spack env activate -d . && \
spack find 2>&1 | tee /root/spack_find.out
final: |
RUN apt update && apt install apt-utils && \
wget -O- https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS.PUB | gpg --dearmor | tee /usr/share/keyrings/oneapi-archive-keyring.gpg > /dev/null && \
echo "deb [signed-by=/usr/share/keyrings/oneapi-archive-keyring.gpg] https://apt.repos.intel.com/oneapi all main" | tee /etc/apt/sources.list.d/oneAPI.list && \
apt update && \
apt install intel-oneapi-compiler-dpcpp-cpp-and-cpp-classic-2022.1.0 intel-oneapi-compiler-fortran-2022.1.0 intel-oneapi-mkl-devel-2022.1.0 intel-oneapi-mpi-devel-2021.6.0 -y
# Copy spack find output from builder
COPY --from=builder /root/spack_find.out /root/spack_find.out
# Make a non-root user:nonroot / group:nonroot for running MPI
RUN useradd -U -k /etc/skel -s /bin/bash -d /home/nonroot -m nonroot --uid 43891 && \
echo "ulimit -s unlimited" >> /home/nonroot/.bashrc && \
echo "ulimit -v unlimited" >> /home/nonroot/.bashrc && \
echo "export CC=icc" >> /home/nonroot/.bashrc && \
echo "export CXX=icpc" >> /home/nonroot/.bashrc && \
echo "export FC=ifort" >> /home/nonroot/.bashrc && \
echo "source /opt/intel/oneapi/compiler/latest/env/vars.sh" >> /home/nonroot/.bashrc && \
echo "source /opt/intel/oneapi/mpi/latest/env/vars.sh" >> /home/nonroot/.bashrc && \
printf "[credential]\n helper = cache --timeout=7200\n" >> /home/nonroot/.gitconfig && \
chown -R nonroot:nonroot /home/nonroot/.gitconfig
# Replicate settings for root user
RUN echo "ulimit -s unlimited" >> /root/.bashrc && \
echo "ulimit -v unlimited" >> /root/.bashrc && \
echo "export CC=icc" >> /root/.bashrc && \
echo "export CXX=icpc" >> /root/.bashrc && \
echo "export FC=ifort" >> /root/.bashrc && \
echo "source /opt/intel/oneapi/compiler/latest/env/vars.sh" >> /root/.bashrc && \
echo "source /opt/intel/oneapi/mpi/latest/env/vars.sh" >> /root/.bashrc && \
printf "[credential]\n helper = cache --timeout=7200\n" >> /root/.gitconfig
# Source spack environment script for root
RUN echo "source /etc/profile.d/z10_spack_environment.sh\n" >> /root/.bashrc
# Labels for the image
labels:
app: ""
mpi: "intel-oneapi-mpi"