-
Notifications
You must be signed in to change notification settings - Fork 168
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Enable tensorflow for content detection in a production build (#2695)
* Enable tensorflow installation and build * Enable tensorflow in linux build * Enable tensorflow installation and build * Set base image with proper CUDA and CuDNN versions for amd64 build * Remove sudo in TF install * Install TF to /compiled/ * Install TF to /compiled/ * Install curl * Remove sudo * Cleanup * Cleanup * cleanup dockerfile * cleanup dockerfile * remove experimental flag check for tensorflow * Move BUILD_TAGS arg lower to not invalidate the cache
- Loading branch information
Showing
3 changed files
with
20 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,9 +27,13 @@ RUN update-alternatives --install /usr/bin/clang++ clang++ /usr/bin/clang++-12 3 | |
RUN GRPC_HEALTH_PROBE_VERSION=v0.3.6 \ | ||
&& curl -fsSL https://github.com/grpc-ecosystem/grpc-health-probe/releases/download/${GRPC_HEALTH_PROBE_VERSION}/grpc_health_probe-linux-${TARGETARCH} -o /usr/bin/grpc_health_probe \ | ||
&& chmod +x /usr/bin/grpc_health_probe \ | ||
&& curl -fsSL https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-2.8.0.tar.gz | tar -C /usr/local -xzf - \ | ||
&& ldconfig /usr/local/lib | ||
|
||
# note: for runtime, Tensorflow version needs to be compatible with CUDA and CuDNN of the image | ||
RUN LIBTENSORFLOW_VERSION=2.6.3 \ | ||
&& curl -LO https://storage.googleapis.com/tensorflow/libtensorflow/libtensorflow-gpu-linux-x86_64-${LIBTENSORFLOW_VERSION}.tar.gz \ | ||
&& mkdir /tf && tar -C /tf -xzf libtensorflow-gpu-linux-x86_64-${LIBTENSORFLOW_VERSION}.tar.gz | ||
|
||
ENV GOPATH=/go \ | ||
GO_BUILD_DIR=/build/ \ | ||
GOFLAGS="-mod=readonly" | ||
|
@@ -41,7 +45,10 @@ RUN mkdir -p /go \ | |
|
||
COPY ./install_ffmpeg.sh ./install_ffmpeg.sh | ||
|
||
RUN ./install_ffmpeg.sh \ | ||
ARG BUILD_TAGS | ||
ENV BUILD_TAGS=${BUILD_TAGS} | ||
|
||
RUN ./install_ffmpeg.sh \ | ||
&& GO111MODULE=on go get -v github.com/golangci/golangci-lint/cmd/[email protected] \ | ||
&& go get -v github.com/jstemmer/go-junit-report | ||
|
||
|
@@ -51,24 +58,17 @@ RUN go mod download | |
|
||
COPY . . | ||
|
||
ARG BUILD_TAGS | ||
ENV BUILD_TAGS=${BUILD_TAGS} | ||
|
||
RUN make livepeer livepeer_cli livepeer_bench livepeer_router | ||
|
||
FROM --platform=$TARGETPLATFORM nvidia/cuda:10.1-cudnn7-runtime AS livepeer-amd64-base | ||
|
||
FROM --platform=$TARGETPLATFORM nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04 AS livepeer-arm64-base | ||
|
||
FROM livepeer-${TARGETARCH}-base | ||
FROM --platform=${TARGETPLATFORM} nvidia/cuda:11.6.2-cudnn8-runtime-ubuntu20.04 AS livepeer-base | ||
|
||
ENV NVIDIA_DRIVER_CAPABILITIES=all | ||
|
||
COPY --from=build /build/ /usr/local/bin/ | ||
COPY --from=build /usr/bin/grpc_health_probe /usr/local/bin/grpc_health_probe | ||
COPY --from=build /src/tasmodel.pb /tasmodel.pb | ||
COPY --from=build /usr/share/misc/pci.ids /usr/share/misc/pci.ids | ||
|
||
RUN ldconfig | ||
# libtensorflow.so is required at runtime, because Ffmpeg DNN filter loads it dynamically | ||
COPY --from=build /tf/ /usr/local/ | ||
|
||
ENTRYPOINT ["/usr/local/bin/livepeer"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters