Skip to content

Commit

Permalink
doc: enhance; feat: make publish-all; enh(custom-builder): allow pass…
Browse files Browse the repository at this point in the history
…ing any options from skaffold; enh(tensorflow-serving-base/xavier): build with compute capability for TX2; fix(tensorflow-serving-base/nano): set correct compute capability
  • Loading branch information
helmut-hoffer-von-ankershoffen committed Sep 10, 2019
1 parent 21c4ef9 commit 2aced5f
Show file tree
Hide file tree
Showing 7 changed files with 56 additions and 36 deletions.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ jupyter-delete: ## Delete jupyter deployment

tensorflow-serving-base-build-and-test: ## Build, push and test ml tensorflow-serving image for Docker on Jetson device extending ml-base with TensorFlow *Serving*
cd workflow/deploy/tensorflow-serving-base && skaffold build
workflow/deploy/tools/container-structure-test tensorflow-serving-baser
workflow/deploy/tools/container-structure-test tensorflow-serving-base

tensorflow-serving-base-publish: ## Publish latest tensorflow-serving base image on Jetson device to Docker Hub given credentials in .docker-hub.auth
workflow/deploy/tools/publish tensorflow-serving-base $(shell sed '1q;d' .docker-hub.auth) $(shell sed '2q;d' .docker-hub.auth)
Expand Down Expand Up @@ -399,3 +399,15 @@ l4t-publish: ## Publish latest lt4 image on Jetson device to Docker Hub given cr
l4t-delete: ## Delete l4t deployment
cd workflow/deploy/l4t && skaffold delete
kubectl delete namespace jetson-l4t || true

publish-all: ## Publish all images to DockerHub
make ml-base-publish
make device-query-publish
make jupyter-publish
make tensorflow-serving-base-publish
make tensorflow-serving-publish
JETSON_MODEL=xavier make ml-base-publish
JETSON_MODEL=xavier make device-query-publish
JETSON_MODEL=xavier make jupyter-publish
JETSON_MODEL=xavier make tensorflow-serving-base-publish
JETSON_MODEL=xavier make tensorflow-serving-publish
34 changes: 17 additions & 17 deletions README.md

Large diffs are not rendered by default.

File renamed without changes
4 changes: 2 additions & 2 deletions workflow/deploy/tensorflow-serving-base/skaffold.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ build:
artifacts:
- image: max-one.local:5001/jetson/nano/tensorflow-serving-base
custom:
buildCommand: ../tools/builder tensorflow-serving-base
buildCommand: ../tools/builder tensorflow-serving-base nano max-one.local:5001/jetson/nano/ml-base --build-arg JOBS=1 --build-arg JETSON_MODEL=nano --build-arg TF_CUDA_COMPUTE_CAPABILITIES=5.3
dependencies:
paths:
- src
Expand All @@ -23,4 +23,4 @@ profiles:
value: max-one.local:5001/jetson/xavier/tensorflow-serving-base
- op: replace
path: /build/artifacts/0/custom/buildCommand
value: ../tools/builder tensorflow-serving-base xavier max-one.local:5001/jetson/xavier/ml-base 9
value: ../tools/builder tensorflow-serving-base xavier max-one.local:5001/jetson/xavier/ml-base --build-arg JOBS=9 --build-arg JETSON_MODEL=xavier --build-arg TF_CUDA_COMPUTE_CAPABILITIES=6.2,7.2
15 changes: 10 additions & 5 deletions workflow/deploy/tensorflow-serving-base/src/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
ARG FROM=max-one.local:5001/jetson/nano/ml-base
FROM ${FROM}

# Number of parallel jobs when building TensorFlow serving
ARG JOBS=1

# CUDA capabilities of Jetson (Nano, TX1, TX2 and Xavier)
ARG TF_CUDA_COMPUTE_CAPABILITIES
ENV TF_CUDA_COMPUTE_CAPABILITIES ${TF_CUDA_COMPUTE_CAPABILITIES:-5.3,6.2,7.2}

ARG JETSON_MODEL
ENV JETSON_MODEL ${JETSON_MODEL:-nano}

MAINTAINER Helmut Hoffer von Ankershoffen <helmuthva@googlemail.com>

