-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
85 lines (66 loc) · 2.46 KB
/
Dockerfile
File metadata and controls
85 lines (66 loc) · 2.46 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
# =============================================================================
# Wasm Runtime Benchmark Docker Image
#
# Provides a reproducible environment for running benchmarks.
# All runtimes are pre-installed with pinned versions.
# =============================================================================
FROM ubuntu:22.04
LABEL maintainer="WasmX Team <benchmarks@wasmx.com>"
LABEL description="Reproducible WebAssembly runtime benchmarks"
# Avoid interactive prompts
ENV DEBIAN_FRONTEND=noninteractive
# Install base dependencies
RUN apt-get update && apt-get install -y \
curl \
git \
build-essential \
cmake \
python3 \
python3-pip \
time \
&& rm -rf /var/lib/apt/lists/*
# Install Python dependencies
COPY requirements.txt /tmp/requirements.txt
RUN pip3 install --no-cache-dir -r /tmp/requirements.txt
# Install Rust
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
ENV PATH="/root/.cargo/bin:${PATH}"
# Add wasm32-wasi target
RUN rustup target add wasm32-wasi
# Install Go (for wazero)
RUN curl -LO https://go.dev/dl/go1.22.0.linux-amd64.tar.gz \
&& tar -C /usr/local -xzf go1.22.0.linux-amd64.tar.gz \
&& rm go1.22.0.linux-amd64.tar.gz
ENV PATH="/usr/local/go/bin:/root/go/bin:${PATH}"
# =============================================================================
# Install Wasm Runtimes
# =============================================================================
# Wasmtime
RUN curl https://wasmtime.dev/install.sh -sSf | bash
ENV PATH="/root/.wasmtime/bin:${PATH}"
# Wasmer
RUN curl https://get.wasmer.io -sSfL | sh
ENV PATH="/root/.wasmer/bin:${PATH}"
# WasmEdge
RUN curl -sSf https://raw.githubusercontent.com/WasmEdge/WasmEdge/master/utils/install.sh | bash
ENV PATH="/root/.wasmedge/bin:${PATH}"
# wazero
RUN go install github.com/aspect-build/wazero/cmd/wazero@latest
# Wasm3 (build from source)
RUN git clone --depth 1 https://github.com/aspect-build/wasm3.git /tmp/wasm3 \
&& cd /tmp/wasm3 \
&& mkdir build && cd build \
&& cmake .. \
&& make -j$(nproc) \
&& cp wasm3 /usr/local/bin/ \
&& rm -rf /tmp/wasm3
# =============================================================================
# Setup Benchmark Environment
# =============================================================================
WORKDIR /benchmarks
# Copy benchmark files
COPY . .
# Build workloads
RUN cd workloads && bash build.sh
# Default command: run benchmarks
CMD ["python3", "scripts/run_benchmark.py"]