Skip to content

Commit d19c3ef

Browse files
seanpmorganbhack
andauthored
Utilize SIG Build Docker Images (#2515)
* Utilize SIG Build build image Co-authored-by: bhack <bhack@users.noreply.github.com>
1 parent 33727be commit d19c3ef

File tree

4 files changed

+15
-25
lines changed

4 files changed

+15
-25
lines changed

.github/workflows/release.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,11 +124,13 @@ jobs:
124124
name: Upload dev container to DockerHub
125125
needs: [release-wheel, test-with-bazel]
126126
runs-on: ubuntu-18.04
127+
env:
128+
PY_VERSION: '3.9'
127129
if: (github.event_name == 'push' && github.ref == 'refs/heads/master')
128130
steps:
129131
- uses: actions/checkout@v2
130132
- run: |
131133
set -e -x
132134
echo ${{ secrets.DOCKER_PW }} | docker login --username ${{ secrets.DOCKER_USER }} --password-stdin
133135
bash .github/workflows/github_build_dev_container.sh
134-
docker push tfaddons/dev_container:latest-cpu
136+
docker push tfaddons/dev_container:latest-gpu

tools/build_dev_container.sh

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ set -x -e
55
docker build \
66
-f tools/docker/dev_container.Dockerfile \
77
--build-arg TF_VERSION=2.7.0 \
8-
--build-arg TF_PACKAGE=tensorflow-cpu \
8+
--build-arg TF_PACKAGE=tensorflow \
9+
--build-arg PY_VERSION=$PY_VERSION \
910
--no-cache \
10-
--target dev_container_cpu \
11-
-t tfaddons/dev_container:latest-cpu ./
11+
--target dev_container \
12+
-t tfaddons/dev_container:latest-gpu ./

tools/docker/build_wheel.Dockerfile

Lines changed: 2 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,9 @@
11
#syntax=docker/dockerfile:1.1.5-experimental
2-
ARG TF_VERSION
32
ARG PY_VERSION
4-
FROM gcr.io/tensorflow-testing/nosla-cuda11.2-cudnn8.1-ubuntu18.04-manylinux2010-multipython as base_install
5-
ENV TF_NEED_CUDA="1"
6-
7-
# Required for setuptools v50.0.0
8-
# https://setuptools.readthedocs.io/en/latest/history.html#v50-0-0
9-
# https://github.com/pypa/setuptools/issues/2352
10-
ENV SETUPTOOLS_USE_DISTUTILS=stdlib
11-
12-
# Fix presented in
13-
# https://stackoverflow.com/questions/44967202/pip-is-showing-error-lsb-release-a-returned-non-zero-exit-status-1/44967506
14-
RUN echo "#! /usr/bin/python2.7" >> /usr/bin/lsb_release2
15-
RUN cat /usr/bin/lsb_release >> /usr/bin/lsb_release2
16-
RUN mv /usr/bin/lsb_release2 /usr/bin/lsb_release
3+
FROM tensorflow/build:latest-python$PY_VERSION as base_install
174

5+
ENV TF_NEED_CUDA="1"
186
ARG PY_VERSION
19-
RUN ln -sf /usr/local/bin/python$PY_VERSION /usr/bin/python
20-
217
ARG TF_VERSION
228
RUN python -m pip install --default-timeout=1000 tensorflow==$TF_VERSION
239

@@ -28,7 +14,6 @@ COPY requirements.txt .
2814
RUN python -m pip install -r requirements.txt
2915

3016
COPY ./ /addons
31-
RUN rm /addons/.bazeliskrc
3217
WORKDIR /addons
3318

3419
# -------------------------------------------------------------------

tools/docker/dev_container.Dockerfile

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,13 @@
11
#syntax=docker/dockerfile:1.1.5-experimental
2-
FROM gcr.io/tensorflow-testing/nosla-cuda11.2-cudnn8.1-ubuntu18.04-manylinux2010-multipython as dev_container_cpu
2+
ARG PY_VERSION
3+
ARG IMAGE_TYPE
4+
5+
# Currenly all of our dev images are GPU capable but at a cost of being quite large.
6+
# See https://github.com/tensorflow/build/pull/47
7+
FROM tensorflow/build:latest-python$PY_VERSION as dev_container
38
ARG TF_PACKAGE
49
ARG TF_VERSION
510

6-
RUN ln -sf /usr/local/bin/python3.9 /usr/bin/python
7-
RUN ln -sf /usr/local/bin/pip3.9 /usr/local/bin/pip
8-
911
RUN pip install --default-timeout=1000 $TF_PACKAGE==$TF_VERSION
1012

1113
COPY tools/install_deps /install_deps

0 commit comments

Comments
 (0)