From 297170e0bf0f6d3b29daeedfc8a514558e57a02b Mon Sep 17 00:00:00 2001 From: Balaji Subramaniam Date: Tue, 19 Jun 2018 15:52:42 -0700 Subject: [PATCH 1/2] Add docker images for node perf testing workloads. --- test/images/node-perf/npb-ep/BASEIMAGE | 1 + test/images/node-perf/npb-ep/Dockerfile | 26 +++++++++++++++++++ test/images/node-perf/npb-ep/README.md | 16 ++++++++++++ test/images/node-perf/npb-ep/VERSION | 1 + test/images/node-perf/npb-is/BASEIMAGE | 1 + test/images/node-perf/npb-is/Dockerfile | 26 +++++++++++++++++++ test/images/node-perf/npb-is/README.md | 16 ++++++++++++ test/images/node-perf/npb-is/VERSION | 1 + test/images/node-perf/tf-wide-deep/BASEIMAGE | 1 + test/images/node-perf/tf-wide-deep/Dockerfile | 24 +++++++++++++++++ test/images/node-perf/tf-wide-deep/README.md | 17 ++++++++++++ test/images/node-perf/tf-wide-deep/VERSION | 1 + 12 files changed, 131 insertions(+) create mode 100644 test/images/node-perf/npb-ep/BASEIMAGE create mode 100644 test/images/node-perf/npb-ep/Dockerfile create mode 100644 test/images/node-perf/npb-ep/README.md create mode 100644 test/images/node-perf/npb-ep/VERSION create mode 100644 test/images/node-perf/npb-is/BASEIMAGE create mode 100644 test/images/node-perf/npb-is/Dockerfile create mode 100644 test/images/node-perf/npb-is/README.md create mode 100644 test/images/node-perf/npb-is/VERSION create mode 100644 test/images/node-perf/tf-wide-deep/BASEIMAGE create mode 100644 test/images/node-perf/tf-wide-deep/Dockerfile create mode 100644 test/images/node-perf/tf-wide-deep/README.md create mode 100644 test/images/node-perf/tf-wide-deep/VERSION diff --git a/test/images/node-perf/npb-ep/BASEIMAGE b/test/images/node-perf/npb-ep/BASEIMAGE new file mode 100644 index 00000000000..8a8f5b8e5b0 --- /dev/null +++ b/test/images/node-perf/npb-ep/BASEIMAGE @@ -0,0 +1 @@ +amd64=debian:stretch diff --git a/test/images/node-perf/npb-ep/Dockerfile b/test/images/node-perf/npb-ep/Dockerfile new file mode 100644 index 00000000000..a7ad6f6d361 --- /dev/null +++ b/test/images/node-perf/npb-ep/Dockerfile @@ -0,0 +1,26 @@ +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM BASEIMAGE + +RUN apt-get update && apt-get install -y build-essential gfortran + +ADD http://www.nas.nasa.gov/assets/npb/NPB3.3.1.tar.gz . +RUN tar xzf NPB3.3.1.tar.gz + +WORKDIR ./NPB3.3.1/NPB3.3-OMP +RUN cp config/NAS.samples/make.def.gcc_x86 config/make.def +RUN make EP CLASS=D + +ENTRYPOINT ./bin/ep.D.x diff --git a/test/images/node-perf/npb-ep/README.md b/test/images/node-perf/npb-ep/README.md new file mode 100644 index 00000000000..b542766d145 --- /dev/null +++ b/test/images/node-perf/npb-ep/README.md @@ -0,0 +1,16 @@ +## NAS Parallel Benchmark Suite - Embarrassingly Parallel (EP) Benchmark + +The container image described here runs the EP benchmark from the +[NAS parallel benchmark suite.](https://www.nas.nasa.gov/publications/npb.html) +This image is used as a workload in in node performance testing. + +## How to release: +``` +# Build +$ cd $K8S_ROOT/test/images +$ make all WHAT=node-perf/npb-ep + +# Push +$ cd $K8S_ROOT/test/images +$ make all-push WHAT=node-perf/npb-ep +``` diff --git a/test/images/node-perf/npb-ep/VERSION b/test/images/node-perf/npb-ep/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/node-perf/npb-ep/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/test/images/node-perf/npb-is/BASEIMAGE b/test/images/node-perf/npb-is/BASEIMAGE new file mode 100644 index 00000000000..8a8f5b8e5b0 --- /dev/null +++ b/test/images/node-perf/npb-is/BASEIMAGE @@ -0,0 +1 @@ +amd64=debian:stretch diff --git a/test/images/node-perf/npb-is/Dockerfile b/test/images/node-perf/npb-is/Dockerfile new file mode 100644 index 00000000000..a5752ff98fe --- /dev/null +++ b/test/images/node-perf/npb-is/Dockerfile @@ -0,0 +1,26 @@ +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM BASEIMAGE + +RUN apt-get update && apt-get install -y build-essential + +ADD http://www.nas.nasa.gov/assets/npb/NPB3.3.1.tar.gz . +RUN tar xzf NPB3.3.1.tar.gz + +WORKDIR ./NPB3.3.1/NPB3.3-OMP +RUN cp config/NAS.samples/make.def.gcc_x86 config/make.def +RUN make IS CLASS=D + +ENTRYPOINT ./bin/is.D.x diff --git a/test/images/node-perf/npb-is/README.md b/test/images/node-perf/npb-is/README.md new file mode 100644 index 00000000000..8449574324d --- /dev/null +++ b/test/images/node-perf/npb-is/README.md @@ -0,0 +1,16 @@ +## NAS Parallel Benchmark Suite - Integer Sort (IS) Benchmark + +The container image described here runs the IS benchmark from the +[NAS parallel benchmark suite.](https://www.nas.nasa.gov/publications/npb.html) +This image is used as a workload in in node performance testing. + +## How to release: +``` +# Build +$ cd $K8S_ROOT/test/images +$ make all WHAT=node-perf/npb-is + +# Push +$ cd $K8S_ROOT/test/images +$ make all-push WHAT=node-perf/npb-is +``` diff --git a/test/images/node-perf/npb-is/VERSION b/test/images/node-perf/npb-is/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/node-perf/npb-is/VERSION @@ -0,0 +1 @@ +1.0 diff --git a/test/images/node-perf/tf-wide-deep/BASEIMAGE b/test/images/node-perf/tf-wide-deep/BASEIMAGE new file mode 100644 index 00000000000..70bc384f0ab --- /dev/null +++ b/test/images/node-perf/tf-wide-deep/BASEIMAGE @@ -0,0 +1 @@ +amd64=python:3.6-slim-stretch diff --git a/test/images/node-perf/tf-wide-deep/Dockerfile b/test/images/node-perf/tf-wide-deep/Dockerfile new file mode 100644 index 00000000000..a11be4fc762 --- /dev/null +++ b/test/images/node-perf/tf-wide-deep/Dockerfile @@ -0,0 +1,24 @@ +# Copyright 2018 The Kubernetes Authors. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +FROM BASEIMAGE + +RUN apt-get update && apt-get install -y git time +RUN pip install tensorflow +RUN git clone https://github.com/tensorflow/models.git +WORKDIR $HOME/models/official/wide_deep +RUN git checkout tags/v1.9.0 +ENV PYTHONPATH $PYTHONPATH:$HOME/models + +ENTRYPOINT python ./wide_deep.py diff --git a/test/images/node-perf/tf-wide-deep/README.md b/test/images/node-perf/tf-wide-deep/README.md new file mode 100644 index 00000000000..7126bf304da --- /dev/null +++ b/test/images/node-perf/tf-wide-deep/README.md @@ -0,0 +1,17 @@ +## Tensorflow Official Wide Deep Model + +The container image described here predicts the income using the census income dataset in Tensorflow. For more +information, see +[https://github.com/tensorflow/models/tree/master/official/wide_deep](https://github.com/tensorflow/models/tree/master/official/wide_deep). +This image is used as a workload in in node performance testing. + +## How to release: +``` +# Build +$ cd $K8S_ROOT/test/images +$ make all WHAT=node-perf/tf-wide-deep + +# Push +$ cd $K8S_ROOT/test/images +$ make all-push WHAT=node-perf/tf-wide-deep +``` diff --git a/test/images/node-perf/tf-wide-deep/VERSION b/test/images/node-perf/tf-wide-deep/VERSION new file mode 100644 index 00000000000..d3827e75a5c --- /dev/null +++ b/test/images/node-perf/tf-wide-deep/VERSION @@ -0,0 +1 @@ +1.0 From c8cc7b1c26fb2d65c1696d454f3fa176594d0d0a Mon Sep 17 00:00:00 2001 From: Balaji Subramaniam Date: Fri, 10 Aug 2018 13:14:46 -0700 Subject: [PATCH 2/2] - Added multi-arch support. - Used multi-stage builds. --- test/images/node-perf/npb-ep/BASEIMAGE | 4 ++- test/images/node-perf/npb-ep/Dockerfile | 22 +++++++++++++--- test/images/node-perf/npb-is/BASEIMAGE | 4 ++- test/images/node-perf/npb-is/Dockerfile | 26 ++++++++++++++++--- test/images/node-perf/tf-wide-deep/Dockerfile | 13 ++++++---- 5 files changed, 55 insertions(+), 14 deletions(-) diff --git a/test/images/node-perf/npb-ep/BASEIMAGE b/test/images/node-perf/npb-ep/BASEIMAGE index 8a8f5b8e5b0..fbe1ea05e77 100644 --- a/test/images/node-perf/npb-ep/BASEIMAGE +++ b/test/images/node-perf/npb-ep/BASEIMAGE @@ -1 +1,3 @@ -amd64=debian:stretch +amd64=debian:stretch-slim +arm64=arm64v8/debian:stretch-slim +ppc64le=ppc64le/debian:stretch-slim diff --git a/test/images/node-perf/npb-ep/Dockerfile b/test/images/node-perf/npb-ep/Dockerfile index a7ad6f6d361..d2b6b9f68ff 100644 --- a/test/images/node-perf/npb-ep/Dockerfile +++ b/test/images/node-perf/npb-ep/Dockerfile @@ -12,7 +12,9 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM BASEIMAGE +FROM BASEIMAGE as build_node_perf_npb_ep + +CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ RUN apt-get update && apt-get install -y build-essential gfortran @@ -20,7 +22,21 @@ ADD http://www.nas.nasa.gov/assets/npb/NPB3.3.1.tar.gz . RUN tar xzf NPB3.3.1.tar.gz WORKDIR ./NPB3.3.1/NPB3.3-OMP -RUN cp config/NAS.samples/make.def.gcc_x86 config/make.def +RUN if [ $(arch) != "x86_64" ]; then \ + sed s/-mcmodel=medium//g config/NAS.samples/make.def.gcc_x86 > config/make.def; \ +else \ + cp config/NAS.samples/make.def.gcc_x86 config/make.def; \ +fi RUN make EP CLASS=D -ENTRYPOINT ./bin/ep.D.x +# Copying the required libraries (shared object files) to a convenient location so that it can be copied into the +# main container in the second build stage. +RUN mkdir -p /lib-copy && find /usr/lib -name "*.so.*" -exec cp {} /lib-copy \; + +FROM BASEIMAGE + +COPY --from=build_node_perf_npb_ep /NPB3.3.1/NPB3.3-OMP/bin/ep.D.x / +COPY --from=build_node_perf_npb_ep /lib-copy /lib-copy +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/lib-copy" + +ENTRYPOINT /ep.D.x diff --git a/test/images/node-perf/npb-is/BASEIMAGE b/test/images/node-perf/npb-is/BASEIMAGE index 8a8f5b8e5b0..fbe1ea05e77 100644 --- a/test/images/node-perf/npb-is/BASEIMAGE +++ b/test/images/node-perf/npb-is/BASEIMAGE @@ -1 +1,3 @@ -amd64=debian:stretch +amd64=debian:stretch-slim +arm64=arm64v8/debian:stretch-slim +ppc64le=ppc64le/debian:stretch-slim diff --git a/test/images/node-perf/npb-is/Dockerfile b/test/images/node-perf/npb-is/Dockerfile index a5752ff98fe..c956658481e 100644 --- a/test/images/node-perf/npb-is/Dockerfile +++ b/test/images/node-perf/npb-is/Dockerfile @@ -12,15 +12,33 @@ # See the License for the specific language governing permissions and # limitations under the License. -FROM BASEIMAGE +FROM BASEIMAGE as build_node_perf_npb_is -RUN apt-get update && apt-get install -y build-essential +CROSS_BUILD_COPY qemu-QEMUARCH-static /usr/bin/ + +RUN apt-get update && apt-get install -y build-essential gfortran ADD http://www.nas.nasa.gov/assets/npb/NPB3.3.1.tar.gz . RUN tar xzf NPB3.3.1.tar.gz WORKDIR ./NPB3.3.1/NPB3.3-OMP -RUN cp config/NAS.samples/make.def.gcc_x86 config/make.def + +# Create build config based on the architecture and build the workload. +RUN if [ $(arch) != "x86_64" ]; then \ + sed s/-mcmodel=medium//g config/NAS.samples/make.def.gcc_x86 > config/make.def; \ +else \ + cp config/NAS.samples/make.def.gcc_x86 config/make.def; \ +fi RUN make IS CLASS=D -ENTRYPOINT ./bin/is.D.x +# Copying the required libraries (shared object files) to a convenient location so that it can be copied into the +# main container in the second build stage. +RUN mkdir -p /lib-copy && find /usr/lib -name "*.so.*" -exec cp {} /lib-copy \; + +FROM BASEIMAGE + +COPY --from=build_node_perf_npb_is /NPB3.3.1/NPB3.3-OMP/bin/is.D.x / +COPY --from=build_node_perf_npb_is /lib-copy /lib-copy +ENV LD_LIBRARY_PATH="${LD_LIBRARY_PATH}:/lib-copy" + +ENTRYPOINT /is.D.x diff --git a/test/images/node-perf/tf-wide-deep/Dockerfile b/test/images/node-perf/tf-wide-deep/Dockerfile index a11be4fc762..f5ab2c5c8dd 100644 --- a/test/images/node-perf/tf-wide-deep/Dockerfile +++ b/test/images/node-perf/tf-wide-deep/Dockerfile @@ -14,11 +14,14 @@ FROM BASEIMAGE -RUN apt-get update && apt-get install -y git time +RUN apt-get update && apt-get install -y wget time RUN pip install tensorflow -RUN git clone https://github.com/tensorflow/models.git -WORKDIR $HOME/models/official/wide_deep -RUN git checkout tags/v1.9.0 -ENV PYTHONPATH $PYTHONPATH:$HOME/models + +RUN wget https://github.com/tensorflow/models/archive/v1.9.0.tar.gz \ +&& tar xzf v1.9.0.tar.gz \ +&& rm -f v1.9.0.tar.gz + +WORKDIR $HOME/models-1.9.0/official/wide_deep +ENV PYTHONPATH $PYTHONPATH:$HOME/models-1.9.0 ENTRYPOINT python ./wide_deep.py