Commit 67f52a8d authored by Chris Lishka's avatar Chris Lishka

Added "make check_cpu" target. Removed unused definitions from Makefile. Added…

Added "make check_cpu" target.  Removed unused definitions from Makefile.  Added chown_files.sh to ngraph_cpp_cpu image, instead of creating new image.
parent b6389f9a
......@@ -4,19 +4,11 @@ FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y build-essential && \
RUN apt-get install -y build-essential cmake && \
apt-get clean autoclean && \
apt-get autoremove -y
RUN apt-get install -y cmake && \
apt-get clean autoclean && \
apt-get autoremove -y
RUN apt-get install -y clang-3.9 && \
apt-get clean autoclean && \
apt-get autoremove -y
RUN apt-get install -y clang-format-3.9 && \
RUN apt-get install -y clang-3.9 clang-format-3.9 && \
apt-get clean autoclean && \
apt-get autoremove -y
......@@ -24,4 +16,7 @@ RUN apt-get install -y git && \
apt-get clean autoclean && \
apt-get autoremove -y
# Add chown_files script to avoid
ADD contrib/docker/chown_files.sh /tmp/chown_files.sh
WORKDIR /root/ngraph-cpp-test
......@@ -7,27 +7,25 @@ GIT_COMMIT = $(shell git rev-parse HEAD)
BUILD_VERSION = ${GIT_COMMIT}_${PYTHON_VERSION}
BUILD_DIR = ${DIR}/contrib/docker/.build-${BUILD_VERSION}
NGRAPH_CPP_CPU_IMG := $(shell docker images ngraph_cpp_cpu)
CALLER_UID := $(shell id -u)
CALLER_GID := $(shell id -g)
# default version is python 2, but can be switched to 3 from command
# Default version is python 2, but can be switched to 3 from command
# line
PYTHON_VERSION = 2
MY_PYTHONPATH=./:/root/ngraph-cpp-test/
.PHONY: clean build_ngraph_cpp_cpu shell build_all
.PHONY: clean build_ngraph_cpp_cpu check_cpu shell build_all
DOCKER_BUILD=docker build --rm=true
ifdef http_proxy
DOCKER_BUILD+=--build-arg http_proxy=$(http_proxy)
DOCKER_RUN_ENV+=--env http_proxy=$(http_proxy)
endif
ifdef http_proxy
ifdef https_proxy
DOCKER_BUILD+=--build-arg https_proxy=$(https_proxy)
DOCKER_RUN_ENV+=--env https_proxy=$(https_proxy)
endif
expand_dockerfile_templates:
......@@ -38,8 +36,6 @@ expand_dockerfile_templates:
clean:
rm -f ${DIR}/contrib/docker/.build-*/Dockerfile.* || echo "keep going if files are not present"
rmdir ${DIR}/contrib/docker/.build-* || echo "keep going if directory is not present"
rm -f ${DIR}/*.xml
rm -f ${DIR}/*.dat
build_ngraph_cpp_cpu: expand_dockerfile_templates
$(DOCKER_BUILD) -f=${BUILD_DIR}/Dockerfile.ngraph_cpp_cpu --build-arg python_version=${PYTHON_VERSION} -t=ngraph_cpp_cpu:${BUILD_VERSION} ${DIR}
......@@ -49,6 +45,16 @@ build_ngraph_cpp_cpu: expand_dockerfile_templates
build_all: build_ngraph_cpp_cpu
check_cpu: build_ngraph_cpp_cpu
docker run --rm ${DOCKER_RUN_ENV} ${VOLUME} -t ngraph_cpp_cpu:${BUILD_VERSION} sh -c "mkdir BUILD ; cd BUILD ; cmake .. ; make check"
# update the files to be owned by the calling user instead of root, to avoid docker mount problems with file ownership
docker run --rm ${VOLUME} \
--env MY_UID=${CALLER_UID} \
--env MY_GID=${CALLER_GID} \
--env MY_ROOT_DIR=/root/ngraph-cpp-test \
-t ngraph_cpp_cpu \
/tmp/chown_files.sh
shell: build_ngraph_cpp_cpu
docker run --rm ${VOLUME} -it ngraph_cpp_cpu:${BUILD_VERSION} /bin/bash
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment