Skip to content

Commit

Permalink
Added more options to build.sh script (NVIDIA#828)
Browse files Browse the repository at this point in the history
- user may set DALI_BUILD_FLAVOR
- build git SHA is automatically set
- build time stamp is set automatically

Signed-off-by: Janusz Lisiecki <[email protected]>
  • Loading branch information
JanuszL authored Apr 30, 2019
1 parent b72d83c commit d099e4f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,7 @@ Change directory (``cd``) into Docker directory and run ``./build.sh``. If neede
* NVIDIA_BUILD_ID - Custom ID of the build. Default is ``1234``.
* CREATE_WHL - Create a standalone wheel. Default is ``YES``.
* CREATE_RUNNER - Create Docker image with cuDNN, CUDA and DALI installed inside. It will create the ``Docker_run_cuda`` image, which needs to be run using ``nvidia-docker`` and DALI wheel in the ``wheelhouse`` directory under$
* DALI_BUILD_FLAVOR - adds a suffix to DALI package name and put a note about it in the whl package description, i.e. `nightly` will result in the `nvidia-dali-nightly`

----

Expand Down
6 changes: 5 additions & 1 deletion docker/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ export CUDA_VERSION=${CUDA_VERSION:-10}
export NVIDIA_BUILD_ID=${NVIDIA_BUILD_ID:-12345}
export CREATE_WHL=${CREATE_WHL:-YES}
export CREATE_RUNNER=${CREATE_RUNNER:-NO}
export DALI_BUILD_FLAVOR=${DALI_BUILD_FLAVOR}
#################################
export DEPS_IMAGE=dali_cu${CUDA_VERSION}.deps
export BUILDER=dali_${PYV}_cu${CUDA_VERSION}.build
export RUN_IMG=dali_${PYV}_cu${CUDA_VERSION}.run
export GIT_SHA=$(git rev-parse HEAD)
export DALI_TIMESTAMP=$(date +%Y%m%d)

set -o errexit

Expand All @@ -31,7 +34,8 @@ popd
pushd ../
docker build -t ${DEPS_IMAGE} --build-arg "FROM_IMAGE_NAME"=manylinux3_x86_64 --build-arg "USE_CUDA_VERSION=${CUDA_VERSION}" -f Dockerfile.deps .
echo "Build image:" ${BUILDER}
docker build -t ${BUILDER} --build-arg "DEPS_IMAGE_NAME=${DEPS_IMAGE}" --build-arg "PYVER=${PYVER}" --build-arg "PYV=${PYV}" --build-arg "NVIDIA_BUILD_ID=${NVIDIA_BUILD_ID}" .
docker build -t ${BUILDER} --build-arg "DEPS_IMAGE_NAME=${DEPS_IMAGE}" --build-arg "PYVER=${PYVER}" --build-arg "PYV=${PYV}" --build-arg "NVIDIA_BUILD_ID=${NVIDIA_BUILD_ID}" \
--build-arg "NVIDIA_DALI_BUILD_FLAVOR=${DALI_BUILD_FLAVOR}" --build-arg "GIT_SHA=${GIT_SHA}" --build-arg "DALI_TIMESTAMP=${DALI_TIMESTAMP}".

if [ "$CREATE_RUNNER" = "YES" ]; then
echo "Runner image:" ${RUN_IMG}
Expand Down

0 comments on commit d099e4f

Please sign in to comment.