Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .clang-format
15 changes: 15 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
repos:
- repo: local
hooks:
- id: pylint
name: pylint
entry: pylint
language: system
types: [python]
- repo: local
hooks:
- id: clang-format
name: clang-format
entry: clang-format -i
Copy link
Copy Markdown
Contributor Author

@bhack bhack Apr 21, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

With clang-format-10 that is available in this Ubuntu 20.04 upgrade we could use clang-format-10 --dry-run --Werror if we don't like the automatic pre-commit formatting.

language: system
types_or: [c++, header, c]
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ ARG UBUNTU_VERSION=18.04

FROM ubuntu:${UBUNTU_VERSION} AS base

ARG DEBIAN_FRONTEND="noninteractive"

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
curl \
git \
libcurl3-dev \
Expand Down Expand Up @@ -52,7 +55,7 @@ ARG CACHE_STOP=1
ARG CHECKOUT_TF_SRC=0
# In case of Python 2.7+ we need to add passwd entries for user and group id
RUN chmod a+w /etc/passwd /etc/group
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ ARG UBUNTU_VERSION=18.04

FROM ubuntu:${UBUNTU_VERSION} AS base

ARG DEBIAN_FRONTEND="noninteractive"

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
curl \
git \
libcurl3-dev \
Expand Down Expand Up @@ -52,7 +55,7 @@ ARG CACHE_STOP=1
ARG CHECKOUT_TF_SRC=0
# In case of Python 2.7+ we need to add passwd entries for user and group id
RUN chmod a+w /etc/passwd /etc/group
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ ARG UBUNTU_VERSION=18.04

FROM ubuntu:${UBUNTU_VERSION} AS base

ARG DEBIAN_FRONTEND="noninteractive"

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
curl \
git \
libcurl3-dev \
Expand Down Expand Up @@ -52,7 +55,7 @@ ARG CACHE_STOP=1
ARG CHECKOUT_TF_SRC=0
# In case of Python 2.7+ we need to add passwd entries for user and group id
RUN chmod a+w /etc/passwd /etc/group
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
Expand All @@ -68,6 +71,10 @@ RUN python3 -m pip --no-cache-dir install --upgrade \
# Some TF tools expect a "python" binary
RUN ln -s $(which python3) /usr/local/bin/python

RUN python3 -m pip --no-cache-dir install \
pylint==2.7.4 \
pre-commit
RUN if [ "$CHECKOUT_TF_SRC" = 1 ] ; then cd /tensorflow_src && pre-commit install ; fi
RUN apt-get update && apt-get install -y \
build-essential \
curl \
Expand Down Expand Up @@ -100,7 +107,6 @@ RUN mkdir /bazel && \
chmod +x /bazel/installer.sh && \
/bazel/installer.sh && \
rm -f /bazel/installer.sh

COPY bashrc /etc/bash.bashrc
RUN chmod a+rwx /etc/bash.bashrc

Expand Down
10 changes: 8 additions & 2 deletions tensorflow/tools/dockerfiles/dockerfiles/devel-cpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ ARG UBUNTU_VERSION=18.04

FROM ubuntu:${UBUNTU_VERSION} AS base

ARG DEBIAN_FRONTEND="noninteractive"

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could install clang-format-10 if we prefer dry-run but we always need to sync version with the CI Sanity VM

curl \
git \
libcurl3-dev \
Expand Down Expand Up @@ -52,7 +55,7 @@ ARG CACHE_STOP=1
ARG CHECKOUT_TF_SRC=0
# In case of Python 2.7+ we need to add passwd entries for user and group id
RUN chmod a+w /etc/passwd /etc/group
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
Expand All @@ -68,6 +71,10 @@ RUN python3 -m pip --no-cache-dir install --upgrade \
# Some TF tools expect a "python" binary
RUN ln -s $(which python3) /usr/local/bin/python

