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
4 changes: 2 additions & 2 deletions .github/workflows/make_wheel_macOS.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ set -e -x

export TF_NEED_CUDA=0

python3 --version
python3 -m pip install delocate wheel setuptools tensorflow==$TF_VERSION
python --version
python -m pip install delocate wheel setuptools tensorflow==$TF_VERSION

bash tools/install_deps/bazel_macos.sh $BAZEL_VERSION
bash tools/testing/build_and_run_tests.sh
Expand Down
11 changes: 2 additions & 9 deletions build_deps/build_pip_pkg.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,13 +48,6 @@ function main() {
exit 1
fi

# Check if python3 is available. On Windows VM it is not.
if [ -x "$(command -v python3)" ]; then
_PYTHON_BINARY=python3
else
_PYTHON_BINARY=python
fi

mkdir -p ${DEST}
DEST=$(abspath "${DEST}")
echo "=== destination directory: ${DEST}"
Expand Down Expand Up @@ -89,9 +82,9 @@ function main() {

if [[ -z ${NIGHTLY_FLAG} ]]; then
# Windows has issues with locking library files for deletion so do not fail here
${_PYTHON_BINARY} ${BUILD_CMD} || true
python ${BUILD_CMD} || true
else
${_PYTHON_BINARY} ${BUILD_CMD} ${NIGHTLY_FLAG} || true
python ${BUILD_CMD} ${NIGHTLY_FLAG} || true
fi

cp dist/*.whl "${DEST}"
Expand Down
2 changes: 1 addition & 1 deletion build_deps/toolchains/gpu/cuda_configure.bzl
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def _get_python_bin(repository_ctx):
python_bin = repository_ctx.os.environ.get(_PYTHON_BIN_PATH)
if python_bin != None:
return python_bin
python_bin_name = "python.exe" if _is_windows(repository_ctx) else "python3"
python_bin_name = "python.exe" if _is_windows(repository_ctx) else "python"
python_bin_path = repository_ctx.which(python_bin_name)
if python_bin_path != None:
return str(python_bin_path)
Expand Down
9 changes: 5 additions & 4 deletions tools/docker/build_wheel.Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,24 @@ ENV TF_NEED_CUDA="1"
RUN apt-get update && apt-get install patchelf

ARG PY_VERSION
RUN python$PY_VERSION -m pip install --upgrade pip setuptools auditwheel==2.0.0
RUN ln -sf $(which python$PY_VERSION) /usr/bin/python
RUN python -m pip install --upgrade pip setuptools auditwheel==2.0.0

COPY tools/install_deps/ /install_deps
ARG TF_VERSION
RUN python$PY_VERSION -m pip install \
RUN python -m pip install \
tensorflow==$TF_VERSION \
-r /install_deps/pytest.txt

COPY requirements.txt .
RUN python$PY_VERSION -m pip install -r requirements.txt
RUN python -m pip install -r requirements.txt

COPY ./ /addons
WORKDIR /addons
ARG NIGHTLY_FLAG
ARG NIGHTLY_TIME
RUN --mount=type=cache,id=cache_bazel,target=/root/.cache/bazel \
bash tools/releases/release_linux.sh $PY_VERSION $NIGHTLY_FLAG
bash tools/releases/release_linux.sh $NIGHTLY_FLAG

RUN bash tools/releases/tf_auditwheel_patch.sh
RUN auditwheel repair --plat manylinux2010_x86_64 artifacts/*.whl
Expand Down
9 changes: 6 additions & 3 deletions tools/docker/gpu_tests.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
FROM tensorflow/tensorflow:2.1.0-custom-op-gpu-ubuntu16
ENV TF_NEED_CUDA="1"

RUN python3 -m pip install --upgrade pip setuptools auditwheel==2.0.0
ARG PY_VERSION
RUN ln -sf $(which python$PY_VERSION) /usr/bin/python

RUN python -m pip install --upgrade pip setuptools auditwheel==2.0.0

COPY tools/install_deps/tensorflow.txt ./
RUN python3 -m pip install -r tensorflow.txt
RUN python -m pip install -r tensorflow.txt

COPY requirements.txt ./
RUN python3 -m pip install -r requirements.txt
RUN python -m pip install -r requirements.txt


COPY ./ /addons
Expand Down
7 changes: 3 additions & 4 deletions tools/releases/release_linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,11 @@ echo "#! /usr/bin/python2.7" >> /usr/bin/lsb_release2
cat /usr/bin/lsb_release >> /usr/bin/lsb_release2
mv /usr/bin/lsb_release2 /usr/bin/lsb_release

ln -sf $(which python$1) /usr/bin/python3
python3 -m pip install --upgrade pip
python3 -m pip install --upgrade setuptools
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools

#Link TF dependency
python3 --version
python --version
bash tools/testing/build_and_run_tests.sh
bazel clean --expunge

Expand Down
2 changes: 1 addition & 1 deletion tools/releases/tf_auditwheel_patch.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

set -e

SITE_PKG_LOCATION=$(python3 -c "import site; print(site.getsitepackages()[0])")
SITE_PKG_LOCATION=$(python -c "import site; print(site.getsitepackages()[0])")
TF_SHARED_LIBRARY_NAME=$(grep -r TF_SHARED_LIBRARY_NAME .bazelrc | awk -F= '{print$2}')
POLICY_JSON="${SITE_PKG_LOCATION}/auditwheel/policy/policy.json"
sed -i "s/libresolv.so.2\"/libresolv.so.2\", $TF_SHARED_LIBRARY_NAME/g" $POLICY_JSON
2 changes: 1 addition & 1 deletion tools/run_gpu_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
set -x -e

export DOCKER_BUILDKIT=1
docker build -f tools/docker/gpu_tests.Dockerfile -t tfa_gpu_tests ./
docker build -f tools/docker/gpu_tests.Dockerfile --build-arg PY_VERSION=3.5 -t tfa_gpu_tests ./
docker run --rm -t --runtime=nvidia tfa_gpu_tests
Empty file added tools/testing/addons_gpu.sh
Empty file.
13 changes: 3 additions & 10 deletions tools/testing/build_and_run_tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,7 @@ set -x -e

export CC_OPT_FLAGS='-mavx'

# Check if python3 is available. On Windows VM it is not.
if [ -x "$(command -v python3)" ]; then
PYTHON_BINARY=python3
else
PYTHON_BINARY=python
fi

$PYTHON_BINARY -m pip install -r tools/install_deps/pytest.txt -e ./
$PYTHON_BINARY ./configure.py
python -m pip install -r tools/install_deps/pytest.txt -e ./
python ./configure.py
bash tools/install_so_files.sh
$PYTHON_BINARY -m pytest -v --durations=25 ./tensorflow_addons
python -m pytest -v --durations=25 ./tensorflow_addons