# Install supervisord
Expand Down Expand Up @@ -32,9 +40,6 @@ ENV TF_TENSORRT_VERSION=5.1.6
ENV CUDNN_VERSION=7.5.0
# CUDA as provided by ml-base
ENV TF_NEED_CUDA=1
# CUDA capabilities of Jetson (Nano, TX1, TX2 and Xavier)
#ENV TF_CUDA_COMPUTE_CAPABILITIES="5.3,6.2,7.2"
ENV TF_CUDA_COMPUTE_CAPABILITIES="7.2"
# Use TensorRT as provided in ml-base
ENV TF_NEED_TENSORRT=1
# Required for ncc
Expand All @@ -59,7 +64,7 @@ RUN mkdir -p /tensorflow-serving && \
--config=cuda \
--config=nativeopt \
--config=jetson \
--config=xavier \
--config=${JETSON_MODEL} \
--copt="-fPIC" \
tensorflow_serving/model_servers:tensorflow_model_server && \
cp /tensorflow-serving/bazel-bin/tensorflow_serving/model_servers/tensorflow_model_server /usr/local/bin/tensorflow_model_server && \
Expand All @@ -73,7 +78,7 @@ RUN mkdir -p /tensorflow-serving && \
--config=cuda \
--config=nativeopt \
--config=jetson \
--config=xavier \
--config=${JETSON_MODEL} \
--copt="-fPIC" \
tensorflow_serving/tools/pip_package:build_pip_package && \
bazel-bin/tensorflow_serving/tools/pip_package/build_pip_package \
Expand Down
16 changes: 9 additions & 7 deletions workflow/deploy/tools/builder
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,13 @@ model=${2:-${JETSON_MODEL}}
## Jetson model
from=${3:-${FROM}}

## Concurrent Jobs
jobs=${4:-1}

## Options for docker build
shift; shift; shift
options="$@"

cd $(dirname "$0")/../$project
echo "Building $IMAGES for project $project and Jetson model ${model} ..."
echo "Building $IMAGES for project $project and Jetson model ${model} with FROM=from and $options ..."

## Sync src from development machine to device
echo "Synching from development machine to ${model} for project $project ..."
Expand All @@ -28,11 +30,11 @@ rsync -rlptza --delete -P src/ build@${model}-one.local:~/$project
ssh build@${model}-one.local << EOF
echo "Building Docker image on ${model} for project $project ..."
if [ -z "$2" ]; then
echo "Not overriding FROM ..."
docker build -t $project ~/$project
echo "Executing on build@${model}-one.local: docker build -t $project ~/$project $options"
docker build -t $project ~/$project $options
else
echo "Using FROM $from as build argument ..."
docker build -t $project ~/$project --build-arg FROM=$from --build-arg JOBS=$jobs
echo "Executing on build@${model}-one.local: docker build -t $project ~/$project --build-arg FROM=$from $options"
docker build -t $project ~/$project --build-arg FROM=$from $options
fi
EOF

Expand Down
9 changes: 5 additions & 4 deletions workflow/deploy/tools/builderx
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@ if [[ -z "${JETSON_MODEL}" ]]; then
fi
model=${2:-${JETSON_MODEL}}

## Concurrent Jobs
jobs=${3:-1}
## Options for docker build
shift; shift
options="$@"

cd $(dirname "$0")/../$project
echo "Building $IMAGES for project $project and Jetson model ${model} ..."
Expand Down Expand Up @@ -49,8 +50,8 @@ EOF

## Build Docker image on device - using buildkit with experimental features to be able to bind-mount in Dockerfile
ssh build@${model}-one.local << EOF
echo "Building Docker image on ${model} for project $project ..."
DOCKER_BUILDKIT=1 docker build -t $project ~/$project --build-arg JOBS=$jobs
echo "Executing on build@${model}-one.local: DOCKER_BUILDKIT=1 docker build -t $project ~/$project $options"
DOCKER_BUILDKIT=1 docker build -t $project ~/$project $options
EOF

## Reactivate original Docker configuration to allow pushing private Docker registry in cluster
Expand Down

0 comments on commit 2aced5f

Please sign in to comment.