Unverified Commit 5ec9e25f authored by DawnStone's avatar DawnStone Committed by GitHub

modified references for ngraph repo rename - part 2 (#636)

* modified references for ngraph repo rename - part 2

* updated the ngraph repo name reference in the INSTALL readme file
parent 3ea55bb5
......@@ -36,7 +36,7 @@ General Instructions
These instructions assume that your system has been prepared in accordance
with the above prerequisites.
$ cd ngraph-cpp
$ cd ngraph
$ mkdir build
$ cd build
$ cmake .. \
......
# Environment to build and unit-test ngraph-cpp
# Environment to build and unit-test ngraph
FROM ubuntu:16.04
......
# Environment to build and unit-test ngraph-cpp on centos74
# Environment to build and unit-test ngraph on centos74
# with gcc 4.8.5
# with python 2.7
# with cmake3
......
# Environment to build and unit-test ngraph-cpp
# Environment to build and unit-test ngraph
FROM ubuntu:16.04
......
# Environment to build and unit-test ngraph-cpp
# Environment to build and unit-test ngraph
FROM ubuntu:16.04
......
......@@ -25,9 +25,9 @@ DIR = $(realpath ../..)
# changed it must be done in other areas for the builds to work.
DOCKUSER_HOME=/home/dockuser
# Use /home/dockuser/ngraph-cpp-test, because we run as the user (and not root)
# /root/ngraph-cpp-test is not used, because /root is not accessible to user
VOLUME = -v "${DIR}:${DOCKUSER_HOME}/ngraph-cpp-test"
# Use /home/dockuser/ngraph-test, because we run as the user (and not root)
# /root/ngraph-test is not used, because /root is not accessible to user
VOLUME = -v "${DIR}:${DOCKUSER_HOME}/ngraph-test"
GIT_COMMIT = $(shell git rev-parse HEAD)
DBUILD_VERSION = ${GIT_COMMIT}_${PYTHON_VERSION}
DBUILD_DIR = ${DIR}/contrib/docker/.build-${DBUILD_VERSION}
......@@ -44,18 +44,18 @@ ifndef OS
endif
ifeq ("$(shell echo ${OS} | grep centos)","centos74")
RUN_AS_USER_SCRIPT=${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_centos_user.sh
DOCKERFILE=Dockerfile.ngraph_cpp.centos74_cmake3
RUN_AS_USER_SCRIPT=${DOCKUSER_HOME}/ngraph-test/contrib/docker/run_as_centos_user.sh
DOCKERFILE=Dockerfile.ngraph.centos74_cmake3
else
DOCKERFILE ?= "Dockerfile.ngraph_cpp"
RUN_AS_USER_SCRIPT ?= ${DOCKUSER_HOME}/ngraph-cpp-test/contrib/docker/run_as_ubuntu_user.sh
DOCKERFILE ?= "Dockerfile.ngraph"
RUN_AS_USER_SCRIPT ?= ${DOCKUSER_HOME}/ngraph-test/contrib/docker/run_as_ubuntu_user.sh
endif
# For gcc builds, we do NOT regard warnings as errors
# For clang builds, we DO make warnings into errors
CMAKE_OPTIONS_COMMON=-DNGRAPH_BUILD_DOXYGEN_DOCS=ON -DNGRAPH_BUILD_SPHINX_DOCS=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo $(CMAKE_OPTIONS_EXTRA)
CMAKE_OPTIONS_GCC=$(CMAKE_OPTIONS_COMMON) -DNGRAPH_INSTALL_PREFIX=${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC/ngraph_dist
CMAKE_OPTIONS_CLANG=$(MAKE_OPTIONS_COMMON)-DNGRAPH_INSTALL_PREFIX=${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG/ngraph_dist -DCMAKE_CXX_COMPILER=clang++-3.9 -DCMAKE_C_COMPILER=clang-3.9 -DNGRAPH_WARNINGS_AS_ERRORS=ON -DNGRAPH_USE_PREBUILT_LLVM=TRUE
CMAKE_OPTIONS_GCC=$(CMAKE_OPTIONS_COMMON) -DNGRAPH_INSTALL_PREFIX=${DOCKUSER_HOME}/ngraph-test/BUILD-GCC/ngraph_dist
CMAKE_OPTIONS_CLANG=$(MAKE_OPTIONS_COMMON)-DNGRAPH_INSTALL_PREFIX=${DOCKUSER_HOME}/ngraph-test/BUILD-CLANG/ngraph_dist -DCMAKE_CXX_COMPILER=clang++-3.9 -DCMAKE_C_COMPILER=clang-3.9 -DNGRAPH_WARNINGS_AS_ERRORS=ON -DNGRAPH_USE_PREBUILT_LLVM=TRUE
CALLER_UID := $(shell id -u)
CALLER_GID := $(shell id -g)
......@@ -64,10 +64,10 @@ CALLER_GID := $(shell id -g)
# line
PYTHON_VERSION = 2
# Some targets are DEPRECATED and will be removed at a later date: check_cpu build_ngraph_cpp_cpu
# Some targets are DEPRECATED and will be removed at a later date: check_cpu build_ngraph_cpu
# These DEPRECATED targets are currently included for Jenkins job compatibility with older dev branches
# Please see comments for individual targets for more details
.PHONY: clean build_docker_image build_gcc check_gcc build_clang check_clang install_gcc install_clang shell check_cpu build_all build_ngraph_cpp_cpu
.PHONY: clean build_docker_image build_gcc check_gcc build_clang check_clang install_gcc install_clang shell check_cpu build_all build_ngraph_cpu
DOCKER_BUILD=docker build --rm=true
......@@ -91,13 +91,13 @@ expand_dockerfile_templates:
@echo "RUN_AS_USER_SCRIPT=${RUN_AS_USER_SCRIPT}"
cd "${DIR}"/contrib/docker
mkdir "${DBUILD_DIR}" || true
sed -e 's/\(FROM ngraph.*\)/\1:${DBUILD_VERSION}/' ${DOCKERFILE} > "${DBUILD_DIR}"/Dockerfile.build_ngraph_cpp
sed -e 's/\(FROM ngraph.*\)/\1:${DBUILD_VERSION}/' ${DOCKERFILE} > "${DBUILD_DIR}"/Dockerfile.build_ngraph
build_docker_image: expand_dockerfile_templates
$(DOCKER_BUILD) -f="${DBUILD_DIR}"/Dockerfile.build_ngraph_cpp --build-arg python_version="${PYTHON_VERSION}" -t=build_ngraph_cpp:"${DBUILD_VERSION}" .
$(DOCKER_BUILD) -f="${DBUILD_DIR}"/Dockerfile.build_ngraph --build-arg python_version="${PYTHON_VERSION}" -t=build_ngraph:"${DBUILD_VERSION}" .
# remove the tag for the previous latest image
docker rmi build_ngraph_cpp:latest || echo "keep going if docker rmi command fails"
docker tag `docker images -q "build_ngraph_cpp:${DBUILD_VERSION}"` build_ngraph_cpp:latest
docker rmi build_ngraph:latest || echo "keep going if docker rmi command fails"
docker tag `docker images -q "build_ngraph:${DBUILD_VERSION}"` build_ngraph:latest
build_docker: build_docker_image
......@@ -110,8 +110,8 @@ sphinx_doc: build_docker_image
${VOLUME} \
{DOCKER_RUN_ENV} \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/doc/sphinx; env VERBOSE=1 make html 2>&1 | tee make_sphinx_html.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-test/doc/sphinx; env VERBOSE=1 make html 2>&1 | tee make_sphinx_html.log" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Build
......@@ -126,10 +126,10 @@ build_gcc: build_docker_image
docker run --rm --tty \
${VOLUME} \
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC/unit-test-results.xml" \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-test/BUILD-GCC/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -x; set -e ; set -o pipefail ; if [ -f "/etc/centos-release" ]; then cat /etc/centos-release; fi; if [ -f "/etc/lsb-release" ]; then cat /etc/lsb-release; fi; uname -a ; cat /etc/os-release || true; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC; cmake ${CMAKE_OPTIONS_GCC} .. 2>&1 | tee cmake_gcc.log ; env VERBOSE=1 make ${PARALLEL} 2>&1 | tee make_gcc.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
--env RUN_CMD="set -x; set -e ; set -o pipefail ; if [ -f "/etc/centos-release" ]; then cat /etc/centos-release; fi; if [ -f "/etc/lsb-release" ]; then cat /etc/lsb-release; fi; uname -a ; cat /etc/os-release || true; cd ${DOCKUSER_HOME}/ngraph-test/BUILD-GCC; cmake ${CMAKE_OPTIONS_GCC} .. 2>&1 | tee cmake_gcc.log ; env VERBOSE=1 make ${PARALLEL} 2>&1 | tee make_gcc.log" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
build_clang: build_docker_image
......@@ -141,10 +141,10 @@ build_clang: build_docker_image
docker run --rm --tty \
${VOLUME} \
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG/unit-test-results.xml" \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-test/BUILD-CLANG/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; if [ -f "/etc/centos-release" ]; then cat /etc/centos-release; fi; if [ -f "/etc/lsb-release" ]; then cat /etc/lsb-release; fi; uname -a ; cat /etc/os-release || true; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG; cmake ${CMAKE_OPTIONS_CLANG} .. 2>&1 | tee cmake_clang.log ; env VERBOSE=1 make ${PARALLEL} 2>&1 | tee make_clang.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
--env RUN_CMD="set -e ; set -o pipefail ; if [ -f "/etc/centos-release" ]; then cat /etc/centos-release; fi; if [ -f "/etc/lsb-release" ]; then cat /etc/lsb-release; fi; uname -a ; cat /etc/os-release || true; cd ${DOCKUSER_HOME}/ngraph-test/BUILD-CLANG; cmake ${CMAKE_OPTIONS_CLANG} .. 2>&1 | tee cmake_clang.log ; env VERBOSE=1 make ${PARALLEL} 2>&1 | tee make_clang.log" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Check (run unit-tests)
......@@ -155,30 +155,30 @@ check_gcc: build_gcc
docker run --rm --tty \
${VOLUME} \
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC/unit-test-results.xml" \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-test/BUILD-GCC/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC; env VERBOSE=1 make unit-test-check 2>&1 | tee make_check_gcc.log ; sed -E -e 's/classname\=\"[a-zA-Z0-9_]+/&1_gcc/' unit-test-results.xml > unit-test-results-gcc.xml" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-test/BUILD-GCC; env VERBOSE=1 make unit-test-check 2>&1 | tee make_check_gcc.log ; sed -E -e 's/classname\=\"[a-zA-Z0-9_]+/&1_gcc/' unit-test-results.xml > unit-test-results-gcc.xml" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
check_clang: build_clang
docker run --rm --tty \
${VOLUME} \
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG/unit-test-results.xml" \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-test/BUILD-CLANG/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG; env VERBOSE=1 make check 2>&1 | tee make_check_clang.log ; sed -E -e 's/classname\=\"[a-zA-Z0-9_]+/&1_clang/' unit-test-results.xml > unit-test-results-clang.xml" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-test/BUILD-CLANG; env VERBOSE=1 make check 2>&1 | tee make_check_clang.log ; sed -E -e 's/classname\=\"[a-zA-Z0-9_]+/&1_clang/' unit-test-results.xml > unit-test-results-clang.xml" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
style_clang: build_clang
docker run --rm --tty \
${VOLUME} \
${DOCKER_RUN_ENV} \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG/unit-test-results.xml" \
--env GTEST_OUTPUT="xml:${DOCKUSER_HOME}/ngraph-test/BUILD-CLANG/unit-test-results.xml" \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG; env VERBOSE=1 make style-check 2>&1 | tee make_style_check_clang.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
--env RUN_CMD="set -e ; set -o pipefail ; cd ${DOCKUSER_HOME}/ngraph-test/BUILD-CLANG; env VERBOSE=1 make style-check 2>&1 | tee make_style_check_clang.log" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Install
......@@ -191,8 +191,8 @@ install_gcc: check_gcc
${VOLUME} \
${DOCKER_RUN_ENV} \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-GCC ; test -d ngraph_dist && rm -fr ngraph_dist && echo 'Removed old ngraph_dist directory' ; make install 2>&1 | tee make_install_gcc.log ; tar czf ngraph_dist_gcc.tgz ngraph_dist 2>&1 | tee make_tarball_gcc.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
--env RUN_CMD="set -e ; set -o pipefail; cd ${DOCKUSER_HOME}/ngraph-test/BUILD-GCC ; test -d ngraph_dist && rm -fr ngraph_dist && echo 'Removed old ngraph_dist directory' ; make install 2>&1 | tee make_install_gcc.log ; tar czf ngraph_dist_gcc.tgz ngraph_dist 2>&1 | tee make_tarball_gcc.log" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
install_clang: check_clang
......@@ -201,8 +201,8 @@ install_clang: check_clang
${VOLUME} \
${DOCKER_RUN_ENV} \
--env RUN_UID="$(shell id -u)" \
--env RUN_CMD="set -e ; set -o pipefail; cd ${DOCKUSER_HOME}/ngraph-cpp-test/BUILD-CLANG ; test -d ngraph_dist && rm -fr ngraph_dist && echo 'Removed old ngraph_dist directory' ; make install 2>&1 | tee make_install_clang.log ; tar czf ngraph_dist_clang.tgz ngraph_dist 2>&1 | tee make_tarball_clang.log" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
--env RUN_CMD="set -e ; set -o pipefail; cd ${DOCKUSER_HOME}/ngraph-test/BUILD-CLANG ; test -d ngraph_dist && rm -fr ngraph_dist && echo 'Removed old ngraph_dist directory' ; make install 2>&1 | tee make_install_clang.log ; tar czf ngraph_dist_clang.tgz ngraph_dist 2>&1 | tee make_tarball_clang.log" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Interactive shell
......@@ -213,7 +213,7 @@ shell: build_docker_image
${VOLUME} \
${DOCKER_RUN_ENV} \
--env RUN_UID="$(shell id -u)" \
"build_ngraph_cpp:${DBUILD_VERSION}" \
"build_ngraph:${DBUILD_VERSION}" \
sh -c "cd ${DOCKUSER_HOME}; ${RUN_AS_USER_SCRIPT}"
# Clean
......@@ -234,6 +234,6 @@ check_cpu: check_all
echo 'WARNING: "make check_cpu" is DEPRECATED and will be removed in a future revision'
echo ' "make check_cpu" runs "make check_all" now, building with all compilers (gcc and clang)'
build_ngraph_cpp_cpu: build_docker_image
echo 'WARNING: "make build_ngraph_cpp_cpu" is DEPRECATED and will be removed in a future revision'
echo ' "make build_ngraph_cpp_cpu" runs "make build_docker_image" now'
build_ngraph_cpu: build_docker_image
echo 'WARNING: "make build_ngraph_cpu" is DEPRECATED and will be removed in a future revision'
echo ' "make build_ngraph_cpu" runs "make build_docker_image" now'
# Docker Builds for the NGraph-Cpp _Reference-OS_
# Docker Builds for ngraph with a _Reference-OS_
## Introduction
This directory contains a basic build system for creating docker images of the _reference-OS_ on which NGraph-Cpp builds and unit tests are run. The purpose is to provide reference builds for _Continuous Integration_ used in developing and testing NGraph-Cpp.
This directory contains a basic build system for creating docker images of the _reference-OS_ on which ngraph builds and unit tests are run. The purpose is to provide reference builds for _Continuous Integration_ used in developing and testing ngraph.
The `Makefile` provides targets for:
* Building the _reference-OS_ into a docker image
* Building NGraph-Cpp and running unit tests in this cloned repo, mounted into the docker image of the _reference-OS_
* Building ngraph and running unit tests in this cloned repo, mounted into the docker image of the _reference-OS_
* Starting an interactive shell in the _reference-OS_ docker image, with the cloned repo available for manual builds and unit testing
The _make targets_ are designed to handle all aspects of building the _reference-OS_ docker image, running NGraph-Cpp builds and unit testing in it, and opening up a session in the docker image for interactive use. You should not need to issue any manual commands (unless you want to). In addition the `Dockerfile.ngraph_cpp_cpu` provides a description of how the _reference-OS_ is built, should you want to build your own server or docker image.
The _make targets_ are designed to handle all aspects of building the _reference-OS_ docker image, running ngraph builds and unit testing in it, and opening up a session in the docker image for interactive use. You should not need to issue any manual commands (unless you want to). In addition the `Dockerfile.ngraph_cpu` provides a description of how the _reference-OS_ is built, should you want to build your own server or docker image.
## Prerequisites
......@@ -27,13 +27,13 @@ The _make targets_ are designed to provide easy commands to run actions using th
Most make targets are structured in the form `<action>_<compiler>`. The `<action>` indicates what you want to do (e.g. build, check, install), while the `<compiler>` indicates what you want to build with (i.e. gcc or clang).
* In general, you simply need to run the command **`make check_all`**. This first makes the `build_docker_ngraph_cpp` target as a dependency. Then it makes the `build_*` and `check_*` targets, which will build NGraph-Cpp using _cmake_ and _make_ and then run unit testing. Please keep in mind that `make check_*` targets do not work when your working directory is in an NFS filesystem that uses _root squash_ (see **Notes** section below).
* In general, you simply need to run the command **`make check_all`**. This first makes the `build_docker_ngraph` target as a dependency. Then it makes the `build_*` and `check_*` targets, which will build ngraph using _cmake_ and _make_ and then run unit testing. Please keep in mind that `make check_*` targets do not work when your working directory is in an NFS filesystem that uses _root squash_ (see **Notes** section below).
* Two builds are supported: building with `gcc` and `clang`. Targets are named `*_gcc` and `*_clang` when they refer to building with a specific compiler, and the `*_all` targets are available to build with both compilers. Output directories are BUILD-GCC and BUILD-CLANG, at the top level.
* You can also run the command **`make shell`** to start an interactive bash shell inside the docker image. While this is not required for normal builds and unit testing, it allows you to run interactively within the docker image with the cloned repo mounted. Again, `build_docker_ngraph_cpp` is made first as a dependency. Please keep in mind that `make shell` does not work when your working directory is in an NFS filesystem that uses _root squash_ (see **Notes** section below).
* You can also run the command **`make shell`** to start an interactive bash shell inside the docker image. While this is not required for normal builds and unit testing, it allows you to run interactively within the docker image with the cloned repo mounted. Again, `build_docker_ngraph` is made first as a dependency. Please keep in mind that `make shell` does not work when your working directory is in an NFS filesystem that uses _root squash_ (see **Notes** section below).
* Running the command **`make build_docker_ngraph_cpp`** is also available, if you simply want to build the docker image. This target does work properly when your working directory is in an NFS filesystem.
* Running the command **`make build_docker_ngraph`** is also available, if you simply want to build the docker image. This target does work properly when your working directory is in an NFS filesystem.
* Finally, **`make clean`** is available to clean up the BUILD-* and docker build directories.
......@@ -53,7 +53,7 @@ A helper script to run as a normal user within the docker container. This is do
## Notes
* The top-level `Makefile` in this cloned repo can be used to build and unit-test NGraph-Cpp _outside_ of docker. This directory is only for building and running unit tests for NGraph-Cpp in the _reference-OS_ docker image.
* The top-level `Makefile` in this cloned repo can be used to build and unit-test ngraph _outside_ of docker. This directory is only for building and running unit tests for ngraph in the _reference-OS_ docker image.
* Due to limitations in how docker mounts work, `make check_cpu` and `make shell` will fail if you try to run them while in a working directory that is in an NFS-mount that has _root squash_ enabled. The cause results from the process in the docker container running as root. When a file or directory is created by root in the mounted directory tree, from within the docker image, the NFS-mount (in the host OS) does not allow a root-created file, leading to a permissions error. This is dependent on whether the host OS performs "root squash" when mounting NFS filesystems. The fix to this is easy: run `make check_cpu` and `make shell` from a local filesystem.
......
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