Skip to content

Commit

Permalink
Bump TF 2.14.0rc0 (#1831)
Browse files Browse the repository at this point in the history
* Bump TF 2.14.0rc0

* Remove 3.7/3.8

* Update

* Bump bazel version

* Add python rules

* Update python

* Update to 2.14

* Update docs

* Update

* Update to manylinux 2014 container

* Bump to 3.9

* Update clang flags

* Update

* Fix

* Fix

* Fix

* Fix

* Fix

* Fix

* Update and fix

* Add back

* Fix

* Update build.yml

* Update python version

* Fix

* Only update inside docker

* Fix

* Fix

* bump

* Try

* Try

* Update

* Update

* Update

* Need to bring in progress

* Update

* Update

* Update

* Update

* Fix

* Fix

* Fix webp

* Update permission

* Update permission

* Bump default to python 3.10

* Fix

* Update

* Fix

* Update

* Switch to use 3.9

* Switch back to 3.10

* Cleanup

* Update

* Fix linux build failure

* Fix

* Update linux test

* Update python version

* Add disutils

* Misc fixes

* MacOS fix

* Remove exposed include path in ubuntu 22.04

* Fix lint

* Update tests

* Disable arm64 to get archive in github actions runner.

* Bump version

* Use 3.9 to build .so instead

* Revert

* Add output

* Fix

* Update to use docker build instead

* Disable optimization

* Quiet

Wait for 5s

* Fix

* Check symbolic link in build

* Remove files not needed

* Use crosstool

* Add fPIC

* Add back "threadproc/unix/signals.c",

* restore

* restore lint on 20.04

* Update

* Set HAVE_DECL_SYS_SIGLIST to zero

* Fix lint

* Remove black

* Fix

* Add missing libtinfo5

* Re-enable arm64 build
  • Loading branch information
yongtang authored Dec 17, 2023
1 parent 189e5e1 commit b5663be
Show file tree
Hide file tree
Showing 14 changed files with 130 additions and 68 deletions.
2 changes: 1 addition & 1 deletion .bazelversion
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.1.1
6.1.0
13 changes: 10 additions & 3 deletions .github/workflows/build.bazel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
# See the License for the specific language governing permissions and
# limitations under the License.
# ==============================================================================
set -e -x
set -x


PYTHON=python3
Expand All @@ -30,6 +30,7 @@ if [[ $(uname) == "Linux" ]]; then
curl -sSOL https://github.com/bazelbuild/bazelisk/releases/download/v1.11.0/bazelisk-linux-amd64
mv bazelisk-linux-amd64 /usr/local/bin/bazel
chmod +x /usr/local/bin/bazel
cp -f $(which $PYTHON) /usr/bin/python3
fi

bazel version
Expand All @@ -42,6 +43,7 @@ $PYTHON -m pip --version

$PYTHON -m pip install -q ${TENSORFLOW_INSTALL}
$PYTHON -m pip install -q "urllib3 <2"
$PYTHON -m pip uninstall -y tensorflow-io-gcs-filesystem

$PYTHON tools/build/configure.py

Expand All @@ -53,11 +55,16 @@ bazel build \

rm -rf build && mkdir -p build

if [[ $(uname) == "Linux" ]]; then
cp -r -L bazel-bin/tensorflow_io build/tensorflow_io
cp -r -L bazel-bin/tensorflow_io_gcs_filesystem build/tensorflow_io_gcs_filesystem
else
cp -r bazel-bin/tensorflow_io build/tensorflow_io
cp -r bazel-bin/tensorflow_io_gcs_filesystem build/tensorflow_io_gcs_filesystem
fi

chown -R $(id -nu):$(id -ng) build/tensorflow_io/
chown -R $(id -nu):$(id -ng) build/tensorflow_io_gcs_filesystem/
echo chown -R $(id -nu):$(id -ng) build/tensorflow_io/
echo chown -R $(id -nu):$(id -ng) build/tensorflow_io_gcs_filesystem/
find build/tensorflow_io -name '*runfiles*' | xargs rm -rf
find build/tensorflow_io_gcs_filesystem -name '*runfiles*' | xargs rm -rf

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.space.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#sudo swapoff /swapfile
#sudo rm -rf /swapfile
sudo rm -rf /usr/share/dotnet /usr/local/lib/android /opt/ghc
sudo apt-get remove php* ruby-* subversion mongodb-org -yq >/dev/null 2>&1
#sudo apt-get remove php* ruby-* subversion mongodb-org -yq >/dev/null 2>&1
sudo apt-get autoremove -y >/dev/null 2>&1
sudo apt-get autoclean -y >/dev/null 2>&1
sudo rm -rf /usr/local/lib/android >/dev/null 2>&1
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/build.wheel.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,12 @@ export TF_USE_MODULAR_FILESYSTEM=1
run_test() {
entry=$1
CPYTHON_VERSION=$($entry -c 'import sys; print(str(sys.version_info[0])+str(sys.version_info[1]))')
TF_VERSION=$(/usr/bin/grep tensorflow tensorflow_io/python/ops/version_ops.py | /usr/bin/cut -d '"' -f 2)
$entry -m pip install $TF_VERSION pytest pytest-benchmark pytest-xdist==2.5.0 boto3 fastavro avro-python3 scikit-image pandas pyarrow==3.0.0 google-cloud-pubsub==2.1.0 google-cloud-bigtable==1.6.0 google-cloud-bigquery-storage==1.1.0 google-cloud-bigquery==2.3.1 google-cloud-storage==1.32.0 PyYAML==5.3.1 azure-storage-blob==12.8.1 azure-cli==2.29.0
$entry -m pip uninstall -y tensorflow_io_gcs_filesystem
(cd wheelhouse && $entry -m pip install tensorflow_io_gcs_filesystem-*-cp${CPYTHON_VERSION}-*.whl)
(cd wheelhouse && $entry -m pip install tensorflow_io-*-cp${CPYTHON_VERSION}-*.whl)
TF_VERSION=$(/usr/bin/grep tensorflow tensorflow_io/python/ops/version_ops.py | /usr/bin/cut -d '"' -f 2)
$entry -m pip install -q $TF_VERSION pytest pytest-benchmark pytest-xdist==2.5.0 boto3 fastavro avro-python3 scikit-image pandas pyarrow==3.0.0 google-cloud-pubsub==2.1.0 google-cloud-bigtable==1.6.0 google-cloud-bigquery-storage==1.1.0 google-cloud-bigquery==2.3.1 google-cloud-storage==1.32.0 PyYAML==5.3.1 azure-storage-blob==12.8.1 azure-cli==2.29.0
$entry -m pip freeze
(cd tests && $entry -m pytest --benchmark-disable -v --import-mode=append --forked --numprocesses=auto --dist loadfile $(find . -type f \( -iname "test_*.py" ! \( -iname "test_standalone_*.py" \) \)))
(cd tests && $entry -m pytest --benchmark-disable -v --import-mode=append $(find . -type f \( -iname "test_standalone_*.py" \)))
}
Expand All @@ -22,10 +24,11 @@ fi

if [[ $(uname) == "Linux" ]]; then
apt-get -y -qq update
if [[ "${PYTHON_VERSION}" == "python3.7" ]]; then
if [[ "${PYTHON_VERSION}" == "python3.9" ]]; then
apt-get install -y -qq software-properties-common
add-apt-repository -y ppa:deadsnakes/ppa
apt-get -y -qq update
apt-get -y -qq install python3.9-distutils
fi
apt-get -y -qq install $PYTHON_VERSION ffmpeg dnsutils libmp3lame0
curl -sSOL https://bootstrap.pypa.io/get-pip.py
Expand Down
83 changes: 47 additions & 36 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ env:
jobs:
lint:
name: Lint
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: Run Lint Script for Bazel/Pyupgrade/Black/Clang
run: |
set -x -e
git log --pretty -1
sudo python3 -m pip install -U numpy black pyupgrade
bazel run -s --verbose_failures --experimental_repo_remote_exec //tools/lint:check -- bazel pyupgrade black clang
sudo apt update -y -qq && sudo apt install -y -qq libtinfo5
TF_PYTHON_VERSION=3.10 bazel run -s --verbose_failures --experimental_repo_remote_exec //tools/lint:check -- bazel clang
lint-docs:
name: Lint for Docs
Expand Down Expand Up @@ -62,7 +62,7 @@ jobs:
EOF
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.8"
python-version: "3.9"
- name: macOS
run: |
set -x -e
Expand All @@ -80,9 +80,9 @@ jobs:
linux:
name: Linux
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
container:
image: ubuntu:20.04
image: ubuntu:22.04
env:
REPO_NAME: ${{ env.REPO_NAME }}
EVENT_NAME: ${{ env.EVENT_NAME }}
Expand All @@ -93,7 +93,7 @@ jobs:
cat > service_account_creds.json << EOF
${{ secrets.GCP_CREDS }}
EOF
- name: Ubuntu 20.04
- name: Ubuntu 22.04
shell: bash
run: |
set -x -e
Expand All @@ -103,7 +103,7 @@ jobs:
fi
apt update
apt-get install -y python3
python3 .github/workflows/build.instruction.py docs/development.md "##### Ubuntu 20.04" > source.sh
python3 .github/workflows/build.instruction.py docs/development.md "##### Ubuntu 22.04" > source.sh
cat source.sh
bash -x -e source.sh
Expand Down Expand Up @@ -138,7 +138,7 @@ jobs:
runs-on: [self-hosted, macOS, ARM64]
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
Expand Down Expand Up @@ -185,7 +185,7 @@ jobs:
EOF
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: "3.8"
python-version: "3.10"
- name: Bazel on macOS
run: |
set -x -e
Expand All @@ -211,7 +211,7 @@ jobs:
runs-on: macOS-11
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
Expand Down Expand Up @@ -252,7 +252,7 @@ jobs:
runs-on: macOS-11
strategy:
matrix:
python: ['3.8', '3.9']
python: ['3.9']
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
Expand Down Expand Up @@ -289,12 +289,7 @@ jobs:
linux-bazel:
name: Bazel Linux
runs-on: ubuntu-20.04
container:
image: gcr.io/tensorflow-testing/nosla-ubuntu16.04-manylinux2010
env:
REPO_NAME: ${{ env.REPO_NAME }}
EVENT_NAME: ${{ env.EVENT_NAME }}
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- name: GCP
Expand All @@ -305,13 +300,26 @@ jobs:
- name: Bazel on Linux
shell: bash
run: |
set -x -e
export BAZEL_OPTIMIZATION="--config=optimization --config=linux_ci --config=cache"
if [[ "${EVENT_NAME}" == "push" && "${REPO_NAME}" == "tensorflow/io" ]]; then
export BAZEL_OPTIMIZATION="$BAZEL_OPTIMIZATION --remote_upload_local_results=true --google_credentials=service_account_creds.json"
fi
bash -x -e .github/workflows/build.bazel.sh python3.8
sudo cp .bazelrc build/tensorflow_io/
set -x
#export BAZEL_OPTIMIZATION="--config=optimization --config=linux_ci --config=cache"
#if [[ "${{ env.EVENT_NAME }}" == "push" && "${{ env.REPO_NAME }}" == "tensorflow/io" ]]; then
# export BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION} --remote_upload_local_results=true --google_credentials=service_account_creds.json"
#fi
docker build -t io -f tools/docker/build.Dockerfile --build-arg PYTHON_VERSION=3.10 --build-arg TENSORFLOW_VERSION=2.14 --build-arg BAZEL_OPTIMIZATION="${BAZEL_OPTIMIZATION}" --progress=plain .
docker create -it --name io io bash
sleep 5
docker cp -L io:/opt/io/bazel-bin build
docker cp -L io:/opt/io/.bazelrc build/tensorflow_io/
sudo chown -R $(id -nu):$(id -ng) .
find build/tensorflow_io -type f
find build/tensorflow_io_gcs_filesystem -type f
find build/tensorflow_io -type l
find build/tensorflow_io_gcs_filesystem -type l
find build/tensorflow_io -name '*runfiles*'
find build/tensorflow_io_gcs_filesystem -name '*runfiles*'
find build/tensorflow_io -name '*runfiles*' | xargs rm -rf
find build/tensorflow_io_gcs_filesystem -name '*runfiles*' | xargs rm -rf
sudo rm -rf build/tensorflow_io/core/golang_ops.h
- uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # v3.1.3
with:
name: ${{ runner.os }}-bazel-bin
Expand All @@ -325,7 +333,7 @@ jobs:
runs-on: ubuntu-20.04
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
Expand All @@ -344,7 +352,7 @@ jobs:
set -x -e
ls dist/*
for f in dist/*.whl; do
docker run -i --rm -v $PWD:/v -w /v --net=host quay.io/pypa/manylinux2010_x86_64 bash -x -e /v/tools/build/auditwheel repair --plat manylinux2010_x86_64 $f
docker run -i --rm -v $PWD:/v -w /v --net=host quay.io/pypa/manylinux2014_x86_64 bash -x -e /v/tools/build/auditwheel repair --plat manylinux2014_x86_64 $f
done
sudo chown -R $(id -nu):$(id -ng) .
ls wheelhouse/*
Expand All @@ -356,12 +364,15 @@ jobs:
linux-test:
name: Test ${{ matrix.python }} Linux
needs: linux-wheel
runs-on: ubuntu-20.04
runs-on: ubuntu-22.04
strategy:
matrix:
python: ['3.8', '3.9']
python: ['3.9']
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/setup-python@65d7f2d534ac1bc67fcd62888c5f4f3d2cb2b236 # v4.7.1
with:
python-version: ${{ matrix.python }}
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
with:
name: ${{ runner.os }}-${{ matrix.python }}-wheel
Expand All @@ -373,20 +384,20 @@ jobs:
bash -x -e tests/test_pulsar/pulsar_test.sh
bash -x -e tests/test_kafka/kafka_test.sh
bash -x -e tests/test_aws/aws_test.sh
bash -x -e tests/test_gcloud/test_pubsub_bigtable.sh
bash -x -e tests/test_prometheus/prometheus_test.sh start
echo bash -x -e tests/test_gcloud/test_pubsub_bigtable.sh
echo bash -x -e tests/test_prometheus/prometheus_test.sh start
bash -x -e tests/test_elasticsearch/elasticsearch_test.sh start
bash -x -e tests/test_mongodb/mongodb_test.sh start
bash -x -e tests/test_azure/start_azure.sh
bash -x -e tests/test_sql/sql_test.sh
bash -x -e tests/test_sql/sql_test.sh postgresql
bash -x -e tests/test_gcloud/test_gcs.sh gcs-emulator
bash -x -e tests/test_hdfs/hdfs_test.sh
- name: Test Linux
run: |
set -x -e
df -h
docker run -i --rm -v $PWD:/v -w /v --net=host \
buildpack-deps:20.04 \
buildpack-deps:22.04 \
bash -x -e .github/workflows/build.wheel.sh python${{ matrix.python }}
windows-bazel:
Expand Down Expand Up @@ -438,7 +449,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python: ['3.7', '3.8', '3.9', '3.10', '3.11']
python: ['3.9', '3.10', '3.11']
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
Expand Down Expand Up @@ -469,7 +480,7 @@ jobs:
runs-on: windows-latest
strategy:
matrix:
python: ['3.8', '3.9']
python: ['3.9']
steps:
- uses: actions/checkout@8ade135a41bc03ea155e62e844d188df1ea18608 # v4.1.0
- uses: actions/download-artifact@9bc31d5ccc31df68ecc42ccf4149144866c47d8a # v3.0.2
Expand Down Expand Up @@ -789,7 +800,7 @@ jobs:
set -x -e
ls dist/*
for f in dist/*.whl; do
docker run -i --rm -v $PWD:/v -w /v --net=host quay.io/pypa/manylinux2010_x86_64 bash -x -e /v/tools/build/auditwheel repair --plat manylinux2010_x86_64 $f
docker run -i --rm -v $PWD:/v -w /v --net=host quay.io/pypa/manylinux2014_x86_64 bash -x -e /v/tools/build/auditwheel repair --plat manylinux2014_x86_64 $f
done
sudo chown -R $(id -nu):$(id -ng) .
ls wheelhouse/*
Expand Down
36 changes: 29 additions & 7 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -93,13 +93,36 @@ switched_rules_by_language(

http_archive(
name = "org_tensorflow",
sha256 = "e58c939079588623e6fa1d054aec2f90f95018266e0a970fd353a5244f5173dc",
strip_prefix = "tensorflow-2.13.0",
sha256 = "ce357fd0728f0d1b0831d1653f475591662ec5bca736a94ff789e6b1944df19f",
strip_prefix = "tensorflow-2.14.0",
urls = [
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.13.0.tar.gz",
"https://github.com/tensorflow/tensorflow/archive/refs/tags/v2.14.0.tar.gz",
],
)

http_archive(
name = "rules_python",
sha256 = "84aec9e21cc56fbc7f1335035a71c850d1b9b5cc6ff497306f84cced9a769841",
strip_prefix = "rules_python-0.23.1",
url = "https://github.com/bazelbuild/rules_python/releases/download/0.23.1/rules_python-0.23.1.tar.gz",
)

load("@rules_python//python:repositories.bzl", "python_register_toolchains")
load(
"@org_tensorflow//tensorflow/tools/toolchains/python:python_repo.bzl",
"python_repository",
)

python_repository(name = "python_version_repo")

load("@python_version_repo//:py_version.bzl", "HERMETIC_PYTHON_VERSION")

python_register_toolchains(
name = "python",
ignore_root_user_error = True,
python_version = HERMETIC_PYTHON_VERSION,
)

load("@org_tensorflow//tensorflow:workspace3.bzl", "tf_workspace3")

tf_workspace3()
Expand Down Expand Up @@ -239,11 +262,10 @@ http_archive(
http_archive(
name = "bzip2",
build_file = "//third_party:bzip2.BUILD",
sha256 = "ab5a03176ee106d3f0fa90e381da478ddae405918153cca248e682cd0c4a2269",
strip_prefix = "bzip2-1.0.8",
sha256 = "329e4eb98f6af8d39da05cb51bccec88ae015eac99a42b1ee04dec0af7f4b957",
strip_prefix = "bzip2-bzip2-1.0.8",
urls = [
"https://storage.googleapis.com/mirror.tensorflow.org/sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
"https://sourceware.org/pub/bzip2/bzip2-1.0.8.tar.gz",
"https://gitlab.com/bzip2/bzip2/-/archive/bzip2-1.0.8/bzip2-bzip2-1.0.8.tar.gz",
],
)

Expand Down
Loading

0 comments on commit b5663be

Please sign in to comment.