-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.dockerfile
More file actions
90 lines (81 loc) · 2.92 KB
/
build.dockerfile
File metadata and controls
90 lines (81 loc) · 2.92 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
ARG CPP_VERSION
ARG EXAMPLES_VERSION
# Base image is not re-built often and tag may lag behind
FROM ghcr.io/faasm/examples-base:0.6.0_0.4.0 AS base
FROM ghcr.io/faasm/cpp-sysroot:${CPP_VERSION:-dead}
SHELL ["/bin/bash", "-c"]
ENV IN_DOCKER="on"
# Copy built OpenMPI from previous step
COPY --from=base /tmp/openmpi-4.1.0/ /tmp/openmpi-4.1.0/
# Install OpenMPI
RUN cd /tmp/openmpi-4.1.0 \
&& make install \
&& cd /tmp \
&& rm -rf /tmp/openmpi-4.1.0 /tmp/openmpi-4.1.0.tar.bz2
# Install OpenMP
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update \
&& apt install -y libomp-17-dev
# Install rust
RUN curl --proto '=https' --tlsv1.3 https://sh.rustup.rs -sSf | sh -s -- -y \
&& source ~/.cargo/env \
&& rustup target add wasm32-wasip1
# Fetch the code and update submodules
ARG EXAMPLES_VERSION
RUN mkdir -p code \
&& git clone -b v${EXAMPLES_VERSION} \
https://github.com/faasm/examples \
/code/examples \
&& cd /code/examples \
&& git submodule update --init -f cpp \
&& git submodule update --init -f python \
# Fetch all the example submodules
&& git submodule update --init -f examples/FFmpeg \
&& git submodule update --init -f examples/ImageMagick \
&& git submodule update --init -f examples/Kernels \
&& git submodule update --init -f examples/lammps \
&& git submodule update --init -f examples/lammps-migration \
&& git submodule update --init -f examples/lammps-migration-net \
&& git submodule update --init -f examples/LULESH \
&& git submodule update --init -f examples/libpng \
&& git submodule update --init -f examples/polybench \
&& git submodule update --init -f examples/rabe \
&& git submodule update --init -f examples/tensorflow \
&& git submodule update --init -f examples/tless-jwt
# Build the examples and demo functions
ENV PATH=${PATH}:/root/.cargo/bin
RUN cd /code/examples \
&& ./bin/create_venv.sh \
&& source venv/bin/activate \
# Build the native versions of the examples that support it
&& inv kernels --native \
&& inv lammps --native \
&& inv lammps --migration --native \
&& inv lammps --migration-net --native \
&& inv lulesh --native \
&& inv polybench --native \
# Build the WASM applications
&& inv ffmpeg \
&& inv jwt \
# ImageMagick needs libpng
&& inv libpng imagemagick \
&& inv kernels \
&& inv lammps \
&& inv lammps --migration \
&& inv lammps --migration-net \
&& inv lulesh \
&& inv polybench \
&& inv rabe \
&& inv tensorflow \
# These demo functions link with the cross-compiled static libraries
&& inv func ffmpeg check \
&& inv func jwt test \
&& inv func lammps chain \
&& inv func mpi migrate \
&& inv func rabe test \
&& inv func tf check
# Prepare bashrc
WORKDIR /code/examples
RUN echo ". /code/examples/bin/workon.sh" >> ~/.bashrc
RUN echo ". $HOME/.cargo/env" >> ~/.bashrc
CMD ["/bin/bash", "-l"]