- Added multi-arch support.

- Used multi-stage builds.
This commit is contained in:
Balaji Subramaniam 2018-08-10 13:14:46 -07:00
parent 297170e0bf
commit c8cc7b1c26
5 changed files with 55 additions and 14 deletions

View File

@ -1 +1,3 @@
amd64=debian:stretch
amd64=debian:stretch-slim
arm64=arm64v8/debian:stretch-slim
ppc64le=ppc64le/debian:stretch-slim

View File

@ -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

View File

@ -1 +1,3 @@
amd64=debian:stretch
amd64=debian:stretch-slim
arm64=arm64v8/debian:stretch-slim
ppc64le=ppc64le/debian:stretch-slim

View File

@ -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

View File

@ -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