RUN python3 -m pip --no-cache-dir install \
pylint==2.7.4 \
pre-commit
RUN if [ "$CHECKOUT_TF_SRC" = 1 ] ; then cd /tensorflow_src && pre-commit install ; fi
RUN apt-get update && apt-get install -y \
build-essential \
curl \
Expand Down Expand Up @@ -100,6 +107,5 @@ RUN mkdir /bazel && \
chmod +x /bazel/installer.sh && \
/bazel/installer.sh && \
rm -f /bazel/installer.sh

COPY bashrc /etc/bash.bashrc
RUN chmod a+rwx /etc/bash.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ARG LIBNVINFER_MAJOR_VERSION=7
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
cuda-command-line-tools-${CUDA/./-} \
libcublas-${CUDA/./-} \
libcublas-dev-${CUDA/./-} \
Expand Down Expand Up @@ -87,7 +88,7 @@ ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
ARG CACHE_STOP=1
# Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
ARG CHECKOUT_TF_SRC=0
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
# dynamic linker run-time bindings
Expand All @@ -109,6 +110,10 @@ RUN python3 -m pip --no-cache-dir install --upgrade \
# Some TF tools expect a "python" binary
RUN ln -s $(which python3) /usr/local/bin/python

RUN python3 -m pip --no-cache-dir install \
pylint==2.7.4 \
pre-commit
RUN if [ "$CHECKOUT_TF_SRC" = 1 ] ; then cd /tensorflow_src && pre-commit install ; fi
RUN apt-get update && apt-get install -y \
build-essential \
curl \
Expand Down Expand Up @@ -141,7 +146,6 @@ RUN mkdir /bazel && \
chmod +x /bazel/installer.sh && \
/bazel/installer.sh && \
rm -f /bazel/installer.sh

COPY bashrc /etc/bash.bashrc
RUN chmod a+rwx /etc/bash.bashrc

Expand Down
8 changes: 6 additions & 2 deletions tensorflow/tools/dockerfiles/dockerfiles/devel-gpu.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ARG LIBNVINFER_MAJOR_VERSION=7
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We could install clang-format-10 if we prefer dry-run but we always need to sync version with the CI Sanity VM

cuda-command-line-tools-${CUDA/./-} \
libcublas-${CUDA/./-} \
libcublas-dev-${CUDA/./-} \
Expand Down Expand Up @@ -87,7 +88,7 @@ ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
ARG CACHE_STOP=1
# Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
ARG CHECKOUT_TF_SRC=0
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
# dynamic linker run-time bindings
Expand All @@ -109,6 +110,10 @@ RUN python3 -m pip --no-cache-dir install --upgrade \
# Some TF tools expect a "python" binary
RUN ln -s $(which python3) /usr/local/bin/python

RUN python3 -m pip --no-cache-dir install \
pylint==2.7.4 \
pre-commit
RUN if [ "$CHECKOUT_TF_SRC" = 1 ] ; then cd /tensorflow_src && pre-commit install ; fi
RUN apt-get update && apt-get install -y \
build-essential \
curl \
Expand Down Expand Up @@ -141,6 +146,5 @@ RUN mkdir /bazel && \
chmod +x /bazel/installer.sh && \
/bazel/installer.sh && \
rm -f /bazel/installer.sh

COPY bashrc /etc/bash.bashrc
RUN chmod a+rwx /etc/bash.bashrc
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ ARG UBUNTU_VERSION=18.04

FROM ubuntu:${UBUNTU_VERSION} AS base

ARG DEBIAN_FRONTEND="noninteractive"

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
curl \
git \
libcurl3-dev \
Expand Down Expand Up @@ -52,7 +55,7 @@ ARG CACHE_STOP=1
ARG CHECKOUT_TF_SRC=0
# In case of Python 2.7+ we need to add passwd entries for user and group id
RUN chmod a+w /etc/passwd /etc/group
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,11 @@ ARG UBUNTU_VERSION=18.04

FROM ubuntu:${UBUNTU_VERSION} AS base

ARG DEBIAN_FRONTEND="noninteractive"

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
curl \
git \
libcurl3-dev \
Expand Down Expand Up @@ -52,7 +55,7 @@ ARG CACHE_STOP=1
ARG CHECKOUT_TF_SRC=0
# In case of Python 2.7+ we need to add passwd entries for user and group id
RUN chmod a+w /etc/passwd /etc/group
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# See http://bugs.python.org/issue19846
ENV LANG C.UTF-8
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ARG LIBNVINFER_MAJOR_VERSION=7
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
cuda-command-line-tools-${CUDA/./-} \
libcublas-${CUDA/./-} \
libcublas-dev-${CUDA/./-} \
Expand Down Expand Up @@ -87,7 +88,7 @@ ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
ARG CACHE_STOP=1
# Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
ARG CHECKOUT_TF_SRC=0
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
# dynamic linker run-time bindings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ ARG LIBNVINFER_MAJOR_VERSION=7
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
cuda-command-line-tools-${CUDA/./-} \
libcublas-${CUDA/./-} \
libcublas-dev-${CUDA/./-} \
Expand Down Expand Up @@ -87,7 +88,7 @@ ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
ARG CACHE_STOP=1
# Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
ARG CHECKOUT_TF_SRC=0
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
# dynamic linker run-time bindings
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,4 @@ RUN mkdir /bazel && \
wget -O /bazel/LICENSE.txt "https://raw.githubusercontent.com/bazelbuild/bazel/master/LICENSE" && \
chmod +x /bazel/installer.sh && \
/bazel/installer.sh && \
rm -f /bazel/installer.sh
rm -f /bazel/installer.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
FROM ubuntu:${UBUNTU_VERSION} AS base

ARG DEBIAN_FRONTEND="noninteractive"

RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
curl \
git \
libcurl3-dev \
Expand Down Expand Up @@ -29,4 +32,4 @@ ARG CACHE_STOP=1
ARG CHECKOUT_TF_SRC=0
# In case of Python 2.7+ we need to add passwd entries for user and group id
RUN chmod a+w /etc/passwd /etc/group
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ ARG LIBNVINFER_MAJOR_VERSION=7
SHELL ["/bin/bash", "-c"]
RUN apt-get update && apt-get install -y --no-install-recommends \
build-essential \
clang-format \
cuda-command-line-tools-${CUDA/./-} \
libcublas-${CUDA/./-} \
libcublas-dev-${CUDA/./-} \
Expand Down Expand Up @@ -64,7 +65,7 @@ ENV TF_CUDNN_VERSION=${CUDNN_MAJOR_VERSION}
ARG CACHE_STOP=1
# Check out TensorFlow source code if --build-arg CHECKOUT_TF_SRC=1
ARG CHECKOUT_TF_SRC=0
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone https://github.com/tensorflow/tensorflow.git /tensorflow_src || true
RUN test "${CHECKOUT_TF_SRC}" -eq 1 && git clone --depth 1 https://github.com/tensorflow/tensorflow.git /tensorflow_src || true

# Link the libcuda stub to the location where tensorflow is searching for it and reconfigure
# dynamic linker run-time bindings
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RUN python3 -m pip --no-cache-dir install \
pylint==2.7.4 \
pre-commit
RUN if [ "$CHECKOUT_TF_SRC" = 1 ] ; then cd /tensorflow_src && pre-commit install ; fi
4 changes: 4 additions & 0 deletions tensorflow/tools/dockerfiles/spec.yml
Original file line number Diff line number Diff line change
Expand Up @@ -123,24 +123,28 @@ slice_sets:
- ubuntu/version
- ubuntu/devel-cpu
- ubuntu/python
- ubuntu/precommit
- ubuntu/bazel
- shell
tests:
- build-cpu.sh
args:
- UBUNTU_VERSION=20.04
- CHECKOUT_TF_SRC=1
- add_to_name: "devel-gpu"
dockerfile_exclusive_name: "devel-gpu"
partials:
- ubuntu/version
- ubuntu/devel-nvidia
- ubuntu/python
- ubuntu/precommit
- ubuntu/bazel
- shell
tests:
- build-gpu.sh
test_runtime: nvidia
args:
- UBUNTU_VERSION=20.04
- CHECKOUT_TF_SRC=1

ubuntu-devel-arm64v8:
Expand Down