Add benchmark build scripts to Dockerfile

This commit is contained in:
Yuke Peng
2024-06-29 14:15:54 +08:00
committed by Tate, Hongliang Tian
parent 28f5480f70
commit bb05153352
2 changed files with 34 additions and 4 deletions

View File

@ -90,6 +90,9 @@ $(INITRAMFS)/benchmark/bin:
@cp /usr/local/benchmark/sysbench/bin/sysbench $@ @cp /usr/local/benchmark/sysbench/bin/sysbench $@
@cp /usr/local/benchmark/iperf/bin/iperf3 $@ @cp /usr/local/benchmark/iperf/bin/iperf3 $@
@cp /usr/local/benchmark/membench/membench $@ @cp /usr/local/benchmark/membench/membench $@
@cp /usr/local/benchmark/iozone $@
@cp -r /usr/local/benchmark/unixbench $@
@cp -r /usr/local/benchmark/lmbench $@
@# Replace the homebrewed getpid with a standard benchmark like UnixBench or LMbench. @# Replace the homebrewed getpid with a standard benchmark like UnixBench or LMbench.
@gcc -O2 $(CUR_DIR)/apps/getpid/getpid.c -o $@/getpid @gcc -O2 $(CUR_DIR)/apps/getpid/getpid.c -o $@/getpid

View File

@ -36,12 +36,18 @@ FROM build-base as build-benchmarks
WORKDIR /root WORKDIR /root
RUN apt install -y automake \ RUN apt install -y automake \
libtool \ libtool \
pkg-config pkg-config \
libntirpc-dev
RUN wget https://github.com/akopytov/sysbench/archive/1.0.20.tar.gz \ RUN wget https://github.com/akopytov/sysbench/archive/1.0.20.tar.gz \
&& tar -zxvf 1.0.20.tar.gz \ && tar -zxvf 1.0.20.tar.gz \
&& rm 1.0.20.tar.gz && rm 1.0.20.tar.gz
RUN git clone https://github.com/nicktehrany/membench.git RUN git clone https://github.com/nicktehrany/membench.git
RUN git clone https://github.com/esnet/iperf.git RUN git clone https://github.com/esnet/iperf.git
RUN git clone https://github.com/kdlucas/byte-unixbench.git
RUN git clone https://github.com/asterinas/lmbench.git
RUN wget https://www.iozone.org/src/current/iozone3_506.tar
RUN tar -x -f iozone3_506.tar
# Build sysbench # Build sysbench
WORKDIR /root/sysbench-1.0.20 WORKDIR /root/sysbench-1.0.20
@ -62,10 +68,31 @@ RUN ./configure --prefix=/usr/local/benchmark/iperf \
&& make -j \ && make -j \
&& make install && make install
# Build lmbench
WORKDIR /root/lmbench
RUN make -j \
&& mv bin/x86_64-linux-gnu /usr/local/benchmark/lmbench \
&& rm /usr/local/benchmark/lmbench/*.o \
&& rm /usr/local/benchmark/lmbench/*.a
# Build unixbench
WORKDIR /root/byte-unixbench/UnixBench
RUN make UB_GCC_OPTIONS=-mno-sse2 -j && mv pgms /usr/local/benchmark/unixbench
# Build iozone
WORKDIR /root/iozone3_506/src/current
RUN CFLAGS=-static make linux-AMD64 \
&& cp iozone /usr/local/benchmark/
# Clear cached files
WORKDIR /root WORKDIR /root
RUN rm -rf sysbench-1.0.20 \ RUN rm -rf sysbench-1.0.20 \
membench \ membench \
iperf iperf \
lmbench \
byte-unixbench \
iozone3_506.tar \
iozone3_506
#= Build syscall test ========================================================= #= Build syscall test =========================================================
@ -138,10 +165,10 @@ FROM build-ovmf as ovmf
WORKDIR /root WORKDIR /root
RUN git clone --depth 1 --branch edk2-stable202402 --recurse-submodules --shallow-submodules https://github.com/tianocore/edk2.git RUN git clone --depth 1 --branch edk2-stable202402 --recurse-submodules --shallow-submodules https://github.com/tianocore/edk2.git
WORKDIR /root/edk2 WORKDIR /root/edk2
RUN source ./edksetup.sh \ RUN /bin/bash -c "source ./edksetup.sh \
&& make -C BaseTools \ && make -C BaseTools \
&& build -a X64 -t GCC5 -b DEBUG -p OvmfPkg/OvmfPkgX64.dsc -D DEBUG_ON_SERIAL_PORT \ && build -a X64 -t GCC5 -b DEBUG -p OvmfPkg/OvmfPkgX64.dsc -D DEBUG_ON_SERIAL_PORT \
&& build -a X64 -t GCC5 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc && build -a X64 -t GCC5 -b RELEASE -p OvmfPkg/OvmfPkgX64.dsc"
#= Build GRUB ================================================================= #= Build GRUB =================================================================