Skip to content

Commit

Permalink
Test the release wheels in a docker build step. (tensorflow#1671)
Browse files Browse the repository at this point in the history
* Test the release wheels in a docker image.

* Some formatting fixes.

* Fix dependency.

* No cache.

* No cache dir other.

* Some debugging.

* Some more debugging.

* Docker info.

* Docker info before.

* Add another nvidia-smi

* Some more debugging.

* Some more debugging.

* Remove dotnet.

* More debug.

* Revert some changes.

* Trying a trick.

* Revert "Trying a trick."

This reverts commit 9a2ee2e.

* Run the rm in the background.

* Make it work for all python versions.

* Fix dockerfile.

* Update make_wheel_Linux.sh

* Typo

Co-Authored-By: Sean Morgan <[email protected]>

* Typo

Co-Authored-By: Sean Morgan <[email protected]>

Co-authored-by: Sean Morgan <[email protected]>
  • Loading branch information
gabrieldemarmiesse and seanpmorgan authored Apr 16, 2020
1 parent bd1e622 commit 5b916c5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 39 deletions.
6 changes: 6 additions & 0 deletions .github/workflows/make_wheel_Linux.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
set -e -x

df -h
docker info
# to get more disk space
rm -rf /usr/share/dotnet &

DOCKER_BUILDKIT=1 docker build \
-f tools/docker/build_wheel.Dockerfile \
--output type=local,dest=wheelhouse \
Expand Down
39 changes: 1 addition & 38 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,46 +78,9 @@ jobs:
with:
name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-wheel
path: wheelhouse
test-release-wheel:
name: Test release wheels
runs-on: ${{ matrix.os }}
needs: [release-wheel]
strategy:
matrix:
os: ['macos-latest', 'windows-latest', 'ubuntu-18.04']
py-version: ['3.5', '3.6', '3.7']
tf-version: ['2.1.0', '2.2.0rc2']
fail-fast: false
steps:
- uses: actions/setup-python@v1
with:
python-version: ${{ matrix.py-version }}
- uses: actions/download-artifact@v1
if: |
(matrix.os != 'macos-latest' || matrix.py-version != '3.8')
&& (matrix.py-version != '3.8' || matrix.tf-version != '2.1.0')
&& (matrix.os != 'ubuntu-18.04' || matrix.tf-version != '2.2.0rc2')
&& (github.event_name != 'pull_request' || matrix.py-version == env.OLDEST_PY_VERSION)
with:
name: ${{ runner.os }}-${{ matrix.py-version }}-tf${{ matrix.tf-version }}-wheel
path: ./wheel
- name: Test wheel
if: |
(matrix.os != 'macos-latest' || matrix.py-version != '3.8')
&& (matrix.py-version != '3.8' || matrix.tf-version != '2.1.0')
&& (matrix.os != 'ubuntu-18.04' || matrix.tf-version != '2.2.0rc2')
&& (github.event_name != 'pull_request' || matrix.py-version == env.OLDEST_PY_VERSION)
env:
TF_VERSION: ${{ matrix.tf-version }}
shell: bash
run: |
pip install tensorflow==$TF_VERSION
pip install wheel/*.whl
python -c "import tensorflow_addons as tfa; print(tfa.activations.lisht(0.2))"
upload-wheels:
name: Publish wheels to PyPi
needs: [release-wheel, test-release-wheel, test-with-bazel]
needs: [release-wheel, test-with-bazel]
runs-on: ubuntu-18.04
strategy:
matrix:
Expand Down
15 changes: 14 additions & 1 deletion tools/docker/build_wheel.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
#syntax=docker/dockerfile:1.1.5-experimental
ARG TF_VERSION
ARG PY_VERSION
FROM seanpmorgan/tensorflow:2.1.0-custom-op-gpu-ubuntu16-minimal as base_install
ENV TF_NEED_CUDA="1"

Expand Down Expand Up @@ -61,7 +62,19 @@ RUN bash tools/releases/tf_auditwheel_patch.sh
RUN auditwheel repair --plat manylinux2010_x86_64 artifacts/*.whl
RUN ls -al wheelhouse/

# -------------------------------------------------------------------

FROM python:$PY_VERSION as test_wheel_in_fresh_environment

ARG TF_VERSION
RUN python -m pip install tensorflow==$TF_VERSION

COPY --from=make_wheel /addons/wheelhouse/ /addons/wheelhouse/
RUN pip install /addons/wheelhouse/*.whl

RUN python -c "import tensorflow_addons as tfa; print(tfa.register_all())"

# -------------------------------------------------------------------
FROM scratch as output

COPY --from=make_wheel /addons/wheelhouse/ .
COPY --from=test_wheel_in_fresh_environment /addons/wheelhouse/ .

0 comments on commit 5b916c5

Please sign in to comment.