-
Notifications
You must be signed in to change notification settings - Fork 75.3k
Update TF official devel images to Ubuntu 20.04 and precommit hooks #48371
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| tensorflow/.clang-format |
| 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 | ||
| language: system | ||
| types_or: [c++, header, c] | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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 \ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could install |
||
| curl \ | ||
| git \ | ||
| libcurl3-dev \ | ||
|
|
@@ -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 | ||
|
|
@@ -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 \ | ||
|
|
@@ -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 |
|---|---|---|
|
|
@@ -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 \ | ||
|
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We could install |
||
| cuda-command-line-tools-${CUDA/./-} \ | ||
| libcublas-${CUDA/./-} \ | ||
| libcublas-dev-${CUDA/./-} \ | ||
|
|
@@ -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 | ||
|
|
@@ -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 \ | ||
|
|
@@ -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 |
|---|---|---|
| @@ -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 |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
With
clang-format-10that is available in this Ubuntu 20.04 upgrade we could useclang-format-10 --dry-run --Werrorif we don't like the automatic pre-commit formatting.