@@ -12,42 +12,46 @@ ARG USER_ID=1000
1212ARG GROUP_ID=1000
1313
1414################## Install devito ############################################
15- # Copy Devito
16- ADD . /app/devito
1715
18- # Update if outdated
19- RUN apt-get update
16+ # Update if outdated and install extras
17+ RUN apt-get update && \
18+ apt-get install -y git cmake libncurses5-dev libncursesw5-dev libdrm-dev libsystemd-dev
2019
21- # Remove git files
22- RUN rm -rf /app/devito/.git
20+ # Usefull utilities
21+ # Nvtop
22+ RUN git clone https://github.com/Syllo/nvtop.git /app/nvtop && \
23+ mkdir -p /app/nvtop/build && cd /app/nvtop/build && \
24+ cmake .. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DINTEL_SUPPORT=ON && \
25+ make && make install
2326
24- # Install pip dependencies and devito as a pip package
27+ # Install pip dependencies
2528RUN python3 -m venv /venv && \
2629 /venv/bin/pip install --no-cache-dir --upgrade pip && \
2730 /venv/bin/pip install --no-cache-dir jupyter && \
2831 /venv/bin/pip install --no-cache-dir wheel && \
29- eval "$MPI4PY_FLAGS /venv/bin/pip install --no-cache-dir -r /app/devito/requirements-mpi.txt" && \
30- /venv/bin/pip install --no-cache-dir -e /app/devito[extras,tests] && \
31- rm -rf ~/.cache/pip
32-
33- # Usefull utilities
34- # Nvtop
35- RUN apt-get install -y git cmake libncurses5-dev libncursesw5-dev libdrm-dev libsystemd-dev cmake && \
36- git clone https://github.com/Syllo/nvtop.git /app/nvtop && \
37- mkdir -p /app/nvtop/build && cd /app/nvtop/build && \
38- cmake .. -DNVIDIA_SUPPORT=ON -DAMDGPU_SUPPORT=ON -DINTEL_SUPPORT=ON && \
39- make && \
40- make install && \
4132 ln -fs /app/nvtop/build/src/nvtop /venv/bin/nvtop
4233
43- # Safety cleanup
44- RUN apt-get clean && apt-get autoclean && apt-get autoremove -y && \
45- rm -rf /var/lib/apt/lists/*
34+ # Copy Devito
35+ ADD . /app/devito
36+
37+ # Remove git files
38+ RUN rm -rf /app/devito/.git
39+
40+ # Mpi4py
41+ RUN eval "$MPI4PY_FLAGS /venv/bin/pip install --no-cache-dir --verbose -r /app/devito/requirements-mpi.txt"
42+
43+ # Devito
44+ RUN /venv/bin/pip install --no-cache-dir -e /app/devito[extras,tests] && rm -rf ~/.cache/pip
4645
4746FROM $base as user
4847# COPY is much faster than RUN chown by order of magnitude so we have a final step that
4948# just copies the built image into the user.
5049
50+ # Last installs (such as gdb needed in user mode) and cleanup
51+ RUN apt-get update && apt install gdb -y && \
52+ apt-get clean && apt-get autoclean && apt-get autoremove -y && \
53+ rm -rf /var/lib/apt/lists/*
54+
5155# User/Group Ids
5256ARG USER_ID=1000
5357ARG GROUP_ID=1000
0 commit